/* =========================================================
   PRODUCT PAGE – DESKTOP + MOBILE FINAL
   MATCHES ABOUT / SHOP STYLE
   ========================================================= */

/* ===============================
   HERO BACKGROUND (ABOUT STYLE)
   =============================== */

.product-hero {
    width: 100%;
    padding: 64px 16px;

    display: flex;
    justify-content: center;

    background:
        radial-gradient(
            1200px circle at 50% 0%,
            #fff6cc 0%,
            #fffdf0 55%,
            #ffffff 100%
        );
}

/* ===============================
   MAIN CARD CONTAINER
   =============================== */

.product-container {
    width: 100%;
    max-width: 1100px;

    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e5e7eb;

    padding: 40px;
    box-sizing: border-box;
}

/* ===============================
   DESKTOP GRID (FIXED WIDTH)
   =============================== */

.product-layout {
    display: grid;
    grid-template-columns: 460px 420px;
    gap: 56px;

    justify-content: center;
    align-items: start;
}

/* ================= LEFT : MEDIA ================= */

.product-media {
    position: relative;
    z-index: 20;              /* 🔥 ADD THIS */
    display: flex;
    flex-direction: column;
    align-items: center;
}


.product-image-wrapper {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;

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

    overflow: hidden;
}

.product-img {
    width: 90%;
    height: auto;
    object-fit: contain;
}

/* ARROWS (DESKTOP ONLY) */
.image-arrow {
    position: absolute;
    top: 45%;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;

    background: rgba(0,0,0,0.4);
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    z-index: 30;
}

.image-arrow.left { left: -18px; }
.image-arrow.right { right: -18px; }

/* THUMBNAILS */
.product-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 14px;

    overflow-x: auto;
    position: relative;     /* 🔥 ADD */
    z-index: 30;            /* 🔥 ADD */
}

.thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    border: 2px solid transparent;

    background: #f8fafc;
    cursor: pointer;
    object-fit: contain;
}

.thumb.active {
    border-color: var(--primary-blue);
}

/* ================= RIGHT : DETAILS ================= */

.product-details {
    width: 100%;
    max-width: 420px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;

    padding: 24px;
}

.product-details h1 {
    font-size: 1.35rem;
    margin-bottom: 20px;
}

/* FORM */
.product-details .form-group {
    margin-bottom: 16px;
}

.product-details label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.product-details select,
.product-details input[type="number"] {
    width: 100%;
    height: 42px;
    padding: 0 12px;

    border-radius: 8px;
    border: 1px solid #d1d5db;
}

/* PRICE */
.price-block {
    margin: 20px 0;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;

    font-size: 1.05rem;
    font-weight: 600;
}

/* CTA */
#addToCartBtn {
    width: 100%;
    height: 46px;

    border-radius: 10px;
    border: none;

    background: var(--primary-blue);
    color: #ffffff;
    font-weight: 600;
}

/* ================= COLOR SWATCHES ================= */

.color-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    cursor: pointer;
}

.color-swatch.active {
    border-color: var(--primary-blue);
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {

    .product-hero {
        padding: 24px 12px;
    }

    .product-container {
        padding: 16px;
        border-radius: 12px;
    }

    .product-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .product-details,
    .product-image-wrapper {
        max-width: 100%;
    }

    .image-arrow {
        display: none !important;
    }
}

/* ================= STICKY CART ================= */

.sticky-cart-bar {
    display: none;
    pointer-events: none;   /* 🔥 ADD */
}

@media (max-width: 768px) {
    .sticky-cart-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;

        padding: 12px;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        z-index: 5000;
        pointer-events: none;    /* 🔥 ADD */
    }

    .sticky-cart-bar button {
        pointer-events: auto;    /* 🔥 ALLOW BUTTON ONLY */
    }
}


/* ===============================
   DELIVERY TIME (TRUST SIGNAL)
   =============================== */

.delivery-time {
    margin-top: 12px;          /* space above */
    margin-bottom: 16px;       /* ✅ space below text */
    font-size: 14px;
    color: #374151;
    line-height: 1.5;          /* improves readability */
    display: flex;
    align-items: center;
    gap: 6px;                  /* space between icon and text */
}

.out-stock-msg {
    margin: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #b91c1c;
}

/* ===============================
   Disable button when out of stock
   =============================== */

select:disabled,
input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}


/* ===============================
   OUT OF STOCK – AMAZON STYLE
   =============================== */

.stock-unavailable {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.stock-status {
    font-size: 15px;
    font-weight: 600;
    color: #b12704; /* Amazon red */
    margin-bottom: 6px;
}

.stock-note {
    font-size: 13.5px;
    color: #374151;
    margin-bottom: 8px;
}

.notify-link {
    font-size: 13.5px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.notify-link:hover {
    text-decoration: underline;
}

/* ===============================
   VARIANT-SPECIFIC AVAILABILITY
   =============================== */

.variant-availability {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

.variant-availability.in-stock {
    color: #007600;
}

.variant-availability.low {
    color: #b12704;
}

.variant-availability.unavailable {
    color: #b12704;
}


/* ===============================
   Notify when the stock is back of out of stock
   =============================== */

.notify-inline {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notify-input {
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.notify-submit {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    background: #f0f2f2;
    border: 1px solid #d5d9d9;
    border-radius: 6px;
    cursor: pointer;
}


.notify-msg {
    margin-top: 6px;
    font-size: 13.5px;
    line-height: 1.4;
}

/* Success: new subscription */
.notify-msg.success {
    color: #065f46; /* green */
}

/* Info: already subscribed */
.notify-msg.info {
    color: #92400e; /* amber */
}

/* Error: validation / network */
.notify-msg.error {
    color: #b91c1c; /* red */
}
.notify-submit:hover {
    background: #e3e6e6;
}

.notify-inline button[disabled] {
    background: #e5e7eb;
    cursor: default;
}


/* ===============================
   FOLLOW THIS PRODUCT” (LOGGED-IN USERS)
   =============================== */
.follow-btn {
    margin-top: 10px;
    background: none;
    border: none;
    color: #2563eb;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.follow-btn:hover {
    text-decoration: underline;
}

.login-to-cart-btn {
    display: block;
    width: 100%;
    padding: 14px;
    text-align: center;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
}

.login-to-cart-btn:hover {
    background: #1e4fd8;
}
/* ===============================
   FIX: Guest login button must NOT block media clicks
   =============================== */

.add-to-cart-section {
    position: relative;
    z-index: 2;
}

.login-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 48px;

    text-decoration: none;
    font-weight: 600;
    border-radius: 10px;

    /* 🔥 CRITICAL */
    pointer-events: auto;
}

/* 🔥 Ensure media area is always clickable */
.product-media,
.product-media * {
    pointer-events: auto;
}

/* Defensive: prevent accidental overlay expansion */
.product-details {
    position: relative;
    z-index: 1;
}


/* ===============================
   see USER REVIEWS
   =============================== */

.reviews {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.review-item {
    margin-bottom: 16px;
}

.review-item .rating {
    font-weight: 600;
    color: #f59e0b;
}

/* ===============================
   WRITE user REVIEWS
   =============================== */

.review-form {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.review-form form {
    max-width: 420px;
}

.review-form label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

.review-form textarea,
.review-form select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
}

.review-form button {
    margin-top: 16px;
}

/* ===============================
   AMAZON-STYLE REVIEWS
   =============================== */

.product-reviews {
    background: #fff;
    padding: 48px 16px;
    border-top: 1px solid #e5e7eb;
}

.reviews-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
}

.reviews-left h2 {
    margin-bottom: 24px;
}

/* ===============================
   FIX: LIMIT REVIEW LIST HEIGHT
   =============================== */

.reviews-left {
    max-height: 420px;        /* ✅ prevents page from growing */
    overflow-y: auto;         /* ✅ internal scroll */
    padding-right: 8px;
}

/* Scrollbar polish (optional but Amazon-like) */
.reviews-left::-webkit-scrollbar {
    width: 6px;
}

.reviews-left::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.reviews-left::-webkit-scrollbar-track {
    background: transparent;
}

.review-card {
    border-bottom: 1px solid #eee;
    padding: 16px 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stars {
    color: #f59e0b;
    font-size: 16px;
}

.review-date {
    font-size: 13px;
    color: #666;
}

.review-comment {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.reviews-right {
    border: 1px solid #e5e7eb;
    padding: 24px;
    border-radius: 8px;
    height: fit-content;
}

.write-review-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.write-review-form textarea {
    min-height: 100px;
    resize: vertical;
}

.review-submit-btn {
    margin-top: 8px;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

.review-submit-btn:hover {
    background: #1d4ed8;
}

/* MOBILE */
@media (max-width: 768px) {
    .reviews-container {
        grid-template-columns: 1fr;
    }
}

.product-image-wrapper {
    position: relative;
}

.product-img.secondary {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.product-image-wrapper:hover .secondary {
    opacity: 1;
}
/*

*/
/* =====================================
   AMAZON STYLE PRODUCT ACCORDION
   ===================================== *//*


.product-accordion {
    margin-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.accordion-item {
    border-bottom: 1px solid #e5e7eb;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

.accordion-header:hover {
    color: var(--primary-blue);
}

.accordion-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.35s ease;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

.accordion-content.open {
    max-height: 1000px;
    padding-bottom: 18px;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}*/

/* =========================================================
   ENTERPRISE AMAZON-STYLE PRODUCT ACCORDION
   ========================================================= */

.product-accordion {
    margin-top: 48px;
    border-top: 1px solid #e5e7eb;
}

/* Item */
.accordion-item {
    border-bottom: 1px solid #e5e7eb;
}

/* Header Button */
.accordion-header {
    width: 100%;
    background: none;
    border: none;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 22px 0;
    cursor: pointer;

    font-size: 17px;
    font-weight: 600;
    color: #111827;
    text-align: left;
}

.accordion-header:hover {
    color: var(--primary-blue);
}

/* Icon */
.accordion-icon {
    font-size: 20px;
    font-weight: 400;
    transition: transform 0.3s ease;
}

/* Panel wrapper */
.accordion-panel {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Content */
.accordion-content {
    padding-bottom: 22px;
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

/* Open state */
.accordion-item.active .accordion-icon {
    transform: rotate(45deg); /* + becomes x */
}

/* Spec list */
.spec-list {
    padding-left: 18px;
}

.spec-list li {
    margin-bottom: 6px;
}

/* ================= MOBILE POLISH ================= */

@media (max-width: 768px) {

    .product-accordion {
        margin-top: 32px;
    }

    .accordion-header {
        padding: 18px 0;
        font-size: 16px;
    }

    .accordion-content {
        font-size: 14px;
    }
}

/* ==========Product description on product page=========== */

/* =========================
   SMART DESCRIPTION FORMAT
========================= */

.product-description {
    font-size: 14px;
    line-height: 1.8;
    color: #374151;
    white-space: pre-line;   /* THIS preserves line breaks */
}

/* Highlight first paragraph */
.product-description > div:first-child {
    font-weight: 500;
    color: #111827;
    margin-bottom: 12px;
}

/* Auto style dash lines like bullet points */
.product-description div {
    position: relative;
}

/* Replace dash visually */
.product-description div::before {
    content: "";
}

.moq-note {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #b91c1c;
    font-weight: 500;
}
/*=================alert error==============*/
.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 10px 0 16px 0;
    font-size: 14px;
    border: 1px solid #fecaca;
}

#addToCartBtn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    opacity: 0.7;
}