/* CSS Variables based on Pampa Direct Palette */
:root {
    --primary-color: #0033A0;
    /* Strong Blue (Royal Blue) */
    --secondary-color: #0033A0;
    /* Royal Blue */
    --accent-color: #005A2B;
    /* Kaitoke Green (likely used in Yerba Mate branding) */
    --text-color: #333333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #e1e1e1;
    --footer-bg: #222;
    --font-main: 'Roboto', sans-serif;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography Helpers */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    margin-bottom: 15px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #c00017;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Top Bar */
.top-bar {
    background-color: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 5px 0;
    /* Reduced padding */
    font-size: 0.9rem;
    font-weight: 500;
}

/* Header */
.main-header {
    background-color: var(--white);
    padding: 10px 0;
    /* Reduced padding */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 24px;
    /* Slightly smaller logo */
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-bar {
    flex: 1;
    margin: 0 40px;
    display: flex;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 8px 15px;
    /* Compact input */
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
}

.search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

/* Fix for Mobile Zoom on Input Focus */
@media (max-width: 768px) {

    .search-bar input,
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
        /* Prevents auto-zoom on iOS */
    }
}

.user-actions a {
    margin-left: 20px;
    font-weight: 500;
    color: var(--text-color);
}

.user-actions i {
    color: var(--primary-color);
    margin-right: 5px;
}

/* Navigation */
.main-nav {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.main-nav ul {
    display: flex;
    justify-content: center;
}

.main-nav a {
    display: block;
    padding: 10px 20px;
    /* Reduced padding */
    color: #555;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* Dropdown Menu Styles */
.nav-list {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown>a i {
    font-size: 0.8rem;
    margin-left: 5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    top: 100%;
    left: 0;
    border-top: 3px solid var(--primary-color);
    border-radius: 0 0 4px 4px;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
    text-transform: capitalize;
    /* Cleaner look */
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f9f9f9;
    color: var(--primary-color);
    padding-left: 20px;
    /* Slight movement effect */
}

.dropdown:hover>.dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nested Dropdown Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu>.dropdown-content {
    top: 0;
    left: 100%;
    margin-top: -5px;
    margin-left: 0;
    border-radius: 4px;
    display: none;
    min-width: 180px;
}

/* Show on hover */
.dropdown-submenu:hover>.dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Ensure main dropdown also works on hover if not already */
.dropdown:hover>.dropdown-content {
    display: block;
}

.dropdown-submenu>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 20px;
}

.dropdown-submenu>a:after {
    content: '\f054';
    /* FontAwesome Chevron Right */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.8em;
    position: absolute;
    right: 10px;
}

.dropdown-submenu>a i {
    display: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1545622966-26b69e5d4400?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    /* Placeholder image of South America or products */
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
    padding: 100px 20px;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero .btn-primary {
    padding: 12px 30px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* Slider Section */
.slider-container {
    position: relative;
    height: 500px;
    width: 100%;
    overflow: hidden;
    background-color: #333;
}

.slider {
    position: relative;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    /* Flex to center content */
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-content h2 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 1s ease both;
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 1s ease both 0.3s;
    /* Delay */
}

.slide-content .btn-primary {
    animation: fadeInUp 1s ease both 0.6s;
    padding: 12px 30px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

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

.indicator {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: 0.3s;
}

.indicator.active {
    background-color: var(--white);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .slider-container {
        height: 350px;
    }

    .slide-content h2 {
        font-size: 2rem;
    }
}

/* Product Section */
main {
    padding: 20px;
    /* Reduced top padding */
}

/* Contact Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

/* Old modal-content removed - replaced by Premium Styles below */

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: var(--primary-color);
}

.contact-options {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

.contact-btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.contact-btn-whatsapp:hover {
    background-color: #128C7E;
}

.contact-btn-email {
    background-color: var(--primary-color);
    color: white;
}

.contact-btn-email:hover {
    background-color: #002060;
}

/* Stock Badge */
.badge-no-stock {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checkout & Contact Form Premium Styles */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h3 {
    font-size: 1.8rem;
    color: var(--text-color);
}

.section-header hr {
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border: none;
    margin: 10px auto 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

/* Premium Modal Styles */
.modal-content {
    background: #ffffff;
    border-radius: 12px;
    /* Smoother corners */
    padding: 25px;
    /* Reduced from 40px */
    width: 100%;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-family: 'Roboto', sans-serif;
    position: relative;
    overflow: hidden;
}

/* Header Accent */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    /* Thinner accent */
    background: linear-gradient(90deg, var(--primary-color), #0056b3);
}

.modal-content h3 {
    font-size: 1.5rem;
    /* Smaller title */
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.modal-content p {
    display: none;
    /* Hide subtitle to save space */
}

.form-group {
    margin-bottom: 12px;
    /* Reduced from 20px */
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    /* Smaller label */
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    /* Reduced from 8px */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    /* Reduced padding */
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #333;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.1);
    outline: none;
}

.form-group textarea {
    resize: none;
    height: 60px;
    /* Reduced height */
}

/* Row for side-by-side inputs (Calle / Altura) */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Call to Action Button */
.checkout-actions .btn-block {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 51, 160, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
}

.checkout-actions .btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 51, 160, 0.4);
    background-color: #002a80;
}

.close-modal {
    background: #f0f0f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 20px;
    right: 20px;
    font-size: 1.2rem;
    color: #555;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* Helper text below button */
.checkout-actions p {
    margin-top: 15px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #888;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .modal-content {
        padding: 25px;
        width: 95%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Product Card Styling */
.product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    /* Stronger shadow */
    border-color: var(--primary-color);
    cursor: pointer;
}

/* Make Add to Cart button Blue on Card Hover */
.product-card:hover .add-to-cart {
    background-color: var(--primary-color);
    transform: scale(1.05);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    /* Pampa direct style often shows full packaging */
    padding: 20px;
    background-color: var(--white);
    border-bottom: 1px solid #f0f0f0;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-color);
    line-height: 1.4;
}

.product-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-top: auto;
    margin-bottom: 10px;
}

.add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.add-to-cart:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100%;
    background: var(--white);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: 0.4s;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-bg);
}

.cart-items {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.cart-item img {
    width: 80px;
    /* Increased size */
    height: 80px;
    /* Increased size */
    object-fit: contain;
    /* Show full image, don't crop */
    margin-right: 15px;
    border: 1px solid #eee;
    /* Light border to define the area */
    border-radius: 4px;
    padding: 2px;
    /* Small padding inside border */
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
}

.remove-item {
    color: #999;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-item:hover {
    color: var(--primary-color);
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--light-bg);
}

.total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: none;
}

.overlay.active {
    display: block;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: #ccc;
    padding-top: 60px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding-bottom: 40px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
    margin-bottom: 20px;
    padding-right: 20px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.bottom-bar {
    background-color: #111;
    text-align: center;
    padding: 20px 0;
    font-size: 0.8rem;
}

/* Loading */
.loading-spinner {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px;
    font-size: 1.2rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }

    .search-bar {
        margin: 20px 0;
        width: 100%;
    }

    .main-nav ul {
        flex-wrap: wrap;
    }

    .hero h2 {
        font-size: 2rem;
    }
}