/* Public Content Studio product catalog (/products, /products/{slug}, + the home-page grid) --
   content-card styling only. Navbar/footer are shared markup with Home. Same tokens/shell shape
   as cms-page.css/service-page.css/blog-page.css. */

.product-page-main,
.product-index-main {
    flex: 1 0 auto;
    padding: 44px 0 64px;
}

/* ── Detail page ── */
.product-detail {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    padding: 0 16px;
}

.product-gallery-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-layer-1);
    box-shadow: var(--surface-shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-gallery-main .product-no-image { font-size: 64px; color: var(--text-muted); opacity: .5; }

.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.product-gallery-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    cursor: pointer;
    background: none;
    padding: 0;
    flex-shrink: 0;
    transition: border-color .15s;
}
.product-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-gallery-thumb.active { border-color: var(--tenant-primary, #667eea); }

.product-info h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.product-info .product-summary {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.6;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.product-price-current {
    font-size: 28px;
    font-weight: 800;
    color: var(--tenant-primary, #667eea);
}
.product-price-original {
    font-size: 17px;
    color: var(--text-muted);
    text-decoration: line-through;
}
.product-price-offer-badge {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #10b981;
    padding: 3px 10px;
    border-radius: 100px;
}

.product-description {
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--text-secondary);
}
.product-description h2 { font-size: 19px; font-weight: 700; margin: 20px 0 10px; color: var(--text-primary); }
.product-description p { margin-bottom: 12px; }
.product-description ul, .product-description ol { margin-bottom: 12px; padding-left: 22px; }
.product-description img { max-width: 100%; border-radius: 8px; }

/* ── Index / home-page grid ── */
.product-index-header {
    max-width: 700px;
    margin: 0 auto 32px;
    text-align: center;
    padding: 0 16px;
}
.product-index-header h1 { font-size: 30px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.product-index-header p { color: var(--text-muted); font-size: 15.5px; }

/* No max-width/margin/padding of its own -- this always renders inside a Bootstrap .container
   (Home's product section, /products' <main><div class="container">), which already constrains
   and pads the width. Stacking a second, narrower max-width here (was 1100px) on top of the
   container's own (up to 1320px) was cutting a big unwanted gutter into the sides and shrinking
   every card/image with it. minmax bumped up so fewer, bigger cards show per row. */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.product-card {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--surface-shadow-lg);
}

.product-card-image,
.product-card-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: var(--bg-layer-1);
}
.product-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 36px;
    opacity: .5;
}

.product-card-body { padding: 16px 18px 20px; }

.product-card h3 {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.35;
}

.product-card .product-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.product-card .product-price-current { font-size: 17px; }
.product-card .product-price-original { font-size: 13px; }

.product-empty-state {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 767px) {
    .product-detail { grid-template-columns: 1fr; }
}

/* ── Star rating (admin-entered value + count, see _ProductRatingStars.cshtml) ── */
.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f59e0b;
    font-size: 13px;
    margin-bottom: 8px;
}
.rating-stars .rating-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 12.5px;
    margin-left: 4px;
}
.rating-stars .rating-count {
    color: var(--text-muted);
    font-size: 12px;
}
.product-card .rating-stars,
.admin-product-card .rating-stars { font-size: 11px; margin-bottom: 6px; }

/* ── Featured / Best Seller / Out of Stock badges ── */
.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}
.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 4px 9px;
    border-radius: 100px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.product-badge.featured { background: linear-gradient(135deg, #f59e0b, #d97706); }
.product-badge.bestseller { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.product-badge.out-of-stock { background: #6b7280; }

.product-card, .admin-product-card-thumb { position: relative; }
.product-gallery-main { position: relative; }

/* Detail-page badges sit inline above the title instead of overlaying the gallery */
.product-info .product-badges { position: static; margin-bottom: 10px; }

.stock-status-line {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}
.stock-status-line.in-stock { color: #10b981; }
.stock-status-line.out-of-stock { color: #dc2626; }

/* ── Image zoom (product detail page) ──
   Desktop: hover scales the image up with transform-origin following the cursor, clipped by the
   wrapper's overflow:hidden. All devices: clicking the image opens a full-screen lightbox --
   the fallback for touch, where hover doesn't exist. Vanilla JS, no library (see product-gallery.js). */
.product-gallery-main.zoomable { cursor: zoom-in; }
.product-gallery-main.zoomable img {
    transition: transform .12s ease-out;
    will-change: transform;
}
.product-gallery-main.zoomable:hover img {
    transform: scale(2.2);
}

.product-zoom-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 16, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
    cursor: zoom-out;
}
.product-zoom-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.product-zoom-lightbox .zoom-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
