:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #2c3e50;
    --background-color: #f9f9f9;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

header {
    background-color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo img {
    height: 50px;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-icon img {
    width: 30px;
}

.cart-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.cart-icon:hover i {
    color: var(--accent-color);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.product-card h3 {
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.9rem;
    color: #666;
    margin: 1rem 0;
    line-height: 1.4;
    min-height: 60px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.quantity-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.2s;
}

.quantity-btn:hover {
    transform: scale(1.1);
}

.quantity-input {
    width: 50px;
    text-align: center;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0.3rem;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    opacity: 0;
}

.price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.add-to-cart {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    right: -300px;
    bottom: 0;
    width: 300px;
    background: white;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
}

.cart-modal.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
}

.close-cart:hover {
    color: var(--accent-color);
}

.close-cart {
    font-size: 1.5rem;
}

.cart-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-total {
    padding: 1rem;
    border-top: 1px solid #eee;
    font-weight: bold;
}

.cart-items {
    margin: 1rem 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    margin-right: 1rem;
}

.delete-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 0.3rem;
    transition: transform 0.2s;
}

.delete-item:hover {
    transform: scale(1.2);
    color: #c0392b;
}

.checkout-button {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.flavor-select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
}

.address-form {
    padding: 1rem;
    border-top: 1px solid #eee;
}

.address-form h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

#addressInput {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
}

.promo-banner {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: white;
    text-align: center;
    padding: 0.8rem;
    font-weight: 600;
}

.featured-products {
    text-align: center;
    padding: 2rem 0;
}

.featured-badge {
    background-color: var(--warning-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin: 1rem 0;
}

.coming-soon {
    border: 2px dashed #e74c3c;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.coming-soon:hover {
    filter: grayscale(0.5);
}

.coming-soon-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.coming-soon-text {
    color: #e74c3c;
    font-weight: 600;
    margin-top: 1rem;
    font-size: 0.9rem;
    background: linear-gradient(45deg, #e74c3c20, #f39c1220);
    padding: 0.5rem;
    border-radius: 5px;
}

/* Media Queries */
@media screen and (max-width: 768px) {
    header {
        padding: 0.8rem 1rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .cart-modal {
        width: 100%;
        right: -100%;
    }

    .cart-modal.active {
        right: 0;
    }

    .products {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
        padding: 0.8rem;
    }

    .product-card {
        padding: 0.8rem;
    }

    .product-card img {
        max-width: 180px;
    }

    .add-to-cart {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }

    .cart-icon i {
        font-size: 1.2rem;
    }

    .products {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .product-card h3 {
        font-size: 1.1rem;
    }

    .price {
        font-size: 0.9rem;
    }

    .cart-header h2 {
        font-size: 1.2rem;
    }

    .cart-item {
        font-size: 0.9rem;
    }

    .checkout-button {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Orientación landscape en móviles */
@media screen and (max-height: 480px) and (orientation: landscape) {
    .cart-modal {
        max-height: 100vh;
        overflow-y: auto;
    }

    .cart-content {
        padding-bottom: 1rem;
    }

    .products {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Animaciones y efectos */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.featured-badge {
    animation: pulse 2s infinite;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Estilos para el panel de administración */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.admin-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
}

.admin-content input {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.admin-content button {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: none;
    border-radius: 5px;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.admin-content button:hover {
    background: var(--primary-color);
}

.close-admin {
    background: #e74c3c !important;
}

.admin-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    width: 300px;
}

.admin-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 10px;
}

.admin-controls select,
.admin-controls input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.price-controls,
.product-controls,
.flavor-controls,
.stock-controls {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.flavor-controls h3,
.stock-controls h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 0.9rem;
}

#flavorsList {
    width: 100%;
    margin: 0.5rem 0;
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.flavor-stock-table {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.flavor-stock-table h4 {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.flavor-stock-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.3rem;
    background: #fff;
    border-radius: 4px;
}

.flavor-stock-row:hover {
    background: #f8f9fa;
}

.flavor-stock-row label {
    flex: 1;
    font-size: 0.85rem;
    cursor: pointer;
}

.flavor-select option.out-of-stock {
    color: #dc3545;
    font-style: italic;
}

.flavor-select option.out-of-stock::after {
    content: " (Agotado)";
}

.flavor-buttons {
    display: flex;
    gap: 0.5rem;
}

.admin-controls button {
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    flex: 1;
}

.delete-btn {
    background: #dc3545 !important;
}

.delete-btn:hover {
    background: #c82333 !important;
}

.out-of-stock {
    opacity: 0.7;
    position: relative;
}

.out-of-stock::after {
    content: 'AGOTADO';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 0.5rem 2rem;
    font-weight: bold;
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 1;
}

.out-of-stock button.add-to-cart {
    background: #6c757d;
    cursor: not-allowed;
}

.admin-controls button:hover {
    background: var(--primary-color);
}

.logout-btn {
    background: #e74c3c !important;
    margin-top: 1rem;
}

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    margin-top: 3rem;
}
