/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #ffffff; 
}

/* --- Navigation Bar --- */
#navbar {
    background-color: #fbfffb;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 5%; 
    z-index: 1000;
    transition: padding 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}

#navbar.scrolled {
    padding: 5px 5%; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 180px; 
    transition: height 0.4s ease;
}

#navbar.scrolled .logo-img {
    height: 70px; 
}

.nav-links {
    font-size: 16px;
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-links li a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s;
}

.nav-links li a:hover {
    color: #1a7a2a; 
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(to right, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.4) 100%), url('photo_mat/Background.jpg');
    background-size: cover;
    background-position: center;
    height: 100vh; 
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.hero-content {
    max-width: 700px;
    margin-top: 50px; 
}

.hero-content h1 {
    font-size: 4rem; 
    line-height: 1.1;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -1px;
}

.text-white {
    color: #ffffff;
}

.text-green {
    color: #7efc90;
}

.hero-content p {
    color: #ffffff;
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 550px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #15c065; 
    color: #ffffff;
    text-decoration: none;
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px; 
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: #a0ffbe;
    transform: translateY(-2px);
}

/* --- Featured Products Section --- */
.featured-products {
    padding: 80px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 500;
    color: #333;
    margin-bottom: 50px;
}

.section-header h2::before,
.section-header h2::after {
    content: "";
    height: 1px;
    background-color: #000;
    flex: 0 0 100px; 
    margin: 0 20px;
}

/* Carousel Layout */
.carousel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.carousel-track-container {
    overflow: hidden; 
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 20px;
    list-style: none;
    transition: transform 0.5s ease-in-out;
}

.product-card {
    flex: 0 0 calc(25% - 15px); /* Desktop: 4 products at a time */
    min-width: 250px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* Carousel Buttons */
.carousel-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #555;
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s;
}

.carousel-btn:hover {
    color: #000;
}

/* --- Product Image & Hover Animation --- */
.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5; 
    overflow: hidden;
    margin-bottom: 15px;
    background-color: #f8f8f8;
}

.primary-img, .secondary-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.5s ease;
}

.secondary-img {
    opacity: 0; 
}

/* On Hover: Fade out primary, fade in secondary */
.image-wrapper:hover .primary-img {
    opacity: 0;
}
.image-wrapper:hover .secondary-img {
    opacity: 1;
}

/* Badges */
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    font-size: 14px;
    color: white;
    z-index: 2;
}

.badge.discount {
    background-color: #e63946; 
}

.badge.sold-out {
    background-color: #000000; 
    top: 45px; 
}

/* Hover Action Buttons */
.action-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 2;
}

.image-wrapper:hover .action-buttons {
    opacity: 1;
    transform: translateX(-50%) translateY(0); 
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

.action-btn:hover {
    background-color: #333;
    color: white;
}

/* Product Info */
.product-info h3 {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-family: serif; 
}

.price {
    font-size: 14px;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 5px;
}

.new-price {
    color: #e63946; 
    font-weight: 600;
}

html {
  scroll-behavior: smooth;
}

/* =========================================
   RESPONSIVE MEDIA QUERIES
========================================= */

/* Tablets (Max width: 1024px) */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3.2rem;
    }
    .product-card {
        flex: 0 0 calc(33.333% - 14px); /* 3 items per row on tablets */
        min-width: 220px;
    }
    .nav-links {
        gap: 25px;
    }
    .logo-img {
        height: 120px; 
    }
}

/* Mobile Phones (Max width: 768px) */
@media (max-width: 768px) {
    #navbar {
        padding: 10px 5%;
    }
    .logo-img {
        height: 100px;
    }
    #navbar.scrolled .logo-img {
        height: 60px;
    }
    .nav-links {
        gap: 15px;
    }
    .nav-links li a {
        font-size: 14px;
    }
    
    .hero-content {
        margin-top: 80px; 
        text-align: center; /* Center align text for better mobile viewing */
    }
    .hero {
        justify-content: center; 
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1rem;
        margin: 0 auto 30px auto;
    }

    .product-card {
        flex: 0 0 calc(50% - 10px); /* 2 items per row on mobile */
        min-width: 160px;
    }

    .section-header h2 {
        font-size: 22px;
    }
    .section-header h2::before,
    .section-header h2::after {
        flex: 0 0 50px; /* Shorter lines on mobile */
    }

    /* Keep action buttons semi-visible on touch devices since there is no hover */
    .action-buttons {
        transform: translateX(-50%) translateY(0);
        opacity: 0.9;
        bottom: 10px;
    }
}

/* Small Mobile Phones (Max width: 480px) */
@media (max-width: 480px) {
    #navbar {
        flex-direction: column; /* Stack logo and links vertically */
        padding: 10px 0;
    }
    #navbar.scrolled {
        padding: 5px 0;
    }
    .logo-img {
        height: 80px;
    }
    #navbar.scrolled .logo-img {
        height: 50px;
    }
    .nav-links {
        margin-top: 10px;
        gap: 20px;
        padding-bottom: 5px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }

    .product-card {
        flex: 0 0 100%; /* 1 item per row on very small screens */
    }
    .carousel-btn {
        padding: 5px;
        font-size: 20px;
    }
}