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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background: var(--bg-color);
}

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

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.logo a {
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

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

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon, .btn-cart {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    position: relative;
    text-decoration: none;
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-add-cart {
    background: var(--success-color);
    color: white;
    width: 100%;
}

.btn-add-cart:hover {
    background: #229954;
}

.btn-disabled {
    background: #95a5a6;
    color: white;
    cursor: not-allowed;
    width: 100%;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

/* Sections */
.categories-section,
.featured-section,
.features-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

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

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-card.out-of-stock {
    opacity: 0.7;
}

.product-image {
    position: relative;
    display: block;
    overflow: hidden;
    padding-top: 100%;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* Stock Badges */
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.badge-out {
    background: var(--accent-color);
    color: white;
}

.badge-low {
    background: var(--warning-color);
    color: white;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.product-name a {
    color: var(--text-color);
    text-decoration: none;
}

.product-name a:hover {
    color: var(--secondary-color);
}

.product-category {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.feature-item {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.feature-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3, .footer-col h4 {
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col a {
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-col a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    text-align: center;
}

/* Page Header */
.page-header {
    background: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* Catalog Layout */
.catalog-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.catalog-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-list {
    list-style: none;
}

.filter-list a {
    display: block;
    padding: 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: background 0.3s;
}

.filter-list a:hover, 
.filter-list a.active {
    background: var(--bg-color);
    color: var(--primary-color);
    font-weight: 500;
}

.catalog-header {
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Product Detail */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.product-gallery {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.main-image {
    width: 100%;
    border-radius: 8px;
}

.no-image-large {
    width: 100%;
    padding-top: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    border-radius: 8px;
}

.product-details {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.product-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-tag {
    background: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stock-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.in-stock {
    background: #d4edda;
    color: #155724;
}

.low-stock {
    background: #fff3cd;
    color: #856404;
}

.out-stock {
    background: #f8d7da;
    color: #721c24;
}

.product-description {
    margin: 2rem 0;
}

/* Quantity Selector */
.add-to-cart-section {
    margin-top: 2rem;
}

.quantity-selector {
    margin-bottom: 1.5rem;
}

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

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#quantity {
    width: 80px;
    text-align: center;
    font-size: 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
}

.qty-max {
    color: #6c757d;
    font-size: 0.9rem;
}

.out-of-stock-notice {
    background: #f8d7da;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

/* Related Products */
.related-products {
    margin-top: 4rem;
}

.related-products h2 {
    margin-bottom: 2rem;
}

/* Search */
.search-form-main {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 2rem auto;
}

.search-form-main input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-results-info {
    margin: 2rem 0;
    color: #6c757d;
}

/* Utilities */
.text-center {
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.page-content {
    padding: 3rem 0;
}

.page-content h1 {
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 992px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .catalog-sidebar {
        position: static;
    }
    
    .product-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Cart Alerts */
.cart-alert {
    position: fixed;
    top: 80px;
    right: -300px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    max-width: 300px;
}

.cart-alert.show {
    right: 20px;
}

.cart-alert-success {
    border-left: 4px solid var(--success-color);
}

.cart-alert-error {
    border-left: 4px solid var(--accent-color);
}

.cart-alert-info {
    border-left: 4px solid var(--secondary-color);
}

/* Menu Toggle (Hamburguesa) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        order: 2;
    }
    
    .logo {
        order: 1;
    }
    
    .header-actions {
        order: 3;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .main-nav.active {
        max-height: 400px;
    }
    
    .main-nav ul {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }
    
    .main-nav li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-nav li:last-child {
        border-bottom: none;
    }
    
    .main-nav a {
        display: block;
        padding: 1rem;
    }
    
    .header-top {
        flex-wrap: wrap;
        position: relative;
    }
}

/* Cart Page */
.cart-page {
    padding: 3rem 0;
}

.cart-page h1 {
    margin-bottom: 2rem;
}

.loading-state,
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart p {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin-top: 2rem;
}

/* Cart Items */
.cart-items {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 120px 100px 50px;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.cart-item-image img {
    width: 100%;
    border-radius: 4px;
}

.no-image-small {
    width: 100%;
    padding-top: 100%;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.cart-item-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cart-item-info a {
    color: var(--text-color);
    text-decoration: none;
}

.cart-item-info a:hover {
    color: var(--secondary-color);
}

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

.stock-warning {
    color: var(--warning-color);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-quantity input {
    width: 50px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0;
}

.cart-item-subtotal {
    text-align: right;
    font-weight: bold;
    color: var(--primary-color);
}

.btn-remove {
    background: none;
    border: none;
    font-size: 2rem;
    color: #dc3545;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.btn-remove:hover {
    transform: scale(1.2);
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-line span:last-child {
    font-weight: 600;
}

.total-line {
    font-size: 1.3rem;
    border-bottom: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.total-line span {
    font-weight: bold;
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.cart-errors {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8d7da;
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
}

.error-message {
    color: #721c24;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.error-message:last-child {
    margin-bottom: 0;
}

/* Responsive Cart */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }
    
    .cart-item-image {
        grid-row: 1 / 3;
    }
    
    .cart-item-info {
        grid-column: 2;
    }
    
    .cart-item-quantity {
        grid-column: 2;
        justify-content: flex-start;
    }
    
    .cart-item-subtotal {
        grid-column: 2;
        text-align: left;
    }
    
    .cart-item-remove {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
}

/* Checkout Page */
.checkout-page {
    padding: 3rem 0;
}

.checkout-page h1 {
    margin-bottom: 2rem;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin-top: 2rem;
}

/* Checkout Form */
.checkout-form {
    background: white;
    border-radius: 8px;
    padding: 2rem;
}

.checkout-form h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkout-errors {
    background: #f8d7da;
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    margin: 1rem 0;
    display: none;
}

/* Checkout Summary */
.checkout-summary {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.checkout-summary h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.checkout-items-list {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.checkout-item:last-child {
    border-bottom: none;
    margin-bottom: 1rem;
}

.item-name {
    color: var(--text-color);
}

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

.summary-totals {
    margin-top: 1rem;
}

/* Responsive Checkout */
@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .checkout-summary {
        position: static;
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
