/* =========================================================
   DG24 FRONTEND
   Product Detail
   RTL / Mobile First / Premium
   ========================================================= */

.product-page {
    width: 100%;
    padding: 24px 0 48px;
}

.product-container {
    width: min(1200px, calc(100% - 24px));
    margin: 0 auto;
}


/* =========================================================
   Breadcrumb
   ========================================================= */

.product-breadcrumb {
    margin-bottom: 20px;
    color: #777;
    font-size: 13px;
}


/* =========================================================
   Main Product
   ========================================================= */

.product-main {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}


/* =========================================================
   Gallery
   ========================================================= */

.product-gallery {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(128, 0, 32, .08);
}

.product-main-image {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #fafafa;
    overflow: hidden;
}

.product-main-image img {
    display: block;
    width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.product-image-list {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.product-image-thumb {
    flex: 0 0 72px;
    height: 72px;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.product-image-thumb:hover {
    border-color: #800020;
    transform: translateY(-1px);
}

.product-image-thumb.is-active {
    border-color: #800020;
    box-shadow: 0 0 0 2px rgba(128, 0, 32, .12);
}

.product-image-thumb:focus-visible {
    outline: 2px solid #800020;
    outline-offset: 2px;
}

.product-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* =========================================================
   Information
   ========================================================= */

.product-info {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 30px rgba(128, 0, 32, .08);
}

.product-title {
    margin: 0 0 16px;
    color: #222;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.7;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 22px;
    color: #777;
    font-size: 14px;
}

.product-meta strong {
    color: #444;
}


/* =========================================================
   Price
   ========================================================= */

.product-price-box {
    padding: 18px;
    margin-bottom: 22px;
    border-radius: 16px;
    background: #fff7f8;
    border: 1px solid rgba(128, 0, 32, .08);
}

.product-price-label {
    display: block;
    margin-bottom: 5px;
    color: #777;
    font-size: 13px;
}

.product-price {
    color: #800020;
    font-size: 28px;
    font-weight: 800;
}

.product-price-unit {
    margin-right: 5px;
    color: #555;
    font-size: 14px;
}


/* =========================================================
   Variants
   ========================================================= */

.product-variants {
    margin: 24px 0;
}

.product-variants-title {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 700;
}

.product-variant-list {
    display: grid;
    gap: 10px;
}

.product-variant {
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 14px;
    background: #fff;
}

.product-variant:hover {
    border-color: #800020;
}

.product-variant-sku {
    display: block;
    margin-bottom: 5px;
    color: #777;
    font-size: 12px;
}

.product-variant-price {
    color: #800020;
    font-weight: 700;
}


/* =========================================================
   Description
   ========================================================= */

.product-description {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid #eee;
}

.product-description h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.product-description-content {
    color: #555;
    line-height: 2.1;
}


/* =========================================================
   Purchase
   ========================================================= */

.product-purchase {
    margin-top: 24px;
}

.product-stock {
    margin-bottom: 14px;
    color: #555;
    font-size: 14px;
}

.product-add-cart {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 14px;
    background: #800020;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform .2s ease,
        opacity .2s ease;
}

.product-add-cart:hover {
    opacity: .92;
    transform: translateY(-1px);
}

.product-add-cart:active {
    transform: translateY(0);
}


/* =========================================================
   Empty Images
   ========================================================= */

.product-no-image {
    color: #999;
    font-size: 14px;
}


/* =========================================================
   STICKY PURCHASE BAR
   ========================================================= */

.product-sticky-purchase {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid rgba(128, 0, 32, .12);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .10);
    backdrop-filter: blur(10px);
}

.product-sticky-purchase-inner {
    width: min(1200px, calc(100% - 24px));
    min-height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.product-sticky-price {
    min-width: 0;
}

.product-sticky-price-label {
    display: block;
    margin-bottom: 3px;
    color: #777;
    font-size: 12px;
}

.product-sticky-price-value {
    display: flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}

.product-sticky-price-value strong {
    color: #800020;
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 800;
    line-height: 1.3;
}

.product-sticky-price-value span {
    color: #555;
    font-size: 12px;
    font-weight: 600;
}

.product-sticky-cart {
    flex: 0 0 auto;
    min-width: 230px;
    min-height: 52px;
    padding: 0 24px;
    border: 0;
    border-radius: 13px;
    background: #800020;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform .2s ease,
        opacity .2s ease;
}

.product-sticky-cart:hover {
    opacity: .92;
    transform: translateY(-1px);
}

.product-sticky-cart:active {
    transform: translateY(0);
}


/* =========================================================
   DESKTOP PAGE SPACE
   ========================================================= */

body:has(.product-sticky-purchase) {
    padding-bottom: 90px;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {

    .product-page {
        padding: 16px 0 32px;
    }

    .product-container {
        width: min(100% - 16px, 600px);
    }

    .product-main {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-gallery,
    .product-info {
        padding: 16px;
        border-radius: 16px;
    }

    .product-main-image {
        min-height: 280px;
    }

    .product-title {
        font-size: 23px;
    }

    .product-price {
        font-size: 24px;
    }

    .product-image-thumb {
        flex-basis: 68px;
        height: 68px;
    }


    /* =====================================================
       Mobile Sticky Purchase
       ===================================================== */

    .product-sticky-purchase {
        bottom: 92px;
        padding: 8px 10px;
    }

    .product-sticky-purchase-inner {
        width: 100%;
        min-height: 58px;
        gap: 10px;
    }

    .product-sticky-price {
        flex: 1 1 auto;
        min-width: 0;
    }

    .product-sticky-price-label {
        margin-bottom: 1px;
        font-size: 11px;
    }

    .product-sticky-price-value {
        gap: 4px;
    }

    .product-sticky-price-value strong {
        font-size: 20px;
    }

    .product-sticky-price-value span {
        font-size: 11px;
    }

    .product-sticky-cart {
        flex: 1 1 52%;
        min-width: 0;
        min-height: 50px;
        padding: 0 12px;
        border-radius: 12px;
        font-size: 14px;
    }


    /* =====================================================
       Page Bottom Space
       ===================================================== */

    body:has(.product-sticky-purchase) {
        padding-bottom: 180px;
    }


    .product-description {
        margin-top: 24px;
        padding-top: 22px;
    }
}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 420px) {

    .product-main-image {
        min-height: 230px;
    }

    .product-info {
        padding: 14px;
    }

    .product-title {
        font-size: 21px;
    }

    .product-price-box {
        padding: 14px;
    }

    .product-add-cart {
        min-height: 50px;
    }

    .product-image-thumb {
        flex-basis: 62px;
        height: 62px;
    }


    /* Keep purchase bar above mobile navigation */

    .product-sticky-purchase {
        bottom: 125px;
        padding: 7px 8px;
    }

    .product-sticky-purchase-inner {
        min-height: 56px;
        gap: 8px;
    }

    .product-sticky-price-value strong {
        font-size: 18px;
    }

    .product-sticky-cart {
        min-height: 48px;
        padding: 0 9px;
        font-size: 13px;
    }


    body:has(.product-sticky-purchase) {
        padding-bottom: 180px;
    }
}


/* =========================================================
   Reduced Motion
   ========================================================= */

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

    .product-add-cart,
    .product-image-thumb,
    .product-sticky-cart {
        transition: none;
    }

}


/* =========================================================
   Product Extra Sections
   ========================================================= */

.product-extra-sections {
    margin-top: 32px;
}

.product-extra-section {
    padding: 24px 0;
    border-top: 1px solid #eee;
}

.product-extra-section h2 {
    margin: 0 0 14px;
    color: #222;
    font-size: 20px;
    line-height: 1.7;
}

.product-extra-content {
    color: #666;
    font-size: 14px;
    line-height: 2;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {

    .product-extra-sections {
        margin-top: 24px;
    }

    .product-extra-section {
        padding: 20px 0;
    }

    .product-extra-section h2 {
        font-size: 18px;
    }

}
