/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat Alternates', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.logo span {
    color: #3498db;
    font-style: italic;
}

.search-bar {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.3s ease;
}

.search-bar input:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: #2980b9;
}

.navbar-links {
    display: flex;
    gap: 2rem;
}

.navbar-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.navbar-links a:hover {
    color: #3498db;
}

.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.navbar-links a:hover::after {
    width: 100%;
}

.cart-icon {
    position: relative;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-icon:hover {
    color: #3498db;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('fotos/Supermercado.jpg');
    background-size: cover;
    background-position: center;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Categories Section */
.categories {
    padding: 4rem 0;
    background: white;
}

.categories h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #2c3e50;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.category-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 15px;
    padding: 2rem 1rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.category-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.category-btn i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.category-btn span {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Offers Section */
.offers {
    padding: 4rem 0;
    background: #f8f9fa;
}

.offers h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #e74c3c;
    font-weight: 700;
}

.carousel-inner img {
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
}

/* Location Section */
.location {
    padding: 4rem 0;
    background: white;
}

.location-text h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.location-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #7f8c8d;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.contact-info i {
    margin-right: 1rem;
    color: #3498db;
    width: 20px;
}

/* Products Main */
.products-main {
    padding: 2rem 0;
    min-height: 80vh;
}

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: #3498db;
    color: white;
}

/* Product Categories */
.product-category {
    margin-bottom: 4rem;
}

.category-header {
    text-align: center;
    margin-bottom: 2rem;
}

.category-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    position: relative;
    display: inline-block;
}

.category-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: #3498db;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.product-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    transform: translateY(-2px);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.close-cart:hover {
    color: #e74c3c;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    gap: 1rem;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

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

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.cart-item-price {
    color: #27ae60;
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    background: #3498db;
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.quantity-btn:hover {
    background: #2980b9;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.remove-item {
    background: #e74c3c;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background: #c0392b;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-total {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #2c3e50;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.empty-cart {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #bdc3c7;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.footer-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-links a {
    color: white;
    font-size: 2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #3498db;
}

.footer-content p {
    color: #bdc3c7;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-links {
        gap: 1rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .category-btn {
        padding: 1.5rem 0.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .category-filter {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}