/* ========== Hero Section ========== */
.hero-section {
    background-image: url('uploads/sitespecific/background.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    padding: 100px 20px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.7);
    font-family: 'Arial', sans-serif;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto;
}


/* CATEGORY */
.category-nav {
    margin-bottom: 2rem;
}

.category-nav ul {
    display: flex;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.category-nav li {
    cursor: pointer;
    padding: 0.5rem 1rem;
    background-color: var(--gray-color, #f4f4f4);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.category-nav li.active,
.category-nav li:hover {
    background-color: var(--primary-color, #9e2b3c);
    color: white;
}

/* Toggle button */
.category-toggle button {
    background-color: var(--gray-color, #f4f4f4);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font: inherit;
    transition: background-color 0.3s ease;
}

.category-toggle button:hover {
    background-color: var(--primary-color, #9e2b3c);
    color: white;
}

/* Dropdown initially hidden */
.hidden {
    display: none;
}

/* CATEGORY TOGGLE BEHAVIOR */
.sub-categories {
    display: none;
}

.sub-categories.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 769px) {
    .sub-categories {
        display: flex !important;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 0;
        gap: 1rem;
    }

    .category-toggle {
        display: none !important;
    }
}


/* Responsive Category Nav */
@media (max-width: 768px) {
    .hero-section {
        margin-bottom: 1.5rem;
    }

    .category-nav {
        margin-bottom: 1.5rem;
    }

    .category-hamburger {
        display: flex;
    }

    .category-nav ul {
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        background-color: #fff;
        border: 1px solid #ccc;
        padding: 1rem;
        margin: 0;
    }

    .category-nav.active ul {
        display: flex;
    }
}

/* Responsive Benefits Section */
.benefits-section {
    background-color: #f8f8f8;
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 4rem;
}

.benefits-section h2 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 2rem;
}


.benefits-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem;
}

.benefit-card {
    flex: 1 1 300px;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.icon-circle {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color, #9e2b3c);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.5rem;
}

.benefit-card h3 {
    margin-bottom: 1rem;
}

/* ========== Products Grid ========== */
.products-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 0 2rem;
    margin-bottom: 4rem;
}

.product-card {
    width: 100%;
    max-width: 300px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;

    /* --- EDITED: Flexbox for consistent bottom alignment --- */
    display: flex;
    flex-direction: column; /* Stacks image and info vertically */
    min-height: 420px; /* IMPORTANT: Adjust this value based on your content to ensure enough space */
    /* ---------------------------------------------------- */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.product-card h2 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.25rem;
}

.product-card p {
    padding: 0 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* NOTE: .product-card .price is now redundant if you are using .product-price */
.product-card .price {
    font-weight: 600;
    color: #9c2c4c;
    padding: 0.5rem 1rem;
}

.product-actions {
    display: flex;
    padding: 1rem;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.btn-details,
.btn-cart {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    position: relative;
    z-index: 2;
}

.btn-details {
    background: none;
    border: 1px solid #9c2c4c;
    color: #9c2c4c;
}

.btn-details:hover {
    background: rgba(156, 44, 76, 0.1);
}

.btn-cart {
    background: #9c2c4c;
    border: 1px solid #9c2c4c;
    color: white;
}

.btn-cart:hover {
    background: #7e2039;
}

.product-detail-view {
    padding: 40px 0;
}

.product-detail-main {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.product-detail-image img {
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.product-detail-info {
    flex: 1;
    min-width: 250px;
    /* --- EDITED: Flexbox for bottom alignment within the info section --- */
    display: flex;
    flex-direction: column; /* Stack content vertically */
    flex-grow: 1; /* Allows this section to take up all available vertical space in .product-card */
    justify-content: space-between; /* Pushes first item to top, last items (price, moq) to bottom */
    padding: 1rem; /* Existing padding */
    padding-bottom: 1rem; /* Ensure consistent padding at the bottom */
    text-align: center; /* Keep text centered horizontally */
    /* ----------------------------------------------------------------- */
}

/* --- NEW: Wrapper for the content that should stay at the top of product-info --- */
.product-top-content {
    margin-bottom: auto; /* Pushes subsequent flex items (price, moq) as far down as possible */
}
/* ------------------------------------------------------------------------------- */


.product-detail-features {
    margin: 20px 0;
    padding-left: 20px;
}

.btn-back {
    margin-bottom: 20px;
    background: #971d35;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.product-image.square {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background-color: #f7f7f7;
}

.product-image.square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Pseudo-element for card focus/click */
.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.product-card:focus-within {
    outline: 2px solid #9c2c4c;
    outline-offset: 2px;
}

/* ========== Custom Solutions ========== */
.custom-solutions {
    text-align: center;
    padding: 2rem;
    margin-bottom: 4rem;
}

.custom-solutions h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.custom-solutions p {
    max-width: 800px;
    margin: 0 auto 2rem;
    color: #666;
}

.cta-section {
    text-align: center;
    padding: 60px 20px;
    background-color: #f9f9f9;
    /* light background box */
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
    /* center it */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cta-buttons {
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.color-chart-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.custom-color {
    background-color: #7e2231 !important;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
}

.modal-product-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ========== Responsive Styles ========== */
@media (max-width: 768px) {
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .header-actions {
        margin-top: 15px;
    }

    .benefits-container,
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .products-container {
        padding: 0 1rem;
        gap: 1rem;
    }

    .product-card {
        flex: 0 0 calc(50% - 1rem);
        /* Two cards per row */
        max-width: calc(50% - 1rem);
        box-sizing: border-box; /* Ensures padding/border are included in width calculation */
    }

    /* Specific media query for hiding text on small screens */
    @media (max-width: 768px) {
        .product-card p:not(.product-price),
        .product-card .product-category {
            display: none; /* Hide description and category on small screens to save space */
        }
        .product-card {
            min-height: 350px; /* Adjust min-height for smaller screens if content is hidden */
        }
    }
}

.product-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-whatsapp,
.btn-color-chart {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-color-chart {
    background-color: #7e2039;
    color: white;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    font-weight: bold;
}

/* Optional: make product-buttons in modal responsive */
#modalDetails .product-buttons {
    margin-top: 20px;
}

/* Image Slider/Swiper within Modal */
.product-image-slider {
    position: relative;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1 / 1;
}

.slider-images {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.slider-images img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

.slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 10;
    padding: 0 10px;
}

.slider-controls button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.slider-controls button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dot.active-dot {
    background-color: var(--primary-color, #9e2b3c);
    border-color: var(--primary-color, #9e2b3c);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-whatsapp,
    .btn.custom-color {
        width: 100%;
        max-width: 250px;
    }

    .product-image-slider {
        max-width: 90vw;
    }

    .slider-controls {
        padding: 0 5px;
    }

    .slider-controls button {
        padding: 8px 12px;
        font-size: 1rem;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .header-actions {
        margin-top: 15px;
    }

    .benefits-container,
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
}

.product-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-whatsapp,
.btn-color-chart {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-color-chart {
    background-color: #7e2039;
    color: white;
}

/* Force hidden by default */
#categoryDropdown {
    display: none !important;
}

/* Show when toggled */
#categoryDropdown.show {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Add vertical margin below the top buttons */
.main-category-list {
    margin-bottom: 1rem;
}


/* On desktop, always show */
@media (min-width: 769px) {
    #categoryDropdown {
        display: flex !important;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: 0;
        margin-top: 1rem;
    }

    .category-toggle {
        display: none !important;
    }
}

#categoryDropdown.locked li {
    display: none;
}

#categoryDropdown.locked li.active {
    display: block;
    margin: 0 auto;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-start;
    padding: 0 1rem;
    margin-top: 0.5rem;
    font-weight: 500;
    color: #333;
}

.product-price {
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #9c2c4c;
    /* --- EDITED: Adjusted margin for spacing from MOQ --- */
    margin: 0.5rem 0 0.25rem; /* Small margin-bottom for space between price and MOQ */
    white-space: nowrap; /* Added to prevent breaking */
}

.product-moq {
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #9c2c4c;
    /* --- EDITED: Removed all margins, padding is handled by parent --- */
    margin: 0; /* No explicit margin, it will be placed by flexbox and product-info padding */
    white-space: nowrap; /* Added to prevent breaking */
}


.modal-actions + p strong {
    font-weight: bold;
    font-size: 1rem;
    color: #9c2c4c;
}

.product-moq-modal {
    font-weight: bold;
    font-size: 1rem;
    color: #9c2c4c;
    margin: 0.5rem 0 1rem;
}

/* --- NEW: Style for the top content wrapper within product-info --- */
.product-top-content {
    /* This element will be pushed to the top by justify-content: space-between on .product-info */
    margin-bottom: auto; /* Pushes subsequent flex items (price, moq) as far down as possible */
}

.preview-image-wrapper {
    /* Existing styles */
    cursor: grab; /* Indicate draggable */
}

.preview-image-wrapper:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.2;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
}