/* ===== DIALOGS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
}

body.theme-day .modal {
    background: rgba(35, 25, 12, 0.72);
}

#cartModal {
    z-index: 10002;
}

/* ===== PREMIUM PRODUCT DETAIL ===== */
#modal {
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    background: var(--brand-ivory);
    color: var(--brand-black);
}

body.theme-day #modal {
    background: var(--brand-ivory);
}

#modal .product-detail-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 35fr) minmax(0, 28fr) minmax(320px, 37fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--brand-ivory);
    animation: modalIn 0.22s ease both;
}

#productDetailBack {
    position: absolute;
    z-index: 4;
    top: clamp(18px, 3vw, 34px);
    left: clamp(18px, 3vw, 42px);
    width: auto;
    min-height: 42px;
    margin: 0;
    padding: 8px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--brand-charcoal);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#productDetailBack:hover {
    transform: none;
    box-shadow: inset 0 -1px 0 #24221d;
    filter: none;
}

.product-detail-secondary,
.product-detail-primary,
.product-detail-info {
    min-width: 0;
    min-height: 0;
}

.product-detail-secondary {
    display: grid;
    place-items: center;
    padding: clamp(76px, 10vw, 150px) clamp(30px, 6vw, 100px) clamp(36px, 5vw, 76px);
    border-right: 1px solid rgba(36, 34, 29, 0.12);
    background: #ece6dc;
}

.product-detail-secondary img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 520px;
    max-height: 72vh;
    object-fit: contain;
    object-position: center;
}

.product-detail-primary {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(78px, 8vw, 116px) clamp(20px, 2.6vw, 44px) clamp(24px, 3vw, 44px);
    border-right: 1px solid rgba(36, 34, 29, 0.12);
    background: var(--brand-ivory);
}

.product-detail-logo {
    position: absolute;
    top: clamp(22px, 3vw, 38px);
    left: 50%;
    display: block;
    width: clamp(90px, 8vw, 132px);
    height: 44px;
    object-fit: contain;
    transform: translateX(-50%);
}

.product-detail-badge {
    min-height: 18px;
    margin-bottom: 14px;
    color: #6f6043;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
}

.product-detail-badge:empty {
    visibility: hidden;
}

.product-detail-gallery-stage {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    outline: none;
    touch-action: pan-y;
}

.product-detail-gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    transform: translateX(0);
    transition-property: transform;
    will-change: transform;
    cursor: default;
}

.product-detail-gallery-stage.is-draggable .product-detail-gallery-track {
    cursor: grab;
}

.product-detail-gallery-stage.is-draggable .product-detail-gallery-track:active {
    cursor: grabbing;
}

.product-detail-gallery-track > .swiper-slide {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.product-detail-gallery-track .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}

#modalExpandImage {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(36, 34, 29, 0.2);
    border-radius: 50%;
    background: rgba(248, 245, 238, 0.86);
    box-shadow: none;
    color: #24221d;
    backdrop-filter: blur(8px);
}

#modalExpandImage:hover {
    transform: none;
    border-color: rgba(36, 34, 29, 0.52);
    box-shadow: none;
    filter: none;
}

#modalExpandImage svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.5;
}

.product-detail-gallery-dots.swiper-pagination {
    position: static;
    display: flex;
    width: auto;
    min-height: 8px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    transform: none;
}

.product-detail-gallery-dots:empty {
    visibility: hidden;
}

.product-detail-gallery-dots .swiper-pagination-bullet {
    position: relative;
    display: grid;
    width: 24px;
    height: 24px;
    min-height: 24px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    opacity: 1;
}

.product-detail-gallery-dots .swiper-pagination-bullet::after {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(36, 34, 29, 0.28);
    content: "";
}

.product-detail-gallery-dots .swiper-pagination-bullet-active::after {
    background: #24221d;
}

#modal.has-single-image .product-detail-shell,
#modal .product-detail-shell.has-single-image {
    grid-template-columns: minmax(0, 63fr) minmax(320px, 37fr);
}

#modal.has-single-image .product-detail-secondary,
#modal .product-detail-shell.has-single-image .product-detail-secondary {
    display: none;
}

.product-detail-info {
    display: flex;
    height: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    justify-content: safe center;
    padding: clamp(86px, 9vw, 138px) clamp(34px, 5vw, 82px) clamp(36px, 5vw, 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fffdf8;
    text-align: center;
    scrollbar-color: rgba(36, 34, 29, 0.26) transparent;
    scrollbar-width: thin;
}

#modal .modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: center;
    margin: 0 0 26px;
}

#modal .modal-tag {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #716a5e;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
}

#modal .modal-tag:empty {
    display: none;
}

#modalTitle {
    max-width: 16ch;
    margin: 0;
    color: var(--brand-black);
    font-family: var(--font-heading);
    font-size: clamp(34px, 3.4vw, 58px);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 0.98;
    text-align: center;
}

#modal .product-detail-summary {
    margin: 22px 0 0;
    color: var(--brand-charcoal);
    font-family: var(--font-heading);
    font-size: clamp(17px, 1.3vw, 21px);
    line-height: 1.45;
}

