/* === Variables & Reset === */
.keisar-hp {
    --keisar-accent: #A69B8F;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
}

.keisar-hp *,
.keisar-hp *::before,
.keisar-hp *::after {
    box-sizing: border-box;
}

/* === Layout === */
.keisar-hp__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: start;
    max-width: 80rem;
    width: 100%;
    margin: 0 auto;
}

/* === Gallery === */
.keisar-hp__gallery {
    display: flex;
    flex-direction: row-reverse;
    gap: 1rem;
    position: sticky;
    top: 6rem;
    min-width: 0;
}

.keisar-hp__thumbs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    max-height: 600px;
    padding: 0.25rem;
    flex-shrink: 0;
}

.keisar-hp__thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    background: none;
    padding: 0;
    transition: border-color 0.2s;
}

.keisar-hp__thumb:hover {
    border-color: #9CA3AF;
}

.keisar-hp__thumb--active {
    border-color: var(--keisar-accent);
    box-shadow: 0 0 0 1px var(--keisar-accent);
}

.keisar-hp__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.keisar-hp__main-img {
    position: relative;
    flex: 1;
    min-width: 0;
    border: 1px solid #F3F4F6;
    overflow: hidden;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.keisar-hp__hero-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 2rem;
    transition: opacity 0.2s ease, transform 0.5s ease;
}

.keisar-hp__hero-img:hover {
    transform: scale(1.05);
}

/* Badges */
.keisar-hp__badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keisar-hp__badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
}

/* === Product Info === */
.keisar-hp__info {
    min-width: 0;
    overflow: hidden;
}

.keisar-hp__rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.keisar-hp__stars {
    display: flex;
    color: var(--keisar-accent);
}

.keisar-hp__star {
    color: #E5E7EB;
}

.keisar-hp__star--filled {
    color: var(--keisar-accent);
}

.keisar-hp__reviews {
    font-size: 0.75rem;
    color: #6B7280;
    text-decoration: underline;
    cursor: pointer;
}

.keisar-hp__reviews:hover {
    color: var(--keisar-accent);
}

.keisar-hp__name {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.keisar-hp__price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #F3F4F6;
}

.keisar-hp__price {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--keisar-accent);
}

.keisar-hp__price del {
    color: #9CA3AF;
    font-size: 1.25rem;
}

.keisar-hp__price ins {
    text-decoration: none;
}

.keisar-hp__free-ship {
    font-size: 0.875rem;
    color: #16A34A;
    background: #F0FDF4;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.keisar-hp__short-desc {
    font-size: 1rem;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 300;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* === Features === */
.keisar-hp__features {
    margin-bottom: 2rem;
}

.keisar-hp__features-heading {
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem;
    color: #111827;
}

.keisar-hp__features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keisar-hp__feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #4B5563;
}

.keisar-hp__feature--hidden {
    display: none;
}

.keisar-hp__check {
    flex-shrink: 0;
    margin-top: 0.25rem;
    color: var(--keisar-accent);
}

.keisar-hp__feature span {
    font-size: 0.875rem;
    line-height: 1.6;
    min-width: 0;
}

