 /* ==========================================================================
   Millat Mart - Product Detail Page Stylesheet
   File: /assets/css/pages/product.css
   Used only by: product.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   Product Layout Grid
   A CSS Grid (not a plain Bootstrap row) so the visual order can differ
   between mobile and desktop without duplicating any markup:
     - Mobile (<992px): single column, order is Image -> Title -> Meta ->
       Price -> Buy Box (Add to Cart, right after Price) -> Offers ->
       Specs -> Description.
     - Desktop (>=992px): a compact 3-column summary up top (image |
       title/meta/price/offers | buy box), with Specifications and
       Description breaking out into their own full-width rows underneath -
       they need far more horizontal room than the ~33% middle column can
       offer.
   -------------------------------------------------------------------------- */
.product-layout {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    grid-template-areas:
        "image"
        "title"
        "meta"
        "price"
        "buybox"
        "offers"
        "specs"
        "desc";
    margin-bottom: 2rem;
}

.pl-image  { grid-area: image; }
.pl-title  { grid-area: title; }
.pl-meta   { grid-area: meta; }
.pl-price  { grid-area: price; }
.pl-offers { grid-area: offers; }
.pl-specs  { grid-area: specs; }
.pl-desc   { grid-area: desc; }
.pl-buybox { grid-area: buybox; }

/* Sticky image/buy-box panels - desktop only (see media query below).
   On mobile this stays a normal static block so nothing floats oddly
   while the page is a single reordered column. */
.product-sticky-panel {
    position: static;
}

@media (min-width: 992px) {
    .product-layout {
        grid-template-columns: 5fr 4fr 3fr;
        column-gap: 2rem;
        row-gap: 0;
        align-items: start;
        grid-template-areas:
            "image title  buybox"
            "image meta   buybox"
            "image price  buybox"
            "image offers buybox"
            "specs specs  specs"
            "desc  desc   desc";
    }
    .pl-title, .pl-meta, .pl-price {
        margin-bottom: 1.1rem;
    }
    .pl-offers {
        margin-bottom: 0.5rem;
    }
    .pl-specs, .pl-desc {
        margin-top: 0.5rem;
    }
    .product-sticky-panel {
        position: sticky;
        top: 20px;
        z-index: 10;
    }
}

/* Main Image presentation container */
.product-main-img-container {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #eaeaea;
}

/* Specs / Description full-width panels (desktop) */
.pl-panel {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.pl-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1c2b22;
    margin-bottom: 1rem;
}

/* Specifications key/value table - parsed from "Key: Value | Key: Value".
   Two columns on all sizes (values here are short), but stacks to one
   column automatically wherever a single field's content is genuinely
   too long to fit via the auto-fit/minmax sizing below. */
.spec-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0;
    border-top: 1px solid #eee;
}

.spec-row {
    display: grid;
    grid-template-columns: minmax(120px, 40%) 1fr;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.spec-label {
    color: #6c757d;
    font-weight: 600;
}

.spec-value {
    color: #1c2b22;
}

.spec-value-full {
    grid-column: 1 / -1;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .spec-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
        padding: 0.6rem 0;
    }
    .spec-label {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
}

/* Rich Description & Feature Styling */
.product-description-content {
    font-size: 0.95rem;
    line-height: 1.8;
    max-width: 900px;
}

.product-description-content h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1c2b22;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.product-description-content ul {
    padding-left: 1.2rem;
    color: #6c757d;
}

.product-description-content li {
    margin-bottom: 0.4rem;
}
/* --------------------------------------------------------------------------
   Product Image Gallery (main image + zoom hint + thumbnail strip +
   click-to-enlarge lightbox). Replaces the old plain single <img> box.
   -------------------------------------------------------------------------- */
.pg-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pg-main-wrap {
    position: relative;
    background: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    overflow: hidden;
}

.pg-main-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: none;
    background: #ffffff;
    padding: 0;
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
}

.pg-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
    pointer-events: none;
}

.pg-main-image:hover img {
    transform: scale(1.08);
}

.pg-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    background: rgba(5, 46, 22, 0.78);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.pg-main-image:hover .pg-zoom-hint {
    opacity: 1;
}

.pg-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 5px 11px;
    border-radius: 6px;
    color: #fff;
}

.pg-badge-sale {
    background: #dc3545;
}

.pg-badge-oos {
    background: #495057;
    top: 50px;
}

.pg-wishlist-btn {
    top: 14px;
    right: 14px;
    z-index: 3;
}

.pg-thumbs {
    display: flex;
    flex-direction: row;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pg-thumbs::-webkit-scrollbar {
    display: none;
}

.pg-thumb {
    flex: 0 0 auto;
    width: 68px;
    height: 68px;
    padding: 0;
    border-radius: 8px;
    border: 2px solid #eef0f2;
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.pg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pg-thumb:hover {
    border-color: #16a34a;
}

.pg-thumb.active {
    border-color: var(--primary-color, #dc3545);
}

/* Lightbox modal */
.pg-lightbox-content {
    background: rgba(20, 20, 20, 0.97);
    border: none;
    border-radius: 12px;
}

.pg-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    filter: invert(1) grayscale(1) brightness(2);
    opacity: 0.85;
}

.pg-lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.pg-lightbox-stage img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
}

.pg-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: background 0.15s ease;
}