#modal .product-detail-summary:empty {
    display: none;
}

#modal .modal-price {
    margin: 30px 0 0;
    color: var(--brand-black);
    font-size: clamp(21px, 1.7vw, 27px);
    font-weight: 600;
    letter-spacing: 0.01em;
}

#modal .modal-price .old-price {
    margin-top: 0;
    margin-left: 10px;
    color: #777064;
    font-size: 14px;
    font-weight: 400;
}

#modal .product-detail-description {
    width: 100%;
    max-width: 58ch;
    margin: 34px 0 0;
    color: #655e54;
    font-size: 14px;
    line-height: 1.75;
    text-align: left;
}

@media (min-width: 769px) {
    #modalTitle {
        max-width: 20ch;
        font-size: clamp(30px, 2.4vw, 42px);
        line-height: 1.04;
    }

    #modal .product-detail-summary {
        max-width: 52ch;
        font-size: clamp(14px, 1vw, 17px);
        line-height: 1.5;
    }

    #modal .product-detail-description {
        font-size: 13px;
        line-height: 1.65;
    }
}

.product-detail-specs {
    width: 100%;
    max-width: 480px;
    margin-top: 34px;
    border-top: 1px solid rgba(36, 34, 29, 0.14);
}

.product-detail-spec {
    display: grid;
    grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.3fr);
    gap: 20px;
    align-items: center;
    min-height: 58px;
    border-bottom: 1px solid rgba(36, 34, 29, 0.14);
}

.product-detail-spec > span {
    color: #716a5e;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.product-detail-spec strong {
    color: #24221d;
    font-size: 13px;
    font-weight: 600;
}

.product-detail-volume-option {
    justify-self: start;
    min-width: 70px;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1px solid #24221d;
    background: #fffdf8;
    text-align: center;
}

.product-detail-intensity-value {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.product-detail-intensity-dots {
    display: flex;
    gap: 6px;
}

.product-detail-intensity-dots span {
    width: 8px;
    height: 8px;
    border: 1px solid #282620;
    border-radius: 50%;
    background: transparent;
}

.product-detail-intensity-dots span.active,
.product-detail-intensity-dots span.is-active,
.product-detail-intensity-dots span[data-active="true"] {
    background: #282620;
}

#modal .modal-insights {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 34px 0 0;
    border: 1px solid rgba(36, 34, 29, 0.14);
    background: rgba(36, 34, 29, 0.14);
    text-align: left;
}

#modal .modal-insights:empty {
    display: none;
}

#modal .modal-insight {
    min-height: 70px;
    padding: 13px;
    border: 0;
    border-radius: 0;
    background: #fffdf8;
}

#modal .modal-insight span {
    display: block;
    margin-bottom: 6px;
    color: #716a5e;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#modal .modal-insight strong {
    display: block;
    color: #24221d;
    font-size: 12px;
    line-height: 1.4;
}

#modal .modal-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 38px;
}

#modal .modal-actions button {
    min-height: 50px;
    margin: 0;
    border-radius: var(--radius-control);
    box-shadow: none;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#modal .modal-actions button:hover {
    transform: none;
    box-shadow: none;
    filter: none;
}

#modal .modal-buy {
    border: 1px solid var(--brand-gold);
    background: var(--brand-gold);
    color: var(--brand-black);
}

#modal .modal-buy:hover {
    border-color: #d0b57f;
    background: #d0b57f;
}

#modal .secondary-action {
    border: 1px solid rgba(36, 35, 33, 0.34);
    background: transparent;
    color: var(--brand-charcoal);
}

#modal .secondary-action:hover {
    border-color: #24221d;
    background: rgba(36, 34, 29, 0.04);
}

#modal .related-products {
    align-self: stretch;
    width: 100%;
    margin-top: 42px;
    text-align: left;
}

#modal .related-products__title {
    margin: 0 0 16px;
    color: var(--brand-black);
    font-family: var(--font-heading);
    font-size: clamp(22px, 1.8vw, 28px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

#modal .related-products__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#modal .related-product-card {
    display: flex;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid rgba(36, 34, 29, 0.14);
    border-radius: 0;
    background: #fffdf8;
    box-shadow: none;
    color: var(--brand-black);
    text-align: left;
}

#modal .related-product-card:hover {
    transform: none;
    border-color: rgba(36, 34, 29, 0.48);
    box-shadow: none;
    filter: none;
}

#modal .related-product-card__image {
    display: block;
    width: 100%;
    height: 118px;
    object-fit: contain;
    object-position: center;
    background: #f3eee5;
}

#modal .related-product-card__content {
    display: flex;
    min-width: 0;
    padding: 12px 2px 2px;
    flex-direction: column;
    gap: 5px;
}

#modal .related-product-card__brand {
    overflow: hidden;
    color: #716a5e;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

#modal .related-product-card__name {
    display: -webkit-box;
    overflow: hidden;
    color: var(--brand-black);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.12;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

#modal .related-product-card__price {
    color: var(--brand-charcoal);
    font-size: 12px;
    font-weight: 600;
}

#modal :is(button, [tabindex]):focus-visible {
    outline: 2px solid #24221d;
    outline-offset: 4px;
}
