
/* SYMPHORIA PREMIUM QUICK VIEW R1 */

html body dialog.sp-purchase-dialog {
    --qv-gold: #d4b66e;
    --qv-black: #141414;
    --qv-border: #e2ddd2;

    position: fixed !important;
    inset: 0 !important;
    margin: auto !important;

    width: min(940px, calc(100% - 40px)) !important;
    max-width: calc(100% - 40px) !important;

    height: auto !important;
    max-height: calc(100vh - 32px) !important;
    max-height: calc(100dvh - 32px) !important;

    padding: 0 !important;
    border: 1px solid #b79b58 !important;
    border-top: 4px solid #b79b58 !important;
    border-radius: 10px !important;

    background: #ffffff !important;
    color: #171717 !important;

    box-sizing: border-box;
    color-scheme: light;
    overflow: auto !important;
    overscroll-behavior: contain;

    box-shadow: 0 24px 90px rgba(0,0,0,.35) !important;
}

html body dialog.sp-purchase-dialog:not([open]) {
    display: none !important;
}

html body dialog.sp-purchase-dialog[open] {
    display: block !important;
}

html body dialog.sp-purchase-dialog::backdrop {
    background: rgba(0,0,0,.72) !important;
    backdrop-filter: blur(4px);
}

html body .sp-purchase-dialog *,
html body .sp-purchase-dialog *::before,
html body .sp-purchase-dialog *::after {
    box-sizing: border-box;
}

/* Desktop two-column layout */

html body .sp-purchase-dialog .sp-dialog-grid {
    display: grid !important;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) !important;
    align-items: stretch !important;
    gap: 0 !important;
}

/* Product image */

html body .sp-purchase-dialog .sp-dialog-image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 0 !important;
    min-height: 0 !important;

    background: #f5f2eb !important;
    padding: 20px !important;
}

html body .sp-purchase-dialog .sp-dialog-image img {
    display: block !important;

    width: 100% !important;
    height: auto !important;

    max-width: 100% !important;
    max-height: min(440px, 65vh) !important;
    max-height: min(440px, 65dvh) !important;

    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    object-position: center !important;

    border-radius: 4px;
    transform: none !important;
}

/* Compact information */

html body .sp-purchase-dialog .sp-dialog-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;

    min-width: 0 !important;
    padding: 30px 28px 24px !important;
    gap: 10px !important;

    background: #ffffff !important;
    color: #171717 !important;
    text-align: left !important;
}

html body .sp-purchase-dialog .catalog-brand {
    display: block !important;
    color: #92762b !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    margin: 0 40px 0 0 !important;
}

/* Product title */

html body .sp-purchase-dialog .sp-dialog-content h2 {
    color: #171717 !important;

    font-size: clamp(22px, 2.4vw, 30px) !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow-wrap: anywhere;
}

/* Compact description */

html body .sp-purchase-dialog .sp-dialog-content > p {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;

    overflow: hidden !important;
    text-overflow: ellipsis;

    color: #66615a !important;
    font-size: 13px !important;
    line-height: 1.5 !important;

    max-height: 4.5em !important;
    margin: 0 !important;
}

/* Prominent price */

html body .sp-purchase-dialog .sp-dialog-price {
    display: block !important;
    color: #171717 !important;

    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;

    margin: 2px 0 0 !important;
    padding: 12px 0 0 !important;

    border-top: 1px solid #e9e3d8;
}

/* Size and quantity in one row */

html body .sp-purchase-dialog .sp-dialog-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 90px !important;
    align-items: end !important;
    gap: 12px !important;

    margin: 0 !important;
    padding: 0 !important;
}

html body .sp-purchase-dialog .sp-dialog-form label {
    display: grid !important;
    gap: 5px !important;

    min-width: 0 !important;

    color: #171717 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

html body .sp-purchase-dialog .sp-dialog-form select,
html body .sp-purchase-dialog .sp-dialog-form input:not([type="hidden"]) {
    width: 100% !important;
    min-width: 0 !important;

    height: 44px !important;
    min-height: 44px !important;

    padding: 8px 10px !important;

    border: 1px solid #d9d0bf !important;
    border-radius: 4px !important;

    background: #ffffff !important;
    color: #171717 !important;

    font-size: 16px !important;
    margin: 0 !important;
}

/* Full-width purchase button */

html body .sp-purchase-dialog .sp-dialog-add {
    grid-column: 1 / -1 !important;

    width: 100% !important;
    min-height: 48px !important;

    background: #141414 !important;
    color: #e5ca8d !important;

    border: 1px solid #141414 !important;
    border-radius: 4px !important;

    padding: 12px 15px !important;

    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: .4px;

    cursor: pointer;
}

html body .sp-purchase-dialog .sp-dialog-add:hover:not(:disabled) {
    background: #d4b66e !important;
    color: #141414 !important;
}

html body .sp-purchase-dialog .sp-dialog-add:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Product details link */

html body .sp-purchase-dialog .sp-dialog-details {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    min-height: 44px !important;

    color: #806522 !important;
    font-size: 13px !important;
    font-weight: 500 !important;

    text-align: center !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;

    margin: 0 !important;
    padding: 4px 0 !important;
}

/* Premium close button */

html body .sp-purchase-dialog .sp-dialog-close {
    position: absolute !important;

    top: 10px !important;
    right: 10px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;

    background: #141414 !important;
    color: #e5ca8d !important;

    border: 1px solid #d4b66e !important;
    border-radius: 50% !important;

    padding: 0 !important;
    margin: 0 !important;

    font-size: 24px !important;
    line-height: 1 !important;

    cursor: pointer;
    z-index: 10;
}

html body .sp-purchase-dialog :focus-visible {
    outline: 2px solid #92762b !important;
    outline-offset: 3px !important;
}

/* Compact desktop screens */

@media (min-width: 768px) and (max-height: 650px) {

    html body .sp-purchase-dialog .sp-dialog-content {
        padding: 22px 24px 16px !important;
        gap: 7px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content h2 {
        font-size: 23px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content > p {
        -webkit-line-clamp: 2;
        max-height: 3em !important;
    }

    html body .sp-purchase-dialog .sp-dialog-price {
        font-size: 23px !important;
        padding-top: 8px !important;
    }
}

/* Mobile one-screen layout */

@media (max-width: 767px) {

    html body dialog.sp-purchase-dialog {
        width: min(460px, calc(100% - 20px)) !important;
        max-width: calc(100% - 20px) !important;

        max-height: calc(100vh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;

        border-radius: 8px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    html body .sp-purchase-dialog .sp-dialog-image {
        padding: 8px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-image img {
        width: 100% !important;

        height: clamp(110px, 27vh, 220px) !important;
        height: clamp(110px, 27dvh, 220px) !important;

        max-height: none !important;
        aspect-ratio: auto !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content {
        padding: 14px 16px 10px !important;
        gap: 7px !important;
    }

    html body .sp-purchase-dialog .catalog-brand {
        font-size: 9px !important;
        letter-spacing: 1.5px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content h2 {
        font-size: 21px !important;
        line-height: 1.18 !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content > p {
        font-size: 12px !important;
        -webkit-line-clamp: 2;
        max-height: 3em !important;
    }

    html body .sp-purchase-dialog .sp-dialog-price {
        font-size: 23px !important;
        padding-top: 8px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-form {
        grid-template-columns: minmax(0, 1fr) 76px !important;
        gap: 9px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-add {
        min-height: 46px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-details {
        font-size: 12px !important;
    }
}

/* Smaller mobile viewport */

@media (max-width: 767px) and (max-height: 700px) {

    html body .sp-purchase-dialog .sp-dialog-image img {
        height: clamp(90px, 21vh, 150px) !important;
        height: clamp(90px, 21dvh, 150px) !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content > p {
        display: none !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content h2 {
        font-size: 19px !important;
    }
}

/* Extra compact viewport */

@media (max-width: 767px) and (max-height: 560px) {

    html body .sp-purchase-dialog .sp-dialog-image img {
        height: 90px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content {
        padding: 10px 12px 6px !important;
        gap: 5px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content h2 {
        font-size: 18px !important;
    }
}

/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {

    html body .sp-purchase-dialog * {
        animation: none !important;
        transition: none !important;
    }
}


/* =========================================
   QUICK VIEW R2 - CONTENT FITTING
   ========================================= */

html body dialog.sp-purchase-dialog {
    width: min(860px, calc(100% - 32px)) !important;

    height: fit-content !important;
    min-height: 0 !important;

    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;

    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;

    transform: translate(-50%, -50%) !important;

    margin: 0 !important;
    padding: 0 !important;

    border-radius: 8px !important;
}

html body .sp-purchase-dialog .sp-dialog-grid {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;

    grid-template-columns:
        minmax(0, .9fr)
        minmax(0, 1.1fr) !important;
}

html body .sp-purchase-dialog .sp-dialog-image {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;

    background: #f5f2eb !important;
}

html body .sp-purchase-dialog .sp-dialog-image img {
    width: 100% !important;
    height: auto !important;

    max-height: min(380px, 65dvh) !important;

    aspect-ratio: auto !important;
    object-fit: contain !important;

    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

html body .sp-purchase-dialog .sp-dialog-content {
    height: auto !important;
    min-height: 0 !important;

    padding: 22px 20px 12px !important;
    gap: 7px !important;

    justify-content: center !important;
}

html body .sp-purchase-dialog .catalog-brand {
    margin: 0 35px 0 0 !important;
    line-height: 1.2 !important;
}

html body .sp-purchase-dialog .sp-dialog-content h2 {
    font-size: 25px !important;
    line-height: 1.15 !important;
    margin: 0 0 2px !important;
}

html body .sp-purchase-dialog .sp-dialog-content > p {
    -webkit-line-clamp: 2 !important;
    max-height: 3em !important;

    font-size: 12px !important;
    line-height: 1.5 !important;

    margin: 0 !important;
}

html body .sp-purchase-dialog .sp-dialog-price {
    font-size: 24px !important;
    padding: 8px 0 0 !important;
    margin: 0 !important;
}

html body .sp-purchase-dialog .sp-dialog-form {
    gap: 8px !important;
    margin: 0 !important;
}

html body .sp-purchase-dialog .sp-dialog-form label {
    gap: 4px !important;
}

html body .sp-purchase-dialog .sp-dialog-add {
    min-height: 44px !important;
    padding: 9px 12px !important;
    margin: 0 !important;
}

html body .sp-purchase-dialog .sp-dialog-details {
    min-height: 40px !important;
    padding: 2px 0 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

html body .sp-purchase-dialog .sp-dialog-close {
    top: 8px !important;
    right: 8px !important;

    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;

    font-size: 21px !important;
}

/* Mobile compact popup */

@media (max-width: 767px) {

    html body dialog.sp-purchase-dialog {
        width: min(390px, calc(100% - 24px)) !important;
        max-width: calc(100% - 24px) !important;

        height: fit-content !important;
        min-height: 0 !important;
    }

    html body .sp-purchase-dialog .sp-dialog-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    html body .sp-purchase-dialog .sp-dialog-image {
        padding: 0 !important;
        min-height: 0 !important;
    }

    html body .sp-purchase-dialog .sp-dialog-image img {
        width: 100% !important;

        height: clamp(120px, 25vh, 210px) !important;
        height: clamp(120px, 25dvh, 210px) !important;

        max-height: none !important;
        object-fit: contain !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content {
        padding: 12px 12px 6px !important;
        gap: 6px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content h2 {
        font-size: 20px !important;
        line-height: 1.15 !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content > p {
        font-size: 11px !important;
        line-height: 1.45 !important;
    }

    html body .sp-purchase-dialog .sp-dialog-price {
        font-size: 22px !important;
        padding-top: 6px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-form {
        grid-template-columns:
            minmax(0, 1fr) 70px !important;
        gap: 7px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-form label {
        font-size: 11px !important;
    }

    html body .sp-purchase-dialog .sp-dialog-details {
        min-height: 36px !important;
        font-size: 12px !important;
    }
}

/* Short mobile screens */

@media (max-width: 767px) and (max-height: 650px) {

    html body .sp-purchase-dialog .sp-dialog-image img {
        height: clamp(90px, 20dvh, 130px) !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content > p {
        display: none !important;
    }

    html body .sp-purchase-dialog .sp-dialog-content h2 {
        font-size: 18px !important;
    }
}

