:root {
    --primary-color: #C89933; 
    --primary-dark: #A67E26;
    --secondary-color: #CD7F67; 
    --bg-soft: #FAF8F5; 
    --text-dark: #4A4A4A;
    --text-light: #7A7A7A;
    --white: #ffffff;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
html, body { overflow-x: hidden; width: 100%; max-width: 100vw; }
body { background-color: var(--bg-soft); color: var(--text-dark); line-height: 1.6; }
.btn-primary { background: var(--primary-color); color: white; padding: 12px 24px; border: none; border-radius: 30px; font-weight: bold; text-decoration: none; cursor: pointer; transition: 0.3s; display: inline-block; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--primary-color); padding: 12px 24px; border: 2px solid var(--primary-color); border-radius: 30px; font-weight: bold; text-decoration: none; transition: 0.3s; display: inline-block; }
.btn-secondary:hover { background: var(--bg-soft); }
.w-100 { width: 100%; }
.mt-3 { margin-top: 15px; }

/* NAVBAR */
.top-bar { background-color: var(--secondary-color); color: var(--white); text-align: center; padding: 8px; font-size: 0.9em; font-weight: 500; }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; background-color: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; }
.brand { display: flex; align-items: center; gap: 15px; }
.logo { width: 65px; height: 65px; border-radius: 50%; object-fit: cover; }
.brand-text h1 { font-size: 1.6em; color: var(--primary-color); line-height: 1; }
.brand-text span { font-size: 0.9em; font-style: italic; color: var(--text-light); }
.nav-links { display: flex; list-style: none; gap: 25px; }
.nav-links a { text-decoration: none; color: var(--text-dark); font-weight: 600; transition: 0.3s; }
.nav-links a:hover { color: var(--primary-color); }
.cart-icon { font-size: 1.5em; cursor: pointer; position: relative; color: var(--text-dark); }
#cart-count { position: absolute; top: -8px; right: -10px; background-color: var(--secondary-color); color: white; border-radius: 50%; padding: 2px 7px; font-size: 0.6em; font-weight: bold; }

/* HERO */
.hero { position: relative; height: 70vh; background: url('../assets/4.jpeg') center/cover no-repeat; display: flex; align-items: center; justify-content: center; text-align: center; color: white; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); }
.hero-content { position: relative; z-index: 1; max-width: 600px; padding: 20px; }
.hero-content h2 { font-size: 3em; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.hero-content p { font-size: 1.2em; margin-bottom: 25px; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; }

/* SECCIÓN NOSOTROS (INFO & CERTIFICADOS) */
.info-section { padding: 80px 5%; background: white; }
.container { max-width: 1200px; margin: 0 auto; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: flex-start; }
.info-text h3 { color: var(--primary-color); font-size: 2.2em; margin-bottom: 20px; }
.info-text p { font-size: 1.1em; margin-bottom: 15px; text-align: justify; }
.info-visuals { display: flex; flex-direction: column; gap: 30px; }

/* CORRECCIÓN DE LA IMAGEN DE LA MAMÁ CON VESTIDO CHILENO */
.nosotros-img { border-radius: 15px; width: 100%; max-width: 350px; height: auto; object-fit: cover; display: block; margin: 0 auto; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.certificados-box { background: var(--bg-soft); padding: 20px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-align: center; overflow: hidden; width: 100%; box-sizing: border-box; }
.certificados-box h4 { color: var(--primary-color); margin-bottom: 15px; font-size: 1.2em; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 15px; padding-bottom: 10px; }
.carousel-track::-webkit-scrollbar { height: 8px; }
.carousel-track::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
.carousel-slide { min-width: 100%; scroll-snap-align: center; display: flex; flex-direction: column; gap: 10px; }
/* Se ajustó object-fit a contain para que los certificados se lean completos sin cortarse */
.carousel-slide img { width: 100%; height: 250px; object-fit: contain; background: white; border-radius: 10px; padding: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.carousel-slide span { font-weight: bold; color: var(--secondary-color); font-size: 0.9em; }
.swipe-hint { font-size: 0.8em; color: var(--text-light); margin-top: 10px; }

/* TIENDA Y CATÁLOGO */
.asesoria-section { background: var(--primary-color); color: white; padding: 60px 5%; }
.text-center { text-align: center; }
.asesoria-section h2 { font-size: 2.2em; margin-bottom: 15px; }
.asesoria-section p { font-size: 1.1em; margin-bottom: 30px; }
.btn-large { font-size: 1.1em; padding: 15px 30px; background: white; color: var(--primary-color); }
.btn-large:hover { background: var(--bg-soft); color: var(--primary-dark); }
.tienda-section { padding: 80px 5%; }
.tienda-section h2 { color: var(--primary-color); font-size: 2.5em; margin-bottom: 30px; }
.filtros { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; }
.btn-filtro { padding: 8px 20px; border: 2px solid var(--primary-color); background: transparent; color: var(--primary-color); border-radius: 20px; cursor: pointer; font-weight: 600; transition: 0.3s; }
.btn-filtro.active, .btn-filtro:hover { background: var(--primary-color); color: white; }
.grid-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }

.producto-card { 
    background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    transition: transform 0.3s; text-align: center;
    display: flex; flex-direction: column; height: 100%; 
}
.producto-card:hover { transform: translateY(-5px); }
.producto-card img { width: 100%; height: 280px; object-fit: cover; }
.card-body { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.card-body .btn-primary { margin-top: auto; width: 100%; }
.card-body h3 { margin: 0 0 10px 0; color: var(--text-dark); font-size: 1.1em; }
.card-body .opciones { font-size: 0.8em; color: #777; margin-bottom: 10px; }
.card-body .precio { font-size: 1.2em; font-weight: bold; color: var(--secondary-color); margin-bottom: 15px; }

/* MODAL & CHECKOUT */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-content { background-color: white; padding: 30px; border-radius: 15px; width: 90%; max-width: 500px; position: relative; max-height: 90vh; overflow-y: auto; }
.close-modal { position: absolute; right: 20px; top: 15px; font-size: 28px; cursor: pointer; color: var(--text-light); }
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9em; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 1em; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary-color); }

/* SIDEBAR CARRITO */
.cart-sidebar { position: fixed; top: 0; right: -400px; width: 350px; max-width:100%; height: 100vh; background: white; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transition: 0.4s ease; z-index: 1000; display: flex; flex-direction: column; }
.cart-sidebar.open { right: 0; }
.cart-header, .cart-footer { padding: 20px; background: var(--bg-soft); }
.cart-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.cart-header h3 { color: var(--primary-color); }
#close-cart { background: none; border: none; font-size: 1.5em; cursor: pointer; color: var(--text-dark); }
.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.cart-item h4 { font-size: 1em; margin-bottom: 5px; }
.btn-checkout { width: 100%; background: var(--secondary-color); color: white; border: none; padding: 15px; font-size: 1.1em; cursor: pointer; border-radius: 30px; margin-top: 15px; font-weight: bold; transition: 0.3s; }
.btn-checkout:hover { background: #b86e58; }

/* FOOTER */
footer { background: var(--text-dark); color: white; padding: 60px 5% 30px; margin-top: 50px; }
.footer-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.footer-section h4 { color: var(--primary-color); margin-bottom: 15px; font-size: 1.2em; }
.footer-section p { margin-bottom: 10px; color: #ccc; }
.footer-section i { color: var(--primary-color); margin-right: 8px; width: 20px; }
.highlight { color: var(--secondary-color); font-weight: bold; }


/* EMBAJADORAS */
.embajadoras-section { padding: 40px 5% 80px; background: white; }
.embajadoras-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 20px; padding-bottom: 20px; }
.embajadoras-grid::-webkit-scrollbar { height: 8px; }
.embajadoras-grid::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }

.embajadora-card { min-width: 280px; max-width: 300px; flex: 0 0 auto; scroll-snap-align: center; background: var(--bg-soft); border-radius: 15px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.embajadora-card img { width: 100%; height: 350px; object-fit: cover; object-position: top center; }
.embajadora-info { padding: 15px; text-align: center; }
.embajadora-info h4 { color: var(--text-dark); margin-bottom: 5px; font-size: 1.2em; }
.embajadora-info a { color: var(--secondary-color); text-decoration: none; font-weight: bold; font-size: 0.9em; transition: 0.3s; }
.embajadora-info a:hover { color: var(--primary-color); }

/* Ajustes adicionales a imagen de nosotros */
.nosotros-img { border-radius: 15px; width: 100%; max-width: 400px; height: auto; object-fit: cover; display: block; margin: 0 auto; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }


/* POLÍTICAS DE VENTA Y GARANTÍA */
.politicas-section { padding: 60px 5%; background: var(--bg-soft); }
.politicas-box { background: white; padding: 40px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); max-width: 1000px; margin: 0 auto; }
.politicas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 30px; }
.politica-item { background: var(--bg-soft); padding: 20px; border-radius: 10px; border-left: 4px solid var(--primary-color); }
.politica-item h4 { color: var(--primary-dark); margin-bottom: 12px; font-size: 1.1em; display: flex; align-items: center; gap: 8px; }
.politica-item p, .politica-item li { font-size: 0.95em; color: var(--text-dark); margin-bottom: 8px; }
.item-full-width { grid-column: 1 / -1; }

/* RESPONSIVE DISEÑO PANEL ADMIN (Celular y PC) */
.admin-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 250px; background: var(--text-dark); color: white; padding: 20px; display: flex; flex-direction: column; }
.sidebar-header h2 { color: var(--primary-color); text-align: center; margin-bottom: 20px; }
.sidebar-menu { display: flex; flex-direction: column; gap: 10px; }
.sidebar a { color: white; text-decoration: none; padding: 12px; border-radius: 8px; transition: 0.3s; display: block; }
.sidebar a.active, .sidebar a:hover { background: var(--primary-color); }
.main-content { flex: 1; padding: 30px; overflow-y: auto; }
.card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.table-responsive { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; min-width: 500px; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background: var(--bg-soft); color: var(--text-dark); }
.btn-delete { background: #F44336; color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; }

/* Pantalla Login */
.login-wrapper { display: flex; align-items: center; justify-content: center; height: 100vh; width: 100%; background: var(--bg-soft); position: fixed; top: 0; left: 0; z-index: 9999; }
.login-card { background: white; padding: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); width: 90%; max-width: 400px; }

/* MEDIA QUERIES MOBILE (Celulares) */
@media (max-width: 768px) {
    /* Prevención estricta de desbordamiento */
    * { max-width: 100%; }
    
    /* Encabezado y Navegación */
    .brand-text h1 { font-size: 1.2em; }
    .logo { width: 45px; height: 45px; }
    .nav-links { display: none; }
    
    /* Secciones y Espaciados más controlados */
    .info-section, .tienda-section, .asesoria-section { padding: 40px 15px; overflow: hidden; }
    .container { width: 100%; padding: 0; }
    
    /* Hero (Portada principal) */
    .hero { height: 60vh; }
    .hero-content { padding: 15px; }
    .hero-content h2 { font-size: 2em; }
    .hero-content p { font-size: 1em; }
    .hero-buttons { flex-direction: column; width: 100%; gap: 10px; }
    
    /* Nosotros y Certificados */
    .info-grid { grid-template-columns: 1fr; gap: 20px; width: 100%; }
    .info-text p { text-align: left; font-size: 1em; } /* Quitado el justify que a veces rompe el ancho */
    .nosotros-img { height: auto; max-height: 250px; width: 100%; max-width: 250px; margin: 0 auto; display: block; }
    
    /* Carrusel de certificados */
    .certificados-box { padding: 15px; width: 100%; max-width: 100vw; box-sizing: border-box; overflow: hidden; }
    .carousel-track { width: 100%; padding-bottom: 5px; }
    .carousel-slide img { height: 220px; width: 100%; }
    
    /* Filtros Tienda */
    .filtros { gap: 8px; margin-bottom: 20px; }
    .btn-filtro { padding: 6px 10px; font-size: 0.85em; flex: 1 1 calc(50% - 10px); text-align: center; }
    
    /* Productos Tienda (2 columnas) */
    .grid-productos { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .producto-card img { height: 160px; } 
    .card-body { padding: 10px; }
    .card-body h3 { font-size: 0.9em; margin-bottom: 5px; }
    .card-body .opciones { font-size: 0.75em; }
    .card-body .precio { font-size: 1.1em; margin-bottom: 10px; }
    
    /* Botones generales */
    .btn-primary, .btn-secondary { padding: 10px 15px; font-size: 0.9em; width: 100%; box-sizing: border-box; }
    
    /* Modal y Footer */
    .modal-content { width: 95%; padding: 20px; margin: 10px; }
    .footer-container { text-align: center; gap: 20px; }

    
    /* Embajadoras celular */
    .embajadoras-section { padding: 20px 15px 40px; }
    .embajadora-card { min-width: 240px; }
    .embajadora-card img { height: 300px; }

    
    /* Políticas Celular */
    .politicas-section { padding: 30px 15px; }
    .politicas-box { padding: 20px; }
    .politicas-grid { grid-template-columns: 1fr; gap: 15px; }
    .item-full-width { grid-column: auto; }

    /* Admin Mobile responsive */
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; padding: 10px; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .sidebar-header { display: none; }
    .sidebar-menu { flex-direction: row; width: 100%; justify-content: space-around; flex-wrap: wrap; gap: 5px; }
    .sidebar a { padding: 8px; font-size: 0.9em; text-align: center; }
    .main-content { padding: 15px; }
    .admin-header h1 { font-size: 1.5em; }
}