@import url("./components/header.css");
@import url("./components/footer.css");

/* ===============================
   LAYOUT
=============================== */

.product-wrapper {
    /* padding: 40px 0; */
}
a{
    color: #6b8e23;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background: #ffffff;
    padding: 18px;
    border-radius: 5px;
}

/* ===============================
   MEDIA
=============================== */

.product-media img {
    width: 100%;
    border-radius: 12px;
}

.thumbnail-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.thumbnail-row img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail-row img:hover {
    border-color: #6b8e23;
}

/* ===============================
   BREADCRUMB
=============================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #6b7280; /* muted gray */
    margin-top: 50px;
    background: #ffffff;
    padding: 18px;
    border-radius: 5px;
}

.breadcrumb a {
    color: #000; /* link blue */
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #6b8e23;
    text-decoration: underline;
}

.breadcrumb span {
    color: #9ca3af; /* separator color */
}

.breadcrumb strong {
    color: #6b8e23; /* active/current page */
    font-weight: 600;
}
@media (max-width: 768px) {
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 13px;
        padding: 12px;
        margin-top: 20px;
    }
}


/* ===============================
   PRODUCT DETAILS
=============================== */

.product-details h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.short-desc {
    color: #555;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* ===============================
   PRICE & DISCOUNT (FINAL)
=============================== */

.price-box {
    margin: 15px 0 20px;
    background: #f6f8f3;
    padding: 16px 18px;
    border-radius: 12px;
}

.price-row,
.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price {
    font-size: 26px;
    font-weight: 700;
    color: #6b8e23;
}

.old-price {
    font-size: 15px;
    color: #9ca3af;
    text-decoration: line-through;
}

.save-text {
    width: 100%;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #16a34a;
}

.tax-note {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.sale-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.sale-timer {
    margin-top: 8px;
    font-size: 13px;
    color: #b45309;
    background: #fff7ed;
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-block;
}

/* ===============================
   VARIATIONS
=============================== */

.variant-block {
    margin-bottom: 20px;
}

.variant-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.variant-pill {
    padding: 8px 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-pill.active {
    background: #6b8e23;
    color: #fff;
    border-color: #6b8e23;
}

/* ===============================
   COLOR SWATCHES
=============================== */

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    border: 2px solid #ddd;
}

.color-swatch.active {
    border-color: #6b8e23;
    box-shadow: 0 0 0 2px rgba(107,142,35,0.3);
}

/* ===============================
   IMAGE SWATCHES
=============================== */

.image-swatch {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ddd;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.image-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.image-swatch.active {
    border-color: #6b8e23;
    box-shadow: 0 0 0 2px rgba(107,142,35,0.3);
}

/* ===============================
   QUANTITY
=============================== */

.qty-box {
    margin: 20px 0;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.qty-control button {
    width:40px;
    height:40px;
    border: none;
    background: #6b8e23;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

/* ===============================
   ADD TO CART
=============================== */

.add-cart-btn {
    width: 100%;
    padding: 15px;
    background: #6b8e23;
    color: white;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.add-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.cart-actions {
    display: flex;
    align-items: center;
    gap: 12px; /* space between buttons */
}

.add-cart-btn,
.btn-wishlist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-wishlist {
            background: white;
            color: var(--accent-color);
            border: 2px solid var(--accent-color);
            padding: 1rem 1.5rem;
            border-radius: 8px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-wishlist:hover {
            background: var(--accent-color);
            color: white;
        }

/* ===============================
   STATUS & META
=============================== */

.status-text {
    margin-top: 8px;
    font-size: 14px;
    color: #555;
}

.meta {
    margin-top: 20px;
    color: #555;
}

/* ===============================
   MESSAGES
=============================== */

.variation-message {
    background: #f6f6f6;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.variation-message.info {
    color: #555;
}

.variation-message.success {
    color: #2e7d32;
    background: #e8f5e9;
}

.variation-message.warning {
    color: #b26a00;
    background: #fff8e1;
}

.variation-message.error {
    color: #c62828;
    background: #fdecea;
}
.variation-message.error {
    border: 1px solid #c62828;
}

/* ===============================
   INVALID VARIATION STATE
=============================== */

/* ===== VALID SELECTED OPTION ===== */
.variant-pill.active-valid,
.color-swatch.active-valid,
.image-swatch.active-valid {
    border: 2px solid #6b8e23 !important;
    box-shadow: 0 0 0 2px rgba(107,142,35,0.3);
}

/* ===== INVALID SELECTED OPTION ===== */
.variant-pill.active-invalid,
.color-swatch.active-invalid,
.image-swatch.active-invalid {
    border: 2px solid #c62828 !important;
    box-shadow: 0 0 0 2px rgba(198,40,40,0.25);
}

/* ===== DISABLED OPTION (not selectable) ===== */
.variant-pill.disabled-option,
.color-swatch.disabled-option,
.image-swatch.disabled-option {
    opacity: 0.4;
    pointer-events: none;
}

/* ================= REVIEWS ================= */
.product-tabs {
    margin-top: 20px;
    margin-bottom: 50px;
}

.tabs {
    border-bottom: 1px solid #ddd;
}
.product-tabs .tab-content {
    display: none;
    background: #ffffff;
    border-radius: 5px;
    padding: 20px;
}

.product-tabs .tab-content.active {
    display: block;
}

.product-tabs .tab-btn {
    cursor: pointer;
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-weight: 600;
}

.product-tabs .tab-btn.active {
    border-bottom: 2px solid #6b8e23;
    background: #ffffff;
    border-top-right-radius: 10px;
}
.tab-btn {
    background: none;
    border: none;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    border-color: #4a7c2c;
    color: #4a7c2c;
}

.reviews-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}
.no-reviews{
    background: #efefef;
    padding: 10px;
    border-radius: 5px;
}

/* Rating box */
.rating-box {
    padding: 25px;
    border-radius: 5px;
    /*margin-bottom: 30px;*/
    text-align: center;
}

.rating-score {
    font-size: 42px;
    font-weight: bold;
}

.rating-stars span {
    font-size: 20px;
    color: #ccc;
}

.rating-stars .filled {
    color: #ffb400;
}

/* ================================
   CART/WISHLIST TOAST
================================ */
.cart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 280px;
    background: #28a745;
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    animation: slideInDown 0.3s ease;
}

.cart-toast.show {
    display: block !important;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.toast-icon {
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-text {
    flex: 1;
    min-width: 0;
}

.toast-text strong {
    display: block;
    font-size: 12px;
    margin-bottom: 1px;
    line-height: 1.3;
    font-weight: 600;
}

#toastMessage {
    font-size: 11px;
    opacity: 0.95;
    line-height: 1.2;
}

.toast-btn {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 3px 6px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 10px;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
    display: inline-block;
}

.toast-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInDown {
    from {
        transform: translateY(-400px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .cart-toast {
        top: auto;
        right: 12px;
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        max-width: none;
        animation: slideInUp 0.3s ease;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.rating-count {
    margin-top: 8px;
    color: #666;
}

/* Review cards */
.review-card {
    border-bottom: 1px solid #eee;
    padding: 18px 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.review-stars.small span {
    font-size: 14px;
}

.review-comment {
    margin: 10px 0;
    color: #444;
}

.review-date {
    font-size: 12px;
    color: #999;
}

.verified {
    color: #4a7c2c;
    font-size: 12px;
}

/* Review form */
.review-form {
    background: #fff;
    border: 1px solid #eee;
    padding: 25px;
    border-radius: 10px;
    position: sticky;
    top: 100px;
}

.review-form h4 {
    margin-bottom: 15px;
}

.star-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.star-input input {
    display: none;
}

.star-input label {
    font-size: 22px;
    color: #ccc;
    cursor: pointer;
}

.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
    color: #ffb400;
}

.review-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
}

.review-form button {
    background: #4a7c2c;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
}

/* Info box */
.review-info {
    background: #efefef;
    padding: 20px;
    border-radius: 8px;
    color: #555;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 768px) {
    .reviews-layout {
        grid-template-columns: 1fr;
    }

    .review-form {
        position: static;
    }
}
/* Review stars */
.review-stars span {
    font-size: 16px;
    color: #d1d1d1; /* empty star */
}

.review-stars span.filled {
    color: #ffb400; /* filled star (gold) */
}
/* Star base */
.rating-stars span {
    font-size: 18px;
    color: #d1d1d1;
    position: relative;
    display: inline-block;
}

/* Full star */
.rating-stars .filled {
    color: #ffb400;
}

/* Half star */
.rating-stars .half {
    color: #d1d1d1;
}

.rating-stars .half::before {
    content: "★";
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: #ffb400;
}
/* ===============================
   RELATED PRODUCTS (FIXED STYLES)
=============================== */

.related-products-slider .category-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.related-products-slider .category-image img {
    border-radius: 8px;
}

/* Title */
.related-products-slider .related-product-title {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #222;
    margin-top: 8px;
    text-decoration: none;
    line-height: 1.4;
}

.related-products-slider .related-product-title:hover {
    color: #6b8e23;
}

/* Price */
.related-products-slider .related-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #6b8e23;
    margin-top: 4px;
}

/* Fix swiper slide height */
.related-products-slider .swiper-slide {
    height: auto;
}

.related-products-slider .category-image {
    height: 180px;              /* fixed image area */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.related-products-slider .category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;          /* keeps image ratio */
}

.related-products-slider .category-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-products-slider .related-product-info {
    padding: 10px 6px 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Title: max 2 lines */
.related-products-slider .related-product-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    min-height: 42px;   /* keeps equal height */
}
.related-products-slider .price-current {
    font-size: 16px;
    font-weight: 700;
    color: #6b8e23;
    clear:both;
    display:block;
}

.related-products-slider .price-old {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 6px;
}

/* ===============================
   RELATED PRODUCT PRICE ALIGNMENT
=============================== */

.related-products-slider .related-product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.related-products-slider .price-current {
    font-size: 16px;
    font-weight: 700;
    color: #6b8e23;
}

.related-products-slider .price-old {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}
.product-meta-row {
    margin: 8px 0 14px;
    font-size: 0.9rem;
    color: #666;
}
.product-meta-row .meta-link {
    color: #2f6b1d;
    text-decoration: none;
}
.product-meta-row .meta-link:hover {
    text-decoration: underline;
}
.meta-separator {
    margin: 0 4px;
}
.tag-pill {
    display: inline-block;
    background: #eef5ea;
    color: #2f6b1d;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    margin-right: 6px;
    margin-top: 4px;
    text-decoration: none;
}
.tag-pill:hover {
    background: #dfeeda;
}
/* =========================================
   DETAIL PAGE – CART UI (MATCH SHOP LISTING)
========================================= */

.product-details .ingredient-actions {
    padding: 0;
    margin-top: 12px;
}

.product-details .ingredient-actions.compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-details .price-qty-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    border-radius: 10px;
}

.product-details .price-text {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.product-details .price-text small {
    font-weight: 500;
    color: #666;
}

/* QTY INLINE (SAME AS LISTING) */
.product-details .qty-inline {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.product-details .qty-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: #f2f2f2;
    font-size: 16px;
    cursor: pointer;
}

.product-details .qty-btn:hover {
    background: #e6e6e6;
}

.product-details .qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

/* CART BUTTON */
.product-details .cart-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.product-details .cart-btn i {
    font-size: 14px;
}

/* REMOVE OLD PRODUCT PAGE STYLES EFFECT */
.product-details .add-cart-btn,
.product-details .cart-actions,
.product-details .qty-control,
.product-details .qty-row,
.product-details .total-row {
    display: none !important;
}

/* =========================================
   DETAIL PAGE – IMAGE SIZE & BALANCE FIX
========================================= */

/* Reduce image dominance */
.product-media {
    max-width: 520px;      /* controls visual width */
    margin: 0 auto;
}

/* Main product image */
.product-media img#mainProductImage {
    width: 100%;
    max-height: 420px;     /*  key control */
    object-fit: contain;  /* keeps full product visible */
    background: #f8fafc;  /* subtle backdrop */
    padding: 16px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

/* Thumbnail refinement */
.thumbnail-row {
    justify-content: center;
    margin-top: 14px;
}

.thumbnail-row img {
    width: 64px;
    height: 64px;
    opacity: 0.75;
    transition: all .25s ease;
}

.thumbnail-row img:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Better grid balance */
.product-grid {
    align-items: start;
}

/* Desktop spacing harmony */
@media (min-width: 992px) {
    .product-grid {
        gap: 40px;
    }
}

/* Mobile polish */
@media (max-width: 768px) {

    .product-media {
        max-width: 100%;
    }

    .product-media img#mainProductImage {
        max-height: 300px;
        padding: 12px;
    }

    .thumbnail-row img {
        width: 56px;
        height: 56px;
    }
}


/* =========================================
   PRODUCT IMAGE SLIDER (DETAIL PAGE)
========================================= */

.product-media {
    max-width: 620px;      /* ️ balanced size */
    margin: 0 auto;
}







/* Thumbnails */
.thumbnail-row {
    justify-content: center;
    margin-top: 14px;
}

.thumbnail-row img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    opacity: .6;
    border: 2px solid transparent;
    transition: all .25s;
}

.thumbnail-row img.active,
.thumbnail-row img:hover {
    opacity: 1;
    border-color: #6b8e23;
    transform: translateY(-2px);
}


/* =====================================================
   FINAL PRODUCT IMAGE + THUMB FIX (AUTHORITATIVE)
===================================================== */

/* Image container */
.product-media {
    max-width: 560px;
    margin: 0 auto;
}

/* Main product image */
.product-media img#mainProductImage {
    width: 100%;
    height: 420px;
    object-fit: contain;
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* Thumbnails – BIG & CLICKABLE */
.thumbnail-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
}

.thumbnail-row img {
    width: 96px;        /*  BIGGER */
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0.65;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.thumbnail-row img:hover,
.thumbnail-row img.active {
    opacity: 1;
    border-color: #6b8e23;
    transform: translateY(-3px);
}

/* Grid balance */
.product-grid {
    align-items: flex-start;
}

/* Mobile */
@media (max-width: 768px) {
    .product-media img#mainProductImage {
        height: 300px;
        padding: 14px;
    }

    .thumbnail-row img {
        width: 72px;
        height: 72px;
    }
}
