/*
* product-detail.css — clean minimal + sticky gallery layout
*/

/* ═══════════════════════════════════════════════════════════════
STICKY LEFT / SCROLLABLE RIGHT LAYOUT
The left image gallery sticks in the viewport while the right
info panel scrolls naturally with the page.
════════════════════════════════════════════════════════════ */

/* Outer page wrapper */
.product-detail-page,
.pd-page {
    width: 100%;
}

/* Two-column grid */
.product-detail-layout,
.pd-layout,
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: start;
    /* critical: columns size to content, not each other */
    width: 100%;
}

/* ── LEFT — Sticky image gallery ───────────────────────────── */
.product-gallery,
.pd-gallery,
.product-images,
.pd-left {
    position: sticky;
    top: 70px;
    /* adjust to match your header height */
    height: calc(100vh - 70px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f8f8f8;
}

/* Main image fills the sticky panel */
.product-gallery .main-image-wrap,
.pd-gallery .main-image-wrap,
.product-images .main-image-wrap {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
}

.product-gallery .main-image-wrap img,
.pd-gallery .main-image-wrap img,
.product-images .main-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Thumbnail strip pinned at bottom of sticky panel */
.product-gallery .thumb-strip,
.pd-gallery .thumb-strip,
.product-images .thumb-strip {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    scrollbar-width: thin;
}

.product-gallery .thumb-strip img,
.pd-gallery .thumb-strip img,
.product-images .thumb-strip img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.product-gallery .thumb-strip img:hover,
.product-gallery .thumb-strip img.active {
    border-color: var(--t-secondary, #D4AF37);
}

/* ── RIGHT — Scrollable info panel ─────────────────────────── */
.product-info,
.pd-info,
.pd-right,
.product-detail-info {
    padding: 2rem 2.5rem 4rem;
    /* No height or overflow — scrolls naturally with the page */
}

/* ═══════════════════════════════════════════════════════════════
DELIVERY CHECK WIDGET
════════════════════════════════════════════════════════════ */
.delivery-check-widget {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.delivery-input-wrapper {
    position: relative;
}

#product-pincode {
    font-size: 15px;
    transition: border-color 0.2s;
}

#product-pincode:focus {
    outline: none;
}

#check-delivery {
    white-space: nowrap;
    min-width: 90px;
    font-weight: 600;
}

/* ── Result cards ────────────────────────────────────────────── */
#delivery-info {
    animation: fadeIn 0.25s ease;
}

.delivery-available {
    display: flex;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.delivery-unavailable {
    display: flex;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.delivery-icon {
    font-size: 1.5rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.delivery-details {
    flex: 1;
}

.delivery-details strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.25rem;
}

.delivery-details p {
    color: #555;
    margin: 0;
    font-size: 0.9rem;
}

/* ── Badges ──────────────────────────────────────────────────── */
.free-shipping-badge,
.cod-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.625rem;
    margin-right: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: #fff;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid #e5e7eb;
}

.free-shipping-badge {
    color: #059669;
    border-color: #a7f3d0;
}

.cod-badge {
    color: #92400e;
    border-color: #fcd34d;
}

.free-shipping-badge::before {
    content: "🚚";
    font-size: 0.875rem;
}

.cod-badge::before {
    content: "💵";
    font-size: 0.875rem;
}

/* ── Loader ──────────────────────────────────────────────────── */
.delivery-loader {
    text-align: center;
    padding: 1.25rem;
}

.delivery-loader .spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 0.75rem;
    border: 3px solid #e5e7eb;
    border-top-color: #6b7280;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.delivery-loader p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ── Error ───────────────────────────────────────────────────── */
.delivery-error {
    background: #fffbeb;
    color: #92400e;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    border: 1px solid #fcd34d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Pincode states ──────────────────────────────────────────── */
#product-pincode.valid {
    border-color: #10b981;
}

#product-pincode.invalid {
    border-color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════
ANIMATIONS
════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════
RESPONSIVE — single column on mobile/tablet
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    .product-detail-layout,
    .pd-layout,
    .product-layout {
        grid-template-columns: 1fr;
    }

    /* Gallery loses sticky on mobile — just flows normally */
    .product-gallery,
    .pd-gallery,
    .product-images,
    .pd-left {
        position: relative;
        top: auto;
        height: auto;
        min-height: 300px;
    }

    .product-info,
    .pd-info,
    .pd-right,
    .product-detail-info {
        padding: 1.25rem 1rem 3rem;
    }

    .delivery-available,
    .delivery-unavailable {
        flex-direction: column;
    }
}