
/* Global Styles */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #F8F8F8;
    color: #333333;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
}

/* Custom Classes for Tailwind */
.text-accent-yellow {
    color: #FFAA00;
}

.bg-black {
    background-color: #000000;
}

.border-black {
    border-color: #000000;
}

.focus\:border-black:focus {
    border-color: #000000;
}

.shadow-black-focus:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.4);
}

.text-heading {
    color: #1A1A1A;
}

.text-body-dark {
    color: #333333;
}

.font-cinzel {
    font-family: 'Cinzel', serif;
}

/* Header */
header {
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #EDEDED;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-logo-text {
    font-family: 'Cinzel', serif;
    font-weight: 800;
}

.nav-link {
    position: relative;
    color: #333333;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000000;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
    transform: translateX(0);
}

.nav-link:hover {
    color: #000000;
}

/* Mobile Menu Styles */
#mobile-menu {
    display: none;
    padding-bottom: 1rem;
}

#mobile-menu.active {
    display: flex;
}

.nav-link-mobile {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #333333;
    width: 100%;
    border-radius: 6px;
}

.nav-link-mobile:hover {
    background-color: #F0F0F0;
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
    #nav-list {
        display: flex;
        flex-direction: row;
        position: static;
        background: none;
        border: none;
        padding: 0;
        box-shadow: none;
    }
    #mobile-menu {
        display: none !important;
    }
}

/* Filter Dropdown */
.filter-select {
    background-color: #FFFFFF;
    border: 1px solid #CCCCCC;
    color: #333333;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.filter-select:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    outline: none;
}

.filter-select:hover {
    border-color: #A0A0A0;
}

/* Product Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem; /* Adjusted for better mobile spacing */
    overflow: hidden;
    padding-bottom: 2rem; /* Add extra padding to ensure content doesn't touch footer directly */
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem; /* Slightly larger gap for small tablets/larger phones */
    }
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem; /* Original gap for medium screens */
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem; /* Original gap for large screens */
    }
}

/* Product Grid Item Styles */
.product-grid-item {
    background-color: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    text-decoration: none;
    color: inherit;
    /* Removed fixed min-height. Let content dictate height. */
}

.product-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

/* --- START OF CHANGES FOR IMAGE-NAME GAP --- */

/* Target the div that contains the product image (to override Tailwind's h-64) */
.product-grid-item > div:first-of-type {
    height: 180px; /* Set this div's height to match the desired image height for desktop */
    overflow: hidden; /* Ensure it still hides any overflow */
}

.product-grid-item img {
    width: 100%;
    height: 100%; /* Make the image fill its parent div's height */
    object-fit: contain; /* Ensure the full image is visible, no cropping */
    background-color: #FDFDFD;
    border-bottom: 1px solid #EDEDED;
    /* Removed aspect-ratio here as height: 100% will dominate within fixed parent */
}

.product-info-content {
    padding: 1rem; /* Default padding for desktop */
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    /* Removed fixed min-height. */
}

.product-name {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1A1A1A;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price Information Layout (no changes here for this specific issue, but kept for context) */
.price-info {
    display: flex;
    justify-content: center;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    overflow: hidden;
    width: 100%;
}

.product-price {
    color: #333333;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.original-price {
    font-size: 0.85rem;
    color: #888888;
    text-decoration: line-through;
    margin: 0;
    white-space: nowrap;
}

.discount-text {
    color: #FF0000;
    font-weight: 700;
    font-size: 0.8rem;
    margin: 0;
    white-space: nowrap;
}

/* Product Section (previously adjusted for footer overlap, keeping those values) */
section.py-16 {
    padding-top: 4rem;
    padding-bottom: 5rem; /* Increased to ensure space for footer */
    overflow: hidden;
}

/* Footer (Copied from index.css for consistency) */
footer {
    background-color: #000000;
    color: #FFFFFF;
    border-top: 1px solid #333333;
    margin-top: 2rem;
}

.footer-link {
    color: #FFFFFF;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: #CCCCCC;
}

.footer-social-icon {
    color: #FFFFFF;
    transition: color 0.3s ease, transform 0.2s ease;
}

.footer-social-icon:hover {
    color: #CCCCCC;
    transform: translateY(-3px);
}

/* Back to Top (Copied from index.css for consistency) */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #000000;
    color: #FFFFFF;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
    cursor: pointer;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: #1F1F1F;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Responsive Adjustments (specifically targeting mobile less than 768px) */
@media (max-width: 767px) {
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        border-top: 1px solid #EDEDED;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    }

    .nav-list.active {
        display: flex;
    }

    .nav-list li {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }

    .nav-list .nav-link {
        display: block;
        padding: 0.5rem 0;
        font-size: 1rem;
    }

    .mobile-menu-icon {
        display: block;
        z-index: 60;
        color: #333333;
    }

    .filter-section {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .filter-select {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
        background-size: 0.9rem;
        background-position: right 0.5rem center;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem; /* Adjusted for better mobile spacing */
        padding-bottom: 2rem; /* Ensure sufficient space for products above footer */
    }

    .product-grid-item {
        width: 100%;
        max-width: none;
        /* Removed fixed min-height */
    }

    /* --- MOBILE-SPECIFIC CHANGES FOR IMAGE-NAME GAP --- */

    /* Ensure the image container is correctly sized on mobile, overriding h-64 */
    .product-grid-item > div:first-of-type {
        height: 150px; /* Set the image container to the exact desired mobile image height */
    }

    .product-grid-item img {
        height: 100%; /* Image now fills its correctly sized parent div */
        /* object-fit: contain is already set above and inherited */
    }

    .product-info-content {
        /* Reduce padding-top to lessen the gap between image and text */
        padding-top: 0.5rem; /* Reduced from 0.75rem */
        padding-right: 0.75rem;
        padding-bottom: 0.75rem;
        padding-left: 0.75rem;
        /* Removed fixed min-height */
    }

    .product-name {
        font-size: 1rem;
        line-height: 1.2;
        margin-bottom: 0.2rem; /* Slightly reduced margin below name for tighter spacing */
    }

    .price-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.4rem;
        margin-top: 0.3rem;
        margin-bottom: 0.5rem; /* Slightly reduced margin below price info for tighter card */
        font-size: 0.85rem;
        line-height: 1.3;
    }

    section.py-16 {
        padding-top: 2rem;
        padding-bottom: 4rem; /* Adjusted for mobile to prevent footer overlap */
    }

    /* Target the product listing heading specifically if needed for smaller screens */
    .product-listing-heading {
        font-size: 2rem;
    }

    footer .container {
        padding: 0 1rem;
    }

    .footer-link, .footer-social-icon {
        font-size: 0.9rem;
    }
}
