/* =========================================
   1. GLOBAL RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Makes sizing elements much easier */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9; /* Light gray background for the page */
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
}
/* =========================================
   2. NAVBAR CONTAINER
   ========================================= */
.navbar {
    display: flex;             /* Turns the navbar into a flex container */
    align-items: center;       /* Vertically centers all items */
    padding: 1rem 2rem;        /* Adds space inside the navbar */
    background-color: #1e1e2f; /* Dark navy background */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Adds a subtle drop shadow */
    position: sticky; 
    top: 0;
    z-index: 100;
}

/* =========================================
   3. LOGO
   ========================================= */
.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;     /* Removes the default underline from links */
    
    /* MAGIC TRICK: This pushes all following items to the far right! */
    margin-right: auto; 
}
.nav-logo img {
    height: 40px; /* Adjust this to your preferred size */
    width: auto;
    vertical-align: middle;
}

/* If you have text + image */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================================
   4. NAVIGATION LINKS (The Menu)
   ========================================= */
.nav-menu {
    display: flex;             /* Makes the list items sit side-by-side */
    list-style: none;          /* Removes the bullet points */
    gap: 2rem;                 /* Adds space between each link */
}

.nav-link {
    color: #d1d1da;            /* Light grayish text */
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease; /* Smooth color change on hover */
}

.nav-link:hover {
    color: #ffffff;            /* Turns white when you hover over it */
}

/* =========================================
   6. HAMBURGER MENU (Hidden on Desktop)
   ========================================= */
.hamburger {
    display: none; /* We hide this completely on desktop screens */
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* =========================================
   8. HERO SECTION
   ========================================= */
.hero {
    background-color: #dddde4; /* Matches the navbar for a seamless look */
    min-height: 80vh; /* Takes up 80% of the screen height */
    display: flex;
    align-items: center; /* Vertically centers the content */
    padding: 4rem 2rem;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4rem; /* Space between the text and the image */
}

/* --- Left Side: Text --- */
.hero-content {
    flex: 1; /* Takes up 50% of the width */
}

.hero-title {
    font-size: 3.5rem;
    color: #786666;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: #585867; /* Matches the navbar text color */
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 500px; /* Keeps the paragraph from getting too wide */
}

/* --- Buttons --- */
.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4da6ff; /* Your bright accent blue */
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #3390ff;
    transform: translateY(-2px); /* Moves up slightly */
    box-shadow: 0 5px 15px rgba(77, 166, 255, 0.4); /* Glowing shadow */
}

.btn-secondary {
    background-color: transparent;
    color: #7b7b91;
    border: 2px solid #4da6ff;
}

.btn-secondary:hover {
    background-color: #4da6ff;
    color: #ffffff;
    transform: translateY(-2px);
}

/* --- Right Side: Image --- */
.hero-image {
    flex: 1; /* Takes up the other 50% of the width */
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); /* Deep shadow for a 3D pop */
}

/* =========================================
   10. PRODUCTS SECTION (Homepage 4-Col)
   ========================================= */
.products-section {
    background-color: #f4f4f9; /* Light background */
    padding: 4rem 2rem;
}

/* Top Header (Title and View More link) */
.section-header {
    display: flex;
    justify-content: space-between; /* Pushes title left and link right */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 2.5rem auto;
}

.section-title {
    font-size: 2rem;
    color: #1e1e2f;
    margin: 0;
}

.view-more-link {
    color: #4da6ff; /* Bright blue */
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.view-more-link:hover {
    color: #3390ff;
    text-decoration: underline;
}

/* The Grid for the 4 Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Exactly 4 columns */
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Individual Card Styling */
.product-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px); /* Lifts up on hover */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover; /* Keeps image from stretching */
}

.card-content {
    padding: 1.5rem;
    text-align: center; /* Kept centered for the homepage 4-col cards */
}

.card-content h3 {
    font-size: 1.2rem;
    color: #1e1e2f;
    margin-bottom: 0.5rem;
}

.card-price {
    color: #4da6ff;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
}

/* =========================================
   11. FOOTER SECTION
   ========================================= */
.site-footer {
    background-color: #111118; /* Very dark color to ground the page */
    color: #a0a0b8;
    padding: 4rem 2rem 0 2rem; /* Bottom padding is 0 because of the bottom bar */
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive columns */
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.footer-col:first-child {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers items horizontally */
    text-align: center;  /* Centers text */
}

/* Ensure the logo link takes up full width to center the image */
.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

/* Ensure the image itself is centered and properly sized */
.footer-logo img {
    max-width: 250px; /* Controls the maximum width */
    height: auto;     /* Maintains aspect ratio */
    display: block;
    margin: 0 auto;
}

.footer-desc {
    line-height: 1.6;
    max-width: 300px;
    text-align: center; /* Center the description text too */
    margin: 0 auto;     /* Center the description block */
}

/* Links Column */
.footer-heading {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #a0a0b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #4da6ff; /* Bright blue hover effect */
}

/* Contact Column */
.footer-contact {
    font-style: normal; /* Removes the default italic style of the <address> tag */
    line-height: 1.8;
}

.footer-contact strong {
    color: #ffffff;
    font-weight: 600;
}

/* Bottom Copyright Bar */
.footer-bottom {
    background-color: #0a0a0f; /* Slightly darker than the main footer */
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid #2d2d44;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

/* =========================================
   13. ALL PRODUCTS PAGE (5-Column Grid)
   ========================================= */
.page-header {
    background-color: #1e1e2f;
    color: #ffffff;
    padding: 4rem 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #a0a0b8;
    font-size: 1.2rem;
}

.all-products-section {
    background-color: #f4f4f9;
    padding: 4rem 2rem;
}

.all-products-grid {
    display: grid;
    /* MAGIC: Forces exactly 5 cards in a row on large screens */
    grid-template-columns: repeat(5, 1fr); 
    gap: 1.5rem;
    max-width: 1400px; /* Wider container to fit 5 columns nicely */
    margin: 0 auto;
}

/* Re-using the card styles from the homepage */
.all-products-grid .product-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.all-products-grid .product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.all-products-grid .product-card img {
    width: 100%;
    height: 180px; /* Slightly smaller image for the 5-col grid */
    object-fit: cover;
}

/* UPDATED: Left-aligned content for the All Products page */
.all-products-grid .card-content {
    padding: 1rem;
    text-align: left; /* CHANGED: Aligns title, description, quantity, and price to the left */
}

.all-products-grid .card-content h3 {
    font-size: 1rem;
    color: #1e1e2f;
    margin-bottom: 0.5rem;
}

/* NEW: Description styling for left alignment */
.all-products-grid .card-desc {
    font-size: 0.85rem;
    color: #666666;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    /* Keeps the description to a maximum of 2 lines with "..." if it's too long */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* NEW: Quantity styling for left alignment */
.all-products-grid .card-quantity {
    font-size: 0.85rem;
    color: #888888;
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.all-products-grid .card-price {
    color: #4da6ff;
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

/* =========================================
   14. PRODUCT SEARCH SECTION
   ========================================= */
.search-section {
    background-color: #ffffff;
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e1e4e8;
}

.search-container h2 {
    font-size: 2rem;
    color: #1e1e2f;
    margin-bottom: 1.5rem;
}

.search-bar-wrapper {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background-color: #f4f4f9;
    border-radius: 30px;
    padding: 0.4rem;
    border: 1px solid #e1e4e8;
    transition: all 0.3s ease;
}

/* Glowing border when user clicks inside the search bar */
.search-bar-wrapper:focus-within {
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.2);
    border-color: #4da6ff;
}

#product-search {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    outline: none;
    color: #1e1e2f;
}

#search-btn {
    background-color: #4da6ff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: background-color 0.3s ease;
}

#search-btn:hover {
    background-color: #3390ff;
}

.results-count {
    margin-top: 1rem;
    color: #666666;
    font-size: 0.9rem;
}
/* Ensure all product images have pure white background */
.all-products-grid .product-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.all-products-grid .product-card > div:first-child {
    background-color: #ffffff !important;
    height: 180px !important;
    flex-shrink: 0; /* Prevents the image container from shrinking */
}

.all-products-grid .product-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    background-color: #ffffff !important;
}
/* =========================================
   15. IMAGE MODAL / LIGHTBOX
   ========================================= */
/* The dark background overlay */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Dark dimmed background */
    backdrop-filter: blur(8px); /* Blurs the cards in the background */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* When active, show it */
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* The white box holding the image */
.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1); /* Zoom in effect */
}

/* The Zoomed Image */
#modal-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    background-color: #ffffff;
}

/* Close Button (The X) */
.close-modal {
    position: absolute;
    top: -15px;
    right: -15px;
    background-color: #ffffff;
    color: #1e1e2f;
    font-size: 30px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.close-modal:hover {
    background-color: #f4f4f9;
    transform: scale(1.1);
}

/* Make the cards look clickable */
.all-products-grid .product-card {
    cursor: pointer; 
}

/* =========================================
   7. RESPONSIVE DESIGN - MEDIA QUERIES
   ========================================= */
@media (max-width: 1200px) {
    .all-products-grid { grid-template-columns: repeat(4, 1fr); } /* 4 cols */
}

/* TABLET (screens smaller than 992px) */
@media (max-width: 992px) {
    .navbar {
        padding: 1rem 1.5rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .search-input {
        width: 120px;
    }

    /* Hero Tablet Styles */
    .hero-title { 
        font-size: 2.8rem; 
    }
    .hero-container { 
        gap: 2rem; 
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cards per row on tablets */
    }
    .all-products-grid { grid-template-columns: repeat(3, 1fr); } /* 3 cols */
}

/* MOBILE (screens smaller than 767px) */
@media (max-width: 767px) {
    /* Show the hamburger menu */
    .hamburger {
        display: block;
        z-index: 100;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #1e1e2f;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
        z-index: 99;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 1.5rem 0;
    }
    
    .nav-link {
        color: #e0e0ff;
        font-size: 1.2rem;
        display: block;
        padding: 0.5rem;
    }
    
    .nav-link:hover {
        color: #4da6ff;
    }
    
    .nav-search {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: row;
        background-color: #1e1e2f;
        width: 100%;
        justify-content: center;
        padding: 1rem;
        margin-left: 0;
        border-radius: 0;
        border-top: 1px solid #2d2d44;
        transition: 0.3s;
        z-index: 98;
    }
    
    .nav-search.active {
        left: 0;
    }
    
    .search-input {
        width: 70%;
        font-size: 1rem;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }

    /* Hero Mobile Styles */
    .hero {
        padding: 3rem 1.5rem;
        min-height: auto;
    }
    
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-subtitle {
        margin: 0 auto 2.5rem auto;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .site-footer {
        padding: 3rem 1.5rem 0 1.5rem;
    }
    .footer-container {
        gap: 2rem;
    }
    .all-products-grid { grid-template-columns: repeat(2, 1fr); } /* 2 cols */
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr; /* 1 card per row on mobile */
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* SMALL MOBILE (screens smaller than 480px) */
@media (max-width: 480px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-logo {
        font-size: 1rem;
    }
    
    .hamburger {
        width: 30px;
    }
    
    .bar {
        width: 25px;
        height: 2px;
    }
    
    .nav-item {
        margin: 1rem 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
    }
    
    .search-input {
        width: 65%;
        font-size: 0.9rem;
    }
    
    .search-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .hero-title { 
        font-size: 2.2rem; 
    }
    
    .btn { 
        padding: 0.7rem 1.5rem; 
        font-size: 0.9rem; 
    }
    .all-products-grid { grid-template-columns: 1fr; } /* 1 col */
}

@media (max-width: 350px) {
    .search-section {
        padding: 2rem 1rem; /* Reduces side padding to give more room */
    }
    
    .search-container h2 {
        font-size: 1.4rem; /* Makes the heading smaller */
        margin-bottom: 1rem;
    }

    .search-bar-wrapper {
        padding: 0.3rem; /* Reduces the space around the input and button */
        border-radius: 25px; /* Slightly less rounded for a tighter look */
    }

    #product-search {
        padding: 0.6rem 0.8rem; /* Reduces text input padding */
        font-size: 0.9rem; /* Slightly smaller text */
    }

    #search-btn {
        width: 42px; /* Shrinks button slightly to give text more room */
        height: 42px;
    }
    
    #search-btn svg {
        width: 18px; /* Scales down the magnifying glass icon */
        height: 18px;
    }
}

@media (max-width: 992px) and (min-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(3, 1fr); /* Force 3 equal columns */
        gap: 1.5rem; /* Reduced gap to fit everything */
    }
    
    /* Make logo smaller on tablet */
    .footer-logo img {
        max-width: 150px;
    }
    
    /* Center the logo column */
    .footer-col:first-child {
        align-items: center;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    /* Reduce font sizes on tablet */
    .footer-heading {
        font-size: 1.1rem;
    }
    
    .footer-links li,
    .footer-contact p {
        font-size: 0.9rem;
    }
}

/* Mobile - Stack everything */
@media (max-width: 767px) {
    .footer-container {
        grid-template-columns: 1fr; /* Single column */
        gap: 2rem;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-col:first-child {
        align-items: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-logo img {
        max-width: 180px;
    }
    
    .footer-desc {
        text-align: center;
    }
}