/**
 * Estilos Mobile-First - Componentes Genéricos
 * Sistema de Tienda Online - Restaurante
 *
 * NOTA: Los estilos de las tarjetas de productos están en tienda.css
 *       Este archivo contiene solo componentes reutilizables genéricos
 */

/* ===================================
   NAVEGACIÓN DE CATEGORÍAS (SOLO SI NO ESTÁ EN TIENDA.CSS)
=================================== */

.categorias {
    background: white;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-overflow-scrolling: touch;
}

.categorias::-webkit-scrollbar {
    display: none;
}

.categorias a {
    padding: 10px 20px;
    background: #f0f0f0;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.categorias a:hover,
.categorias a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* ===================================
   CARRITO FLOTANTE
=================================== */

#carrito-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease;
}

#carrito-flotante:hover {
    transform: scale(1.1);
}

#carrito-contador {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
   MODAL DE PRODUCTO
=================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(50px);
        opacity: 0;
    }
}

.modal-content.modal-closing {
    animation: slideDownOut 0.3s ease forwards;
}

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

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

.close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* ===================================
   FORMULARIOS
=================================== */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* ===================================
   BOTONES GENÉRICOS
=================================== */

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background: #fcc600;
    color: #000000;
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(252, 198, 0, 0.3);
    font-weight: 700;
}

.btn-primary:hover {
    background: #ffdb4d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 198, 0, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-block {
    width: 100%;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ===================================
   ALERTAS
=================================== */

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0a3622;
    border-left: 4px solid #0a3622;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #856404;
}

/* ===================================
   UTILIDADES
=================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ===================================
   RESPONSIVE PARA CARRITO FLOTANTE
=================================== */

@media (max-width: 480px) {
    #carrito-flotante {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }

    #carrito-contador {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .form-actions {
        gap: 12px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}