.keisar-hp__show-more {
    background: none;
    border: none;
    color: var(--keisar-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0;
    margin-top: 0.75rem;
    border-bottom: 1px solid var(--keisar-accent);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.keisar-hp__show-more:hover {
    color: #111827;
    border-color: #111827;
}

/* === Purchase Area === */
.keisar-hp__purchase {
    background: #F9F9F9;
    padding: 1.5rem 2rem;
    border: 1px solid #F3F4F6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-top: 0.5rem;
    position: sticky;
    top: 6rem;
    z-index: 5;
    overflow: hidden;
}

.keisar-hp__purchase-inner {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 3rem;
}

/* Why Us */
.keisar-hp__why-us {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-inline-start: 1px solid #E5E7EB;
    padding-inline-start: 2rem;
}

.keisar-hp__why-us-heading {
    font-size: 1.125rem;
    color: #6B7280;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin: 0 0 1.25rem;
}

.keisar-hp__why-us-line {
    flex-grow: 1;
    height: 1px;
    background: #E5E7EB;
}

.keisar-hp__why-us-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-inline-end: 0.5rem;
}

.keisar-hp__why-us-list li {
    display: flex;
    align-items: center;
    justify-content: right;
    gap: 0.75rem;
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
    cursor: default;
    transition: color 0.2s;
}

.keisar-hp__why-us-list li:hover {
    color: var(--keisar-accent);
}

.keisar-hp__why-us-list li svg {
    color: #9CA3AF;
    flex-shrink: 0;
    transition: color 0.2s;
}

.keisar-hp__why-us-list li:hover svg {
    color: var(--keisar-accent);
}

.keisar-hp__why-us-btn {
    display: inline-block;
    background: #EEECE7;
    color: #666;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    width: 100%;
}

.keisar-hp__why-us-btn:hover {
    background: #E5E3DE;
    color: #111827;
}

/* Cart Column */
.keisar-hp__cart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Variation Form */
.keisar-hp__variations-form {
    width: 100%;
    max-width: 100%;
}

.keisar-hp__variations-form .variations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.keisar-hp__variation-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keisar-hp__variation-label {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.keisar-hp__select-wrap {
    position: relative;
    width: 100%;
}

.keisar-hp__select-wrap select,
.keisar-hp__select {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border: 1px solid #E5E5E5;
    color: #374151;
    text-align: right;
    padding: 0.75rem 1rem;
    padding-inline-start: 2.5rem;
    appearance: none;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.keisar-hp__select-wrap select:focus,
.keisar-hp__select:focus {
    outline: none;
    border-color: var(--keisar-accent);
}

.keisar-hp__select-arrow {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding-inline-start: 1rem;
    pointer-events: none;
    color: #9CA3AF;
}

/* Add to Cart Button */
.keisar-hp__add-to-cart {
    width: 100%;
    max-width: 100%;
    background: var(--keisar-accent);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-top: 1rem;
}

.keisar-hp__add-to-cart:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.keisar-hp__add-to-cart:active {
    transform: translateY(0);
}

.keisar-hp__disclaimer {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin: 0.5rem 0 0;
}

/* WooCommerce variation info */
.keisar-hp .single_variation_wrap {
    width: 100%;
    max-width: 100%;
}

.keisar-hp .single_variation .woocommerce-variation-price {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.keisar-hp .single_variation {
    display: block !important;
}

.keisar-hp .single_variation .woocommerce-variation-availability .stock {
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

/* === Trust Badges === */
.keisar-hp__trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    width: 100%;
}

.keisar-hp__trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    background: #F9FAFB;
    border-radius: 0.75rem;
    transition: background 0.2s;
    min-width: 0;
}

.keisar-hp__trust-item:hover {
    background: #F3F4F6;
}

.keisar-hp__trust-icon {
    padding: 0.5rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 0.5rem;
    color: var(--keisar-accent);
    line-height: 1;
}

.keisar-hp__trust-icon i,
.keisar-hp__trust-icon svg {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.keisar-hp__trust-title {
    font-weight: 700;
    font-size: 0.75rem;
    color: #111827;
    margin: 0 0 0.125rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.keisar-hp__trust-desc {
    font-size: 10px;
    color: #6B7280;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* === Share === */
.keisar-hp__share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #9CA3AF;
    border-top: 1px solid #F3F4F6;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.keisar-hp__share-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.keisar-hp__share-btns {
    display: flex;
    gap: 0.5rem;
}

.keisar-hp__share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    background: #F9FAFB;
    color: #9CA3AF;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.keisar-hp__share-btn:hover {
    background: #E5E7EB;
    color: #111827;
}

/* Placeholder (editor only) */
.keisar-hp__placeholder {
    padding: 40px;
    text-align: center;
    background: #F5F5F5;
    border: 2px dashed #CCC;
    border-radius: 8px;
}

/* === Toast notifications === */
.keisar-hp__toast-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.keisar-hp__toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: auto;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 360px;
}

.keisar-hp__toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.keisar-hp__toast--success { background: #16A34A; }
.keisar-hp__toast--warning { background: #D97706; }
.keisar-hp__toast--error   { background: #DC2626; }

.keisar-hp__toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    margin-inline-start: auto;
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
}

.keisar-hp__toast-close:hover { opacity: 1; }

.keisar-hp__toast-link {
    color: inherit;
    text-decoration: underline;
    font-weight: 700;
}

/* === Button loading state === */
.keisar-hp__add-to-cart--loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    color: transparent;
}

.keisar-hp__add-to-cart--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: keisar-spin 0.6s linear infinite;
}

@keyframes keisar-spin {
    to { transform: rotate(360deg); }
}

/* === Disabled button (out-of-stock variation) === */
.keisar-hp__add-to-cart--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* === Select error highlight + shake === */
.keisar-hp__select-wrap--error select {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 1px #DC2626;
}

.keisar-hp__select-wrap--shake {
    animation: keisar-shake 0.4s ease;
}

@keyframes keisar-shake {
    0%, 100% { transform: translateX(0); }
    20%  { transform: translateX(-4px); }
    40%  { transform: translateX(4px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
}

/* === Stock status indicator === */
.keisar-hp__stock-status {
    font-size: 0.813rem;
    font-weight: 500;
    padding: 0.375rem 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.keisar-hp__stock-status--out { color: #DC2626; }
.keisar-hp__stock-status--in  { color: #16A34A; }

/* === Out-of-stock product message === */
.keisar-hp__out-of-stock {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 0.5rem;
    color: #DC2626;
    font-size: 0.875rem;
    font-weight: 500;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .keisar-hp__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .keisar-hp__gallery {
        position: relative;
        top: auto;
        flex-direction: column-reverse;
    }

    .keisar-hp__thumbs {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
    }

    .keisar-hp__main-img {
        aspect-ratio: 1;
        height: auto;
    }

    .keisar-hp__purchase {
        position: relative;
        top: auto;
    }

    .keisar-hp__trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .keisar-hp__grid {
        gap: 1.5rem;
    }

    .keisar-hp__thumb {
        width: 60px;
        height: 60px;
    }

    .keisar-hp__name {
        font-size: 1.5rem;
    }

    .keisar-hp__price {
        font-size: 1.375rem;
    }

    .keisar-hp__price del {
        font-size: 1rem;
    }

    .keisar-hp__short-desc {
        font-size: 0.875rem;
    }

    .keisar-hp__purchase {
        padding: 1rem;
    }

    .keisar-hp__purchase-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .keisar-hp__why-us {
        border-inline-start: none;
        padding-inline-start: 0;
        border-bottom: 1px solid #E5E7EB;
        padding-bottom: 1.5rem;
    }

    .keisar-hp__why-us-btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }

    .keisar-hp__add-to-cart {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }

    .keisar-hp__hero-img {
        padding: 1rem;
    }

    .keisar-hp__toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .keisar-hp__toast {
        max-width: 100%;
    }
}
