/* Estilos para la página de recetas */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-image: url('promp/fondo principal.jpg');
    background-size: cover;
    background-attachment: fixed;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

#titulo {
    max-width: 400px;
    height: auto;
    margin-bottom: 20px;
}

.subtitulo {
    font-size: 16px;
    max-width: 800px;
    margin: 0 auto;
}

/* Salsas section */
.salsas {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto 40px;
    background: rgba(255,255,255,0.85);
    border-radius: 10px;
}

.salsas h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.salsas-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    align-items: start;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.salsa-item {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.salsa-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.salsa-item h4 {
    margin: 6px 0;
    font-size: 16px;
    color: #333;
}

.salsa-desc {
    font-size: 14px;
    color: #666;
}

.salsas-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.btn {
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* allow items to overflow grid cells so destacado can overlap neighbours */
.galeria {
    align-items: start;
}

.item-galeria {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    position: relative;
}

.item-galeria:hover {
    transform: scale(1.05);
}

.item-galeria img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Destacado: primera receta tradicional */
.item-galeria.destacado {
    border: 3px solid #ffd27f;
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
    z-index: 2;
}

.item-galeria.destacado img {
    height: 360px;
    object-fit: cover;
}

/* Make destacado overflow and sit above neighbours */
.item-galeria.destacado {
    overflow: visible;
    z-index: 60;
    transform: translateY(-30px);
}

/* On small screens don't offset (prevents layout issues) */
@media (max-width: 700px) {
    .item-galeria.destacado {
        transform: none;
        z-index: 3;
    }
    .item-galeria.destacado img {
        height: 250px;
    }
}

.badge {
    position: absolute;
    left: 12px;
    top: 12px;
    background: #e94e1b;
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* On larger screens make the destacado span two columns for emphasis */
@media (min-width: 900px) {
    .galeria {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .item-galeria.destacado {
        grid-column: span 2;
    }
}

/* Centered destacado above salsas */
.destacado-centrado {
    width: 80%;
    max-width: 1000px;
    margin: 20px auto 0;
    position: relative;
    z-index: 80;
    display: flex;
    justify-content: center;
}

.destacado-centrado .item-galeria {
    width: 100%;
    max-width: 900px;
    transform: none;
    overflow: hidden; /* ocultar la descripción por defecto */
}

.destacado-centrado .item-galeria img {
    height: 300px;
    object-fit: cover;
}

/* overlap the salsas section: pull the next section up under the destacado */
.destacado-centrado + .salsas {
    margin-top: 20px;
}

@media (max-width: 700px) {
    .destacado-centrado + .salsas {
        margin-top: 10px;
    }
    .destacado-centrado .item-galeria img {
        height: 220px;
    }
}

.descripcion {
    position: absolute;
    bottom: 35px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    font-size: 16px;
    font-weight: bold;
}

.precio-item {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(233, 78, 27, 0.95);
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    text-align: center;
    font-size: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.item-galeria:hover .descripcion {
    transform: translateY(-35px);
}

.item-galeria:hover .precio-item {
    transform: translateY(0);
}

/* Estilo especial para precio en destacado */
.item-galeria.destacado .precio-item {
    transform: translateY(0);
    background: rgba(233, 78, 27, 0.9);
    font-size: 16px;
    padding: 12px 15px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 99999; /* mayor que la tarjeta destacada */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-contenido {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
    z-index: 100000; /* por encima del overlay y cualquier otro elemento */
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cerrar {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cerrar:hover,
.cerrar:focus {
    color: #000000;
}

#modal-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

#modal-titulo {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 24px;
}

#modal-info {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
}

.item-galeria {
    cursor: pointer;
}

/* Secciones de carnes (Cerdo, Pavo, etc) */
.seccion-carnes {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.seccion-carnes h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #ff6b35;
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sección Complementos */
.seccion-complementos {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
}

.seccion-complementos h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 28px;
}

.lista-complementos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.complemento-item {
    padding: 18px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #e94e1b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.complemento-imagen {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
    display: block;
}

.complemento-item h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.desc-complemento {
    color: #666;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.precio-complemento {
    color: #e94e1b;
    font-weight: bold;
    font-size: 18px;
    margin-top: 10px;
}

/* Sección Postres */
.seccion-postres {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
}

.seccion-postres h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 28px;
}

.lista-postres {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.postre-item {
    padding: 18px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #d32f2f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.postre-imagen {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
    display: block;
}

.postre-item h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.desc-postre {
    color: #666;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.precio-postre {
    color: #d32f2f;
    font-weight: bold;
    font-size: 18px;
    margin-top: 10px;
}

/* Sección Pedidos */
.seccion-pedidos {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto 40px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff4500 100%);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.seccion-pedidos h3 {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    font-size: 36px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.pedidos-contenedor {
    display: flex;
    justify-content: center;
}

.pedido-info {
    background: white;
    padding: 30px 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    border-top: 5px solid #ff6b35;
}

.pedido-info h4 {
    color: #ff6b35;
    font-size: 26px;
    margin-bottom: 20px;
    font-weight: bold;
}

.telefono {
    color: #ff6b35;
    font-size: 20px;
    font-weight: bold;
    margin: 12px 0;
    line-height: 1.8;
}

.direccion {
    color: #2c3e50;
    font-size: 17px;
    margin-top: 20px;
    line-height: 1.8;
}

.direccion strong {
    display: block;
    font-size: 19px;
    margin-bottom: 5px;
    color: #ff6b35;
}

/* ============ OPTIMIZACIÓN PARA MOBILE ============ */

@media (max-width: 768px) {
    /* Header mobile */
    header {
        padding: 20px 15px;
    }

    #titulo {
        max-width: 300px;
    }

    .subtitulo {
        font-size: 14px;
    }

    /* Salsas mobile */
    .salsas {
        padding: 20px 15px;
        margin: 0 auto 30px;
    }

    .salsas h3 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .salsas-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .salsa-item {
        padding: 10px;
    }

    .salsa-item img {
        height: 100px;
        margin-bottom: 8px;
    }

    .salsa-item h4 {
        font-size: 14px;
    }

    .salsa-desc {
        font-size: 12px;
    }

    /* Galería mobile */
    .galeria {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 15px;
    }

    .item-galeria img {
        height: 200px;
    }

    /* Destacado mobile */
    .destacado-centrado {
        width: 100%;
        margin: 15px auto 0;
    }

    .destacado-centrado .item-galeria img {
        height: 200px;
    }

    /* Carnes sections mobile */
    .seccion-carnes {
        padding: 20px 15px;
        margin: 0 auto 30px;
    }

    .seccion-carnes h3 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    /* Complementos mobile */
    .seccion-complementos {
        padding: 20px 15px;
        margin: 0 auto 30px;
    }

    .seccion-complementos h3 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .lista-complementos {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .complemento-imagen {
        height: 150px;
        margin-bottom: 12px;
    }

    .complemento-item h4 {
        font-size: 15px;
    }

    .desc-complemento {
        font-size: 12px;
    }

    .precio-complemento {
        font-size: 16px;
    }

    /* Postres mobile */
    .seccion-postres {
        padding: 20px 15px;
        margin: 0 auto 30px;
    }

    .seccion-postres h3 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .lista-postres {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .postre-imagen {
        height: 150px;
        margin-bottom: 12px;
    }

    .postre-item h4 {
        font-size: 15px;
    }

    .desc-postre {
        font-size: 12px;
    }

    .precio-postre {
        font-size: 16px;
    }

    /* Pedidos mobile */
    .seccion-pedidos {
        padding: 25px 15px;
        margin: 0 auto 30px;
    }

    .seccion-pedidos h3 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .pedido-info {
        padding: 20px 20px;
        max-width: 100%;
    }

    .pedido-info h4 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .telefono {
        font-size: 18px;
        margin: 10px 0;
    }

    .direccion {
        font-size: 15px;
        margin-top: 15px;
    }

    .direccion strong {
        font-size: 17px;
    }

    /* Modal mobile */
    .modal-contenido {
        width: 95%;
        padding: 20px;
        margin: 20% auto;
    }

    #modal-img {
        height: 300px;
        margin-bottom: 15px;
    }

    #modal-titulo {
        font-size: 20px;
        margin-bottom: 12px;
    }

    #modal-info {
        font-size: 14px;
    }

    .cerrar {
        font-size: 24px;
        right: 15px;
        top: 10px;
    }

    /* Precio item mobile */
    .precio-item {
        font-size: 14px;
        padding: 8px 12px;
    }

    .item-galeria:hover .descripcion {
        transform: translateY(-30px);
    }
}

@media (max-width: 480px) {
    /* Extra pequeños */
    header {
        padding: 15px 10px;
    }

    #titulo {
        max-width: 250px;
    }

    .subtitulo {
        font-size: 12px;
    }

    .seccion-carnes h3,
    .seccion-complementos h3,
    .seccion-postres h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .salsas h3 {
        font-size: 20px;
    }

    .salsas-list {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .salsa-item img {
        height: 80px;
    }

    .seccion-pedidos h3 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .pedido-info {
        padding: 15px 15px;
    }

    .pedido-info h4 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .telefono {
        font-size: 16px;
        margin: 8px 0;
    }

    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* ============ BOTÓN FLOTANTE WHATSAPP ============ */

.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25d366;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    z-index: 999;
    text-decoration: none;
}

.whatsapp-btn:hover {
    background: #1fa855;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:active {
    transform: scale(0.95);
}

.whatsapp-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Mobile - botón flotante WhatsApp */
@media (max-width: 768px) {
    .whatsapp-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .whatsapp-btn svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .whatsapp-btn {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .whatsapp-btn svg {
        width: 20px;
        height: 20px;
    }
}
