/* css/estilo.css */

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Colores */
:root {
    --color-fondo: #f7f2ee;
    --color-principal: #a78b6f;
    --color-secundario: #eeddcc;
    --color-acento: #c49e69;
    --color-texto: #3c3c3c;
    --color-blanco: #ffffff;
}

/* Tipografías */
body {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: var(--color-texto);
    background-color: var(--color-fondo);
    line-height: 1.6;
}

/* Títulos */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    color: var(--color-principal);
    margin-bottom: 0.5em;
}

/* Enlaces */
a {
    text-decoration: none;
    color: var(--color-principal);
}
a:hover {
    color: var(--color-acento);
}

/* Contenedor general */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background-color: var(--color-blanco);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}
.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--color-principal);
}

/* Lista de navegación */
.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-list li a {
    font-weight: 500;
}

/* Botón especial del carrito */
.nav-cart {
    background-color: var(--color-acento) !important;
    color: var(--color-blanco) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid transparent !important;
}

.nav-cart:hover {
    background-color: var(--color-principal) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Botón "Menú" (visible en móviles) */
.menu-toggle {
    display: none;
    font-size: 1rem;
    background: var(--color-principal);
    color: var(--color-blanco);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Footer */
.footer {
    background-color: var(--color-principal);
    color: var(--color-blanco);
    padding: 1.5rem 0;
    margin-top: 3rem;
}
.footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.footer-links a {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: var(--color-blanco);
}

/* Botones generales */
.btn {
    display: inline-block;
    background-color: var(--color-principal);
    color: var(--color-blanco);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn:hover {
    background-color: var(--color-acento);
}

/* Formularios */
input[type='text'],
input[type='email'],
input[type='password'],
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
}

/* Tablas básicas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
table th,
table td {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    text-align: left;
}
table th {
    background-color: var(--color-secundario);
}

/* Responsive: menú compacto con botón "Menú" */
@media (max-width: 768px) {
    .nav-list {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--color-blanco);
        flex-direction: column;
        width: 200px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        padding: 1rem;
    }
    .nav-list.open {
        transform: translateX(0);
    }
    .menu-toggle {
        display: block;
    }
    .nav-list li {
        margin-bottom: 1rem;
    }
    .nav-list li:last-child {
        margin-bottom: 0;
    }
}

/* En pantallas grandes, siempre mostrar lista y ocultar botón "Menú" */
@media (min-width: 769px) {
    .nav-list {
        display: flex !important;
        position: static;
        transform: translateX(0);
        box-shadow: none;
        background: none;
        flex-direction: row;
        width: auto;
    }
    .menu-toggle {
        display: none;
    }
}

/* Slider */
.slider-section {
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}
.slider-container {
    position: relative;
    width: 100%;
    height: 70vh;
    max-height: 600px;
}
.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slide.active {
    opacity: 1;
    z-index: 1;
}
.slide-overlay {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    text-align: center;
    color: #fff;
    max-width: 600px;
    border-radius: 8px;
}
.slide-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.slide-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.btn-slide {
    background-color: var(--color-acento);
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
}
.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(60, 60, 60, 0.5);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    outline: none;
}
.slider-prev {
    left: 1%;
}
.slider-next {
    right: 1%;
}
.slider-dots {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
}
.dot.active {
    background-color: var(--color-acento);
}

/* Sección Nosotros breve */
.home-nosotros {
    padding: 3rem 0;
    background-color: var(--color-secundario);
    text-align: center;
}
.nosotros-breve h2 {
    margin-bottom: 1rem;
}
.nosotros-breve p {
    margin-bottom: 1.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Sección Productos Destacados */
.home-destacados {
    padding: 3rem 0;
    text-align: center;
}
/* ============================
   Estilos de “Productos Destacados”
   ============================ */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}
.card-producto {
    background-color: var(--color-blanco);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}
.card-producto:hover {
    transform: translateY(-4px);
}
.card-producto img {
    width: 100%;
    object-fit: cover;
    /* Para que la imagen no se estire demasiado, fijamos altura máxima */
    max-height: 220px;
}
.card-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card-titulo {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}
.card-categoria {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.6rem;
}
.card-precio {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}
.precio-original {
    text-decoration: line-through;
    color: #999;
    margin-right: 0.5rem;
}
.precio-oferta {
    color: var(--color-principal);
}

/* Ajustes responsive para pantallas pequeñas */
@media (max-width: 1024px) {
    .grid-productos {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .grid-productos {
        grid-template-columns: 1fr;
    }
}
.contacto-imagen img {
    max-width: 100%;
    border-radius: 8px;
}

/* Ajustes responsive */
@media (max-width: 768px) {
    .contacto-container {
        flex-direction: column;
    }
    .home-destacados h2 {
        font-size: 1.8rem;
    }
}

/* estilo carrito*/

/* carrito.php: Tabla de carrito */
.tabla-carrito {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}
.tabla-carrito th,
.tabla-carrito td {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}
.tabla-carrito th {
    background-color: var(--color-secundario);
}
.btn-rojo {
    background-color: #c04949;
}
.btn-rojo:hover {
    background-color: #a03838;
}
.total-carrito {
    text-align: right;
    margin-top: 1rem;
}
.total-carrito p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* ...otros estilos existentes... */

/* =============================
   TIENDA.PHP: GRID DE PRODUCTOS
   ============================= */
.page-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--color-principal);
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background-color: var(--color-blanco);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card__link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card__image {
    width: 100%;
    padding-top: 75%; /* ratio 4:3 */
    position: relative;
    overflow: hidden;
}

.product-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card__title {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--color-texto);
}

.product-card__category {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.6rem;
}

.product-card__price {
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.precio-original {
    text-decoration: line-through;
    color: #999;
    margin-right: 0.5rem;
}

.precio-oferta {
    color: var(--color-principal);
}

.precio-normal {
    color: var(--color-principal);
}

.stock-disponible {
    font-size: 0.85rem;
    color: #2e7d32; /* verde suave */
}

.stock-agotado {
    font-size: 0.85rem;
    color: #c62828; /* rojo */
}

/* Ajustes responsive para la grilla */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================
   TIENDA.PHP: DETALLE DE PRODUCTO (FLEX)
   ===================================== */
.product-detail {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-detail__gallery {
    flex: 1;
    max-width: 50%;
}

/* Galería de imágenes del producto */
.product-gallery {
    max-width: 500px;
    margin: 0 auto;
}

.product-gallery__main {
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-height: 500px;
}

.product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.product-gallery__thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

.thumbnail:hover {
    opacity: 1;
    border-color: var(--color-principal);
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--color-acento);
    box-shadow: 0 0 0 2px rgba(196, 158, 105, 0.3);
}

.product-detail__info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-detail__title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--color-principal);
}

.product-detail__category {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

.product-detail__pricing {
    margin-bottom: 1rem;
}

.product-detail__pricing .precio-original {
    text-decoration: line-through;
    color: #999;
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.product-detail__pricing .precio-oferta,
.product-detail__pricing .precio-normal {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-principal);
}

.product-detail__stock {
    margin-bottom: 1rem;
    font-weight: 500;
}

.product-detail__desc {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--color-texto);
}

/* Formulario para añadir al carrito */
.form-add-cart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-add-cart__label {
    font-weight: 500;
}

.form-add-cart__input {
    width: 60px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-agregar {
    padding: 0.6rem 1.2rem;
    background-color: var(--color-principal);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-agregar:hover {
    background-color: var(--color-acento);
}

/* Botón “Volver a la Tienda” */
.btn-regresar {
    display: inline-block;
    margin-top: auto;
    padding: 0.5rem 1rem;
    background-color: #777;
    color: #fff;
    font-size: 0.9rem;
}

.btn-regresar:hover {
    background-color: #555;
}

/* Ajustes responsive para detalle de producto */
@media (max-width: 900px) {
    .product-detail {
        flex-direction: column;
    }
    .product-detail__image,
    .product-detail__info {
        max-width: 100%;
    }
}

/* =====================================
   BOTÓN FLOTANTE DE WHATSAPP
   ===================================== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 9999 !important;
    border: 3px solid white;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
    filter: brightness(0) invert(1);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 65px;
        height: 65px;
    }

    .whatsapp-float img {
        width: 32px;
        height: 32px;
    }
}

/* ============================
   ALERTAS (mensaje carrito)
   ============================ */
.alerta {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.alerta-exito {
    background-color: #e8f5e9;
    color: #2e7d32;
}
.alerta-info {
    background-color: #e3f2fd;
    color: #1565c0;
}
