/*==================== CARTA DIGITAL STYLES ====================*/
/**
 * Estilos para la carta digital integrada desde API
 * Se integra con styles.css existente de Mak Dürum
 * Autor: Carta360-V3
 * Fecha: 2025-10-10
 */

/*==================== SELECTOR DE IDIOMA ====================*/
.carta-lang-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(211, 17, 175, 0.05), rgba(244, 215, 36, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(211, 17, 175, 0.1);
}

.carta-lang-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.carta-lang-selector label svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary-color);
}

.carta-lang-selector select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background: var(--white-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23D311AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px;
}

.carta-lang-selector select:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(211, 17, 175, 0.15);
}

.carta-lang-selector select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(244, 215, 36, 0.2);
}

/*==================== CONTAINER PRINCIPAL ====================*/
.carta-digital-container {
    width: 100%;
    margin: 2rem 0;
}

.carta-section {
    margin-bottom: 4rem;
}

.carta-section:last-child {
    margin-bottom: 2rem;
}

/*==================== ESTADOS DE CARGA ====================*/
.carta-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.carta-loading__spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(211, 17, 175, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.carta-loading p {
    font-size: 1.125rem;
    color: var(--text-color);
    font-weight: 500;
}

.carta-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(211, 17, 175, 0.05), rgba(244, 215, 36, 0.05));
    border-radius: 16px;
    border: 2px dashed rgba(211, 17, 175, 0.2);
}

.carta-error svg {
    margin-bottom: 1.5rem;
    stroke: var(--primary-color);
}

.carta-error h3 {
    color: var(--title-color);
    margin-bottom: 0.75rem;
}

.carta-error p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    max-width: 500px;
}

/*==================== MENÚS/COMBOS ====================*/
.menus-container {
    display: grid;
    gap: 1.5rem;
}

.menu-card {
    background: var(--white-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.menu-card:hover {
    box-shadow: 0 8px 30px rgba(211, 17, 175, 0.15);
    transform: translateY(-2px);
}

.menu-card__header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(211, 17, 175, 0.05), rgba(244, 215, 36, 0.05));
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.menu-card__header:hover {
    background: linear-gradient(135deg, rgba(211, 17, 175, 0.1), rgba(244, 215, 36, 0.1));
}

.menu-card__title {
    flex: 1;
}

.menu-card__title h3 {
    font-size: 1.5rem;
    color: var(--title-color);
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.menu-card__desc {
    font-size: 0.9375rem;
    color: var(--text-color);
    margin: 0;
    opacity: 0.85;
}

.menu-card__price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
}

.menu-card__chevron {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.menu-card__header[aria-expanded="true"] .menu-card__chevron {
    transform: rotate(180deg);
}

.menu-card__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 1.5rem; /* Padding lateral siempre presente */
}

.menu-card__body.open {
    padding: 1.5rem; /* Padding completo cuando está abierto */
}

.menu-card__footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed rgba(211, 17, 175, 0.1);
    font-size: 0.875rem;
    color: var(--text-color);
    font-style: italic;
    opacity: 0.8;
}

/*==================== GRUPOS DE MENÚ ====================*/
.menu-group {
    margin-bottom: 2rem;
}

.menu-group:last-child {
    margin-bottom: 0;
}

.menu-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.menu-group__header h4 {
    font-size: 1.25rem;
    color: var(--title-color);
    margin: 0;
    font-weight: 700;
}

.menu-group__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: var(--primary-color);
    color: var(--white-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.menu-group__badge.badge--shared {
    background: var(--secondary-color);
    color: var(--title-color);
}

.menu-group__desc {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 0.9375rem;
    opacity: 0.85;
}

/*==================== GRID DE PRODUCTOS ====================*/
.menu-products-grid,
.productos-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media screen and (max-width: 640px) {
    .menu-products-grid,
    .productos-grid {
        grid-template-columns: 1fr;
    }
}

/*==================== TARJETAS DE PRODUCTO ====================*/
.producto-card {
    background: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    box-shadow: 0 6px 24px rgba(211, 17, 175, 0.12);
    transform: translateY(-4px);
}

.producto-card__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #f8f8f8;
    border-bottom: 3px solid var(--primary-color);
}

.producto-card__content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.producto-card__content h3,
.producto-card__content h5 {
    font-size: 1.125rem;
    color: var(--title-color);
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    line-height: 1.3;
}

.producto-card__content p {
    font-size: 0.875rem;
    color: var(--text-color);
    margin: 0 0 1rem 0;
    line-height: 1.5;
    flex: 1;
    opacity: 0.85;
}

.producto-card__prices {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.producto-card__price {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), #e01199);
    color: var(--white-color);
    font-size: 1.125rem;
    font-weight: 800;
    border-radius: 8px;
}

.producto-card__suplemento {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--secondary-color);
    color: var(--title-color);
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.producto-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/*==================== BADGES ====================*/
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.badge--new {
    background: #FF6B6B;
    color: var(--white-color);
}

.badge--recommended {
    background: var(--secondary-color);
    color: var(--title-color);
}

.badge--veggie {
    background: #51CF66;
    color: var(--white-color);
}

.badge--spicy {
    background: #FF8C42;
    color: var(--white-color);
    font-size: 0.75rem;
}

/*==================== PRODUCTOS EN MENÚ ====================*/
.producto-card--menu {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

.producto-card--menu:hover {
    transform: translateY(-2px);
}

.producto-card--menu .producto-card__img {
    aspect-ratio: 1 / 1;
    border-bottom-width: 2px;
}

.producto-card--menu .producto-card__content {
    padding: 1rem;
}

.producto-card--menu h5 {
    font-size: 1rem;
}

.producto-card--menu p {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

/*==================== NOTA DE GENERACIÓN ====================*/
.carta-generated-note {
    text-align: center;
    padding: 1rem;
    margin-top: 3rem;
    font-size: 0.8125rem;
    color: var(--text-color);
    opacity: 0.5;
    font-style: italic;
}

/*==================== RESPONSIVE ====================*/
@media screen and (min-width: 768px) {
    .carta-lang-selector {
        max-width: 400px;
    }
    
    .menu-card__header {
        padding: 2rem;
    }
    
    .menu-card__body.open {
        padding: 2rem;
    }
    
    .menu-card__title h3 {
        font-size: 1.75rem;
    }
    
    .menu-card__price {
        font-size: 2rem;
    }
    
    .menu-products-grid,
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media screen and (min-width: 968px) {
    .menus-container {
        gap: 2rem;
    }
    
    .carta-section {
        margin-bottom: 5rem;
    }
    
    .menu-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media screen and (min-width: 1200px) {
    .productos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/*==================== ANIMACIONES ADICIONALES ====================*/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carta-digital-container > * {
    animation: fadeInUp 0.6s ease-out;
}

/*==================== ACCESIBILIDAD ====================*/
.menu-card__header:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.producto-card:focus-within {
    box-shadow: 0 0 0 3px rgba(244, 215, 36, 0.3);
}

/* Modo alto contraste */
@media (prefers-contrast: high) {
    .menu-card,
    .producto-card {
        border: 2px solid var(--title-color);
    }
    
    .badge {
        border: 1px solid currentColor;
    }
}

/* Modo reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .producto-card,
    .menu-card,
    .carta-loading__spinner {
        animation: none;
        transition: none;
    }
}

/*==================== IMPRESIÓN ====================*/
@media print {
    .carta-lang-selector,
    .carta-loading,
    .carta-error {
        display: none;
    }
    
    .menu-card__body {
        max-height: none !important;
    }
    
    .producto-card {
        break-inside: avoid;
    }
}