.pg-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.28);
}

.pg-lightbox-prev {
    left: 16px;
}

.pg-lightbox-next {
    right: 16px;
}

@media (max-width: 575.98px) {
    .pg-lightbox-stage {
        padding: 1rem;
        min-height: 50vh;
    }
    .pg-lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* --------------------------------------------------------------------------
   Premium Product Info Column (title, meta, price, offers)
   -------------------------------------------------------------------------- */
.pl-product-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #16241c;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

@media (min-width: 992px) {
    .pl-product-title {
        font-size: 1.7rem;
    }
}

.pl-crumb-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #15803d;
    background: #eafaf0;
    border-radius: 999px;
    padding: 4px 12px;
}

.pl-rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #198754;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 6px;
}

.pl-rating-pill i {
    font-size: 0.7rem;
}

.pl-review-link {
    font-size: 0.85rem;
    color: #6c757d;
    text-decoration: none;
}

.pl-review-link:hover {
    color: #16a34a;
    text-decoration: underline;
}

/* Price block */
.pl-price-card {
    background: linear-gradient(180deg, #f3faf5 0%, #ffffff 65%);
    border: 1px solid #cdebd7;
    border-radius: 12px;
    padding: 1.1rem 1.35rem;
}

.pl-price-now {
    font-size: 2rem;
    font-weight: 800;
    color: #c0392b;
    letter-spacing: -0.01em;
}

.pl-price-now.no-discount {
    color: #16241c;
}

.pl-price-old {
    font-size: 1.05rem;
    color: #9a9a9a;
    text-decoration: line-through;
}

.pl-save-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dc3545;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
}

.pl-save-line {
    font-size: 0.85rem;
    color: #198754;
    font-weight: 600;
    margin-top: 6px;
}

.pl-tax-note {
    font-size: 0.78rem;
    color: #9a9a9a;
    margin-top: 4px;
}

/* Offers & Discounts component */
.pl-offers-card {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
}

.pl-offers-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #16241c;
    padding: 0.85rem 1.1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
}

.pl-offers-head i {
    color: #dc3545;
    font-size: 1.05rem;
}

.pl-offer-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.75rem 1.1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #f2f2f2;
}

.pl-offer-row:last-child {
    border-bottom: none;
}

.pl-offer-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.pl-offer-icon.tag   { background: #fdecea; color: #dc3545; }
.pl-offer-icon.bank  { background: #e7f1ff; color: #0d6efd; }
.pl-offer-icon.bulk  { background: #eaf7ee; color: #198754; }

.pl-offer-text strong {
    display: block;
    color: #16241c;
    font-weight: 700;
    margin-bottom: 1px;
}

.pl-offer-text span {
    color: #6c757d;
}

/* --------------------------------------------------------------------------
   Buy Box (right column) - premium redesign
   -------------------------------------------------------------------------- */
.pl-buybox-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    padding: 1.35rem;
    box-shadow: 0 4px 18px rgba(20, 23, 26, 0.06);
}

.pl-buybox-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: #16241c;
}

.pl-buybox-price .pl-price-old {
    font-size: 0.9rem;
    margin-left: 6px;
}

.pl-stock-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0.6rem 0 1rem;
}

.pl-stock-row.in-stock { color: #198754; }
.pl-stock-row.low-stock { color: #dc3545; }
.pl-stock-row.out-stock { color: #6c757d; }

.pl-stock-bar {
    height: 5px;
    border-radius: 999px;
    background: #eee;
    overflow: hidden;
    margin-bottom: 1rem;
}

.pl-stock-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #dc3545);
    border-radius: 999px;
}

/* Delivery estimate component */
.pl-delivery-box {
    display: flex;
    gap: 12px;
    background: #f2f9f4;
    border: 1px solid #d9f0e0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.pl-delivery-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #198754;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.pl-delivery-text strong {
    display: block;
    font-size: 0.85rem;
    color: #16241c;
    font-weight: 700;
}

.pl-delivery-text span {
    font-size: 0.78rem;
    color: #557a63;
}

/* Quantity stepper */
.pl-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #d8dbdf;
    border-radius: 8px;
    overflow: hidden;
    height: 40px;
}

.pl-qty-btn {
    width: 38px;
    border: none;
    background: #f8f9fa;
    color: #16241c;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pl-qty-btn:hover {
    background: #eef0f2;
}

.pl-qty-input {
    width: 48px;
    border: none;
    border-left: 1px solid #d8dbdf;
    border-right: 1px solid #d8dbdf;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    -moz-appearance: textfield;
}

.pl-qty-input::-webkit-outer-spin-button,
.pl-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pl-buybox-actions .btn {
    border-radius: 9px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

.pl-trust-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e5e5e5;
}

.pl-trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #556;
    font-weight: 600;
}

.pl-trust-item i {
    color: #16a34a;
    font-size: 0.95rem;
}
