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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

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

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.search-bar {
    max-width: 600px;
    margin: 0 auto 20px;
}

/* Navegación de categorías */
.categories-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.category-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: #222;
    color: #222;
    transform: translateY(-2px);
}

.category-btn.active {
    background: #222;
    color: white;
    border-color: #222;
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    outline: none;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: #222;
}

/* Botón flotante del carrito */
.cart-button-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 60px;
    padding: 15px 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: all 0.3s;
    z-index: 999;
    min-width: 150px;
    justify-content: center;
}

.cart-button-float:hover {
    background: #229954;
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

.cart-icon {
    font-size: 24px;
}

.cart-count-badge {
    background: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

.cart-total-preview {
    font-weight: 600;
    font-size: 16px;
    padding-left: 5px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.loading {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 18px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-info {
    padding: 20px;
}

.product-category {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.product-name {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price {
    font-size: 22px;
    font-weight: bold;
    color: #27ae60;
}

.original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.product-stock {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.stock-available {
    color: #27ae60;
}

.stock-low {
    color: #f39c12;
}

.stock-out {
    color: #e74c3c;
}

.product-variations {
    margin-bottom: 15px;
}

.variation-group {
    margin-bottom: 12px;
}

.variation-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.variation-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.variation-btn {
    padding: 6px 14px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.variation-btn:hover {
    border-color: #222;
    color: #222;
}

.variation-btn.selected {
    background: #222;
    color: white;
    border-color: #222;
}

.variation-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.add-to-cart {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.add-to-cart:hover {
    background: #111;
}

.add-to-cart:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.add-to-cart.added-to-cart {
    background: #27ae60 !important;
}

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

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

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

.cart-overlay.show {
    display: block;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    color: #2c3e50;
    font-size: 20px;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

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

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

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-item:last-child {
    border-bottom: none;
}

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

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

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.cart-item-variations {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

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

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #f5f5f5;
}

.qty-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 4px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 12px;
}

.cart-item-remove:hover {
    text-decoration: underline;
}

.cart-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.cart-footer {
    padding: 20px;
    border-top: 2px solid #e0e0e0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.btn-clear {
    width: 100%;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 10px;
    font-size: 14px;
}

.btn-clear:hover {
    background: #c0392b;
}

.btn-checkout {
    width: 100%;
    padding: 14px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.btn-checkout:hover {
    background: #229954;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .search-bar {
        max-width: 100%;
    }
    
    .cart-button-float {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        min-width: auto;
    }
    
    .cart-total-preview {
        display: none;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
}