/* General Resets & Variables */
:root {
    --primary-wood-dark: #6d4c41;
    --primary-wood-medium: #a1887f;
    --primary-wood-light: #f8f5f0;
    --text-dark: #333;
    --text-light: #fff;
    --whatsapp-green: #25D366;
    --whatsapp-green-hover: #1DA851;
    --amazon-orange: #FF9900;
    --amazon-orange-hover: #E68A00;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.2);
    --poppins: 'Poppins', sans-serif;
    --lato: 'Lato', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--lato);
    color: var(--text-dark);
    background-color: var(--primary-wood-light);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

h1, h2, h3 {
    font-family: var(--poppins);
    color: var(--primary-wood-dark);
    margin-bottom: 0.5em;
}

/* Header */
.main-header {
    background-color: var(--primary-wood-dark);
    color: var(--text-light);
    text-align: center;
    padding: 1.5rem 1rem;
    box-shadow: 0 2px 8px var(--shadow-medium);
}

.main-header .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.site-logo {
    max-width: 80px; /* Smaller logo for mobile */
    height: auto;
    transition: transform 0.3s ease-in-out;
}

.site-logo:hover {
    transform: scale(1.05);
}

.main-header h1 {
    color: var(--text-light);
    font-size: 2em; /* Adjusted for mobile */
    margin: 0;
}

.main-header .tagline, .main-header .slogan {
    font-size: 0.95em;
    opacity: 0.9;
    margin-top: 5px;
}

/* Hero Banner */
.hero-banner {
    position: relative;
    width: 100%;
    max-height: 60vh; /* Adjust as needed */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-align: center;
    padding: 1rem;
}

.banner-overlay h2 {
    color: var(--text-light);
    font-size: 1.8em;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.cta-button {
    background-color: var(--primary-wood-medium);
    color: var(--text-light);
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    text-decoration: none;
    display: inline-block;
}

.cta-button:hover {
    background-color: var(--primary-wood-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 15px var(--shadow-medium);
}

/* Product Showcase (only grid now) */
.product-showcase {
    padding: 2.5rem 1rem;
    text-align: center;
}

.product-showcase h2 {
    font-size: 2em;
    margin-bottom: 2rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 25px;
    padding: 1rem;
    margin-top: 2rem;
}

/* Product Card Styling */
.product-card {
    background-color: var(--text-light);
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--shadow-light);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes footer buttons to bottom */
    position: relative; /* Needed for absolute positioning of slider controls */
    animation: fadeInScale 0.6s ease-out forwards; /* Initial animation */
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px var(--shadow-medium);
}

/* Product Image Slider Styles */
.product-image-slider {
    position: relative;
    width: 100%;
    height: 320px; /* Consistent height for the slider area */
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out; /* Smooth slide transition */
}

.slider-track img {
    min-width: 100%; /* Each image takes full width of the slider */
    height: 100%;
    object-fit: cover;
    display: block; /* Remove extra space below images */
    border-top-left-radius: 12px; /* Ensure images maintain card border radius */
    border-top-right-radius: 12px;
}

/* Slider Navigation Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.5em;
    line-height: 1;
    border-radius: 5px;
    z-index: 10;
    /* Change: Make completely invisible but keep clickable */
    opacity: 0; 
    pointer-events: auto; 
}

.product-card:hover .slider-btn {
    opacity: 0; /* Ensure they stay invisible on hover */
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* Share Button Styling */
.share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    /* Change: Remove background, make square */
    background-color: transparent;
    color: white;
    border: none;
    border-radius: 0; /* Square */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    opacity: 0; /* Hidden by default on desktop */
    pointer-events: none;
}

.share-btn:hover {
    transform: scale(1.1);
}

/* Add shadow to icon so it pops on light images since background is gone */
.share-btn svg {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.6));
}

.product-card:hover .share-btn {
    opacity: 1;
    pointer-events: auto;
}

.slider-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.indicator-dot.active {
    background-color: var(--primary-wood-medium); /* Active dot color */
    transform: scale(1.2);
}

.product-card h3 {
    margin: 1rem 1rem 0.5rem;
    font-size: 1.3em;
    min-height: 2.6em; /* Ensure consistent height for titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card p {
    padding: 0 1rem;
    font-size: 0.9em;
    color: #666;
    flex-grow: 1; /* Allow description to take available space */
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit description to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .button-group {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap */
    justify-content: center;
    gap: 10px;
    margin: 0 1rem 1.2rem; /* Adjusted margin for spacing */
}

.product-card button {
    border: none;
    padding: 12px 10px; /* Slightly reduced padding */
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em; /* Slightly reduced font size */
    font-weight: 600;
    transition: all 0.3s ease-in-out;
    flex-grow: 1;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 120px; /* Ensure a minimum width for buttons */
    max-width: 100%; /* Allow buttons to take full width if they wrap */
}

.product-card .amazon-button {
    background-color: var(--amazon-orange);
    color: var(--text-light);
}

.product-card .amazon-button:hover {
    background-color: var(--amazon-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255,153,0,0.4);
}

.product-card .whatsapp-button {
    background-color: var(--whatsapp-green);
    color: var(--text-light);
}

.product-card .whatsapp-button:hover {
    background-color: var(--whatsapp-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37,211,102,0.4);
}

/* Footer */
.main-footer {
    background-color: var(--primary-wood-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 0.9em;
}

.main-footer p {
    margin-bottom: 10px;
}

.social-links a {
    display: inline-block;
    margin: 0 8px;
}

.social-links img {
    height: 30px;
    width: auto;
    transition: transform 0.3s ease;
}

.social-links img:hover {
    transform: translateY(-3px) scale(1.1);
}

/* Modal/Popup Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 100; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Blurred background */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none; /* Allows clicks through when hidden */
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    position: relative;
    max-width: 90%;
    width: 400px;
    text-align: center;
    transform: translateY(-50px); /* Initial position for animation */
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-content h2 {
    color: var(--primary-wood-dark);
    margin-bottom: 15px;
    font-size: 1.8em;
}

.modal-content p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

#popup-product-sku, #popup-product-price {
    font-weight: bold;
    color: var(--primary-wood-dark);
}

.modal-content .whatsapp-button.large {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 50px;
    background-color: var(--whatsapp-green);
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.modal-content .whatsapp-button.large:hover {
    background-color: var(--whatsapp-green-hover);
    transform: translateY(-2px);
}

.whatsapp-note {
    font-size: 0.85em;
    color: #777;
    margin-top: 15px;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--primary-wood-dark);
    text-decoration: none;
}


/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    /* Mobile specific overrides */
    .share-btn {
        opacity: 1; /* Always visible controls on mobile */
        pointer-events: auto;
    }
}

@media (min-width: 768px) {
    .site-logo {
        max-width: 100px; /* Larger logo on tablets/desktops */
    }

    .main-header h1 {
        font-size: 3em;
    }

    .main-header .tagline, .main-header .slogan {
        font-size: 1.1em;
    }

    .banner-overlay h2 {
        font-size: 2.5em;
    }

    .cta-button {
        padding: 15px 35px;
        font-size: 1.1em;
    }

    .product-showcase h2 {
        font-size: 2.5em;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on larger screens */
        padding: 2rem;
    }

    .product-image-slider {
        height: 250px; /* Adjust slider height for larger screens */
    }
    
    .product-card button {
        padding: 15px 15px; /* Restore larger padding for larger screens */
        font-size: 0.95em; /* Restore larger font size for larger screens */
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on larger desktops */
        max-width: 1200px; /* Max width for content */
        margin-left: auto;
        margin-right: auto;
    }
}