/* ==========================================================================
   style.css - ESTILOS FINALES COMPLETOS Y CORREGIDOS
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES GLOBALES Y RESET BÁSICO
   ========================================================================== */
:root {
    --color-primary: #9EC9E2;
    --color-primary-hover: #86b5d4;
    --color-secondary: #A89782;
    --color-secondary-hover: #93826f;
    --color-background-main: #FFFFFF;
    --color-background-section: #FAF9F7;
    --color-surface: #FFFFFF;
    --color-text-main: #212529;
    --color-text-muted: #6c757d;
    --color-header-bg: rgba(255, 255, 255, 0.97);
    --color-footer-bg: #343a40;
    --color-border: #EAE5E1;
    --success-color: #28a745;
    --error-color: #dc3545;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Playfair Display', serif;
    --container-width: 1140px;
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    --box-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --input-bg-color: #fff;
    --input-border-color: #ced4da;
    --input-focus-border-color: var(--color-primary);
    --input-focus-box-shadow: 0 0 0 0.2rem rgba(158, 201, 226, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-primary); line-height: 1.7; color: var(--color-text-main); background-color: var(--color-background-main); overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body.modal-active { overflow: hidden; }

/* ==========================================================================
   2. ESTILOS GENERALES Y UTILITARIOS
   ========================================================================== */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-secondary); font-weight: 700; color: var(--color-text-main); margin-bottom: 0.75rem; }
.section-title { text-align: center; font-size: 2.8rem; margin-bottom: 2.5rem; color: var(--color-text-main); position: relative; padding-bottom: 1rem; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 3px; background-color: var(--color-primary); }
.section-title-left { text-align: left; font-size: 2.5rem; margin-bottom: 1.5rem; color: var(--color-text-main); position: relative; padding-bottom: 0.8rem; }
.section-title-left::after { content: ''; position: absolute; bottom: 0; left: 0; width: 60px; height: 3px; background-color: var(--primary-color); }
.section-intro { font-size: 1.1rem; color: var(--text-muted-color); margin-top: -1.5rem; margin-bottom: 2.5rem; max-width: 650px; margin-left: auto; margin-right: auto; }
a { text-decoration: none; color: var(--color-primary); transition: color 0.3s ease; }
a:hover { color: var(--color-primary-hover); }
img { max-width: 100%; height: auto; display: block; }
.container { width: 90%; max-width: var(--container-width); margin: 0 auto; }
.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--color-background-section); }
.btn { display: inline-block; padding: 0.8rem 1.8rem; font-family: var(--font-primary); font-weight: 600; font-size: 0.95rem; border-radius: var(--border-radius); cursor: pointer; transition: all 0.3s ease; text-align: center; border: 2px solid transparent; }
.btn-primary { background-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background-color: var(--color-primary-hover); transform: translateY(-2px); }
.btn-secondary { background-color: var(--color-secondary); color: #fff; }
.btn-secondary:hover { background-color: var(--color-secondary-hover); transform: translateY(-2px); }
.btn-hero { font-size: 1.1rem; padding: 1rem 2.5rem; box-shadow: 0 4px 10px rgba(158, 201, 226, 0.4); }

/* ==========================================================================
   3. SITIO PÚBLICO
   ========================================================================== */
.site-header { background-color: var(--color-header-bg); border-bottom: 1px solid var(--color-border); padding: 0.8rem 0; position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-shadow: var(--box-shadow); backdrop-filter: blur(6px); }
.site-header .header-content { display: flex; justify-content: space-between; align-items: center; }
.logo-with-text { display: inline-flex; align-items: center; text-decoration: none; gap: 12px; }
.logo-with-text .logo-icon-img { height: 42px; width: auto; }
.logo-with-text .logo-text-name { font-family: var(--font-secondary); font-size: 1.9rem; font-weight: 700; color: var(--text-color); }
.main-nav ul { list-style: none; display: flex; align-items: center; }
.main-nav ul li a { padding: 0.5rem 1rem; color: var(--text-color); font-weight: 500; font-size: 1rem; text-transform: none; position: relative; }
.main-nav ul li a::after { content: ''; position: absolute; bottom: -21px; left: 0; width: 100%; height: 4px; background-color: var(--color-primary); transform: scaleX(0); transition: transform 0.4s ease; transform-origin: center; }
.main-nav ul li a:hover::after, .main-nav ul li a.active::after { transform: scaleX(1); }
.main-nav ul li a.active { color: var(--color-primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; color: var(--text-color); cursor: pointer; }

.hero-section { height: 90vh; min-height: 500px; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; background-color: var(--color-background-section); background-image: none; }
.hero-overlay { display: none; }
.hero-text { color: var(--text-color); animation: fadeInDown 1s 0.2s ease-out backwards; }
.hero-text h1 { color: var(--text-color); text-shadow: none; font-size: 3.5rem; }
.hero-text p { color: var(--text-muted-color); text-shadow: none; font-size: 1.2rem; }

.product-filters .btn-filter { background-color: var(--surface-color); color: var(--text-color); border: 1px solid var(--color-border); border-radius: var(--border-radius-sm); }
.product-filters .btn-filter.active { background-color: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.products-section .product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.8rem; margin-top: 1rem; }
.product-card { background-color: var(--surface-color); border-radius: var(--border-radius); box-shadow: var(--box-shadow); overflow: hidden; text-align: left; display: flex; flex-direction: column; transition: transform 0.3s ease-out, box-shadow 0.3s ease-out; opacity: 0; transform: translateY(20px); }
.product-card:hover { transform: translateY(-8px); box-shadow: var(--box-shadow-lg); }
.product-card .product-image-container { width: 100%; height: 230px; overflow: hidden; background-color: #f0f0f0; }
.product-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover img { transform: scale(1.08); }
.product-card .product-info { padding: 1.2rem; flex-grow: 1; display: flex; flex-direction: column; }
.product-card .product-info h3 { font-size: 1.2rem; font-family: var(--font-primary); font-weight: 600; margin-bottom: 0.4rem; color: var(--text-color); }
.product-card .product-info .product-type { font-size: 0.8rem; color: var(--text-muted-color); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.4rem; }
.product-card .product-price { margin-bottom: 0.8rem; } /* Contenedor general del precio */
.product-card .product-info .btn { margin-top: auto; width: 100%; background-color: var(--color-secondary); color: #fff; font-size: 0.85rem; padding: 0.7rem 1.2rem;}
.product-card .product-info .btn:hover { background-color: var(--color-secondary-hover); }

/* --- NUEVOS ESTILOS PARA PRECIOS Y DESCUENTOS --- */
.price-container { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; font-family: var(--font-primary); font-weight: 500; }
.price-container .normal-price { font-size: 1.3rem; color: var(--text-color); font-weight: 500; }
.price-container .original-price { font-size: 1.1rem; color: var(--text-muted-color); text-decoration: line-through; }
.price-container .discounted-price { font-size: 1.3rem; color: var(--error-color); font-weight: 700; }
.price-container .discount-badge { font-size: 0.8rem; font-weight: 700; color: #fff; background-color: var(--error-color); padding: 2px 6px; border-radius: 4px; }

.product-stock-status { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.8rem; }
.product-stock-status.out-of-stock { color: var(--error-color); }
.product-stock-status.low-stock { color: #e67e22; }

/* (Resto de estilos que ya tenías y funcionaban bien) */
.about-content { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: center; }
.about-image { text-align: center; } .about-image .about-logo-img { max-width: 80%; height: auto; max-height: 300px; display: inline-block; border-radius: var(--border-radius); }
.about-text p { margin-bottom: 1.2rem; font-size: 1.05rem; color: var(--text-muted-color); }
.info-cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
.info-card { background-color: var(--surface-color); padding: 2rem; border-radius: var(--border-radius); box-shadow: var(--box-shadow); text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-5px); box-shadow: var(--box-shadow-lg); }
.info-card-icon { font-size: 3rem; color: var(--primary-color); margin-bottom: 1rem; line-height: 1; }
.info-card h3 { font-family: var(--font-primary); font-size: 1.3rem; font-weight: 600; margin-bottom: 0.75rem; }
.info-card p { color: var(--text-muted-color); font-size: 0.95rem; }
.payment-methods-section { background-color: var(--surface-color); }
.payment-intro { font-size: 1.1rem; color: var(--text-muted-color); margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.payment-icons-container { display: flex; justify-content: center; align-items: center; gap: 3rem; flex-wrap: wrap; }
.payment-icon-item { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.payment-icon-item i { font-size: 3.5rem; color: var(--text-muted-color); transition: transform 0.3s ease, color 0.3s ease; }
.payment-icon-item:hover i { transform: scale(1.1); color: var(--primary-color); }
.payment-icon-item span { font-weight: 500; color: var(--text-color); }
.site-footer-bottom { background-color: var(--dark-color); color: rgba(255,255,255,0.75); padding: 50px 0 25px; text-align: center; }
.site-footer-bottom .footer-content { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.8rem; flex-wrap: wrap; gap: 1rem; }
.site-footer-bottom .footer-logo-text { font-family: var(--font-secondary); font-size: 1.8rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.site-footer-bottom .footer-links a, .site-footer-bottom .footer-social a { color: rgba(255,255,255,0.75); margin: 0 0.7rem; font-size: 0.9rem; }
.site-footer-bottom .footer-links a:hover, .site-footer-bottom .footer-social a:hover { color: #fff; }
.site-footer-bottom .copyright { font-size: 0.85rem; padding-top: 1.8rem; border-top: 1px solid rgba(255,255,255,0.15); }
.footer-admin-link { color: rgba(255, 255, 255, 0.5) !important; font-size: 0.85rem; transition: color 0.3s ease; }
.footer-admin-link:hover { color: rgba(255, 255, 255, 0.8) !important; }
.floating-buttons-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.floating-button { display: flex; justify-content: center; align-items: center; width: 55px; height: 55px; border-radius: 50%; color: #fff; font-size: 28px; text-decoration: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); transition: all 0.3s ease; }
.floating-button:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.whatsapp-float { background-color: #25D366; } .whatsapp-float:hover { background-color: #1DAE54; }
.instagram-float { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%); }
.instagram-float:hover { filter: brightness(0.9); }

/* --- MODAL DE DETALLE DE PRODUCTO (CORREGIDO) --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(15,15,15,0.7); display: none; justify-content: center; align-items: center; z-index: 1050; opacity: 0; transition: opacity 0.3s ease-in-out; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background-color: var(--surface-color); /* Fondo blanco sólido */ padding: 30px; border-radius: var(--border-radius); box-shadow: 0 8px 25px rgba(0,0,0,0.15); width: 90%; max-width: 650px; max-height: 85vh; overflow-y: auto; position: relative; transform: scale(0.9); opacity: 0; transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; }
.modal-overlay.active .modal-content { transform: scale(1); opacity: 1; }
.modal-close-btn { position: absolute; top: 10px; right: 15px; font-size: 1.8rem; font-weight: bold; color: var(--text-muted-color); background: none; border: none; cursor: pointer; line-height: 1; padding: 5px; }
.modal-close-btn:hover { color: var(--dark-color); }
#productDetailContainer { display: grid; grid-template-columns: 1fr; gap: 20px; }
.product-detail-image-container { width: 100%; }
#productDetailContainer img.product-detail-image { width: 100%; height: auto; border-radius: var(--border-radius-sm); display: block; }
.product-detail-info { display: flex; flex-direction: column; }
#productDetailContainer h2.product-detail-name { font-family: var(--font-secondary); font-size: 2.2rem; margin-bottom: 0.5rem; }
#productDetailContainer p.product-detail-category { font-size: 0.9rem; color: var(--secondary-color); text-transform: uppercase; margin-bottom: 1rem; }
#productDetailContainer .product-detail-price { font-size: 1.9rem; font-weight: 700; margin-bottom: 1.2rem; }
#productDetailContainer .product-detail-price .price-container { font-size: 1.2em; } /* Hacer el precio más grande en el modal */
#productDetailContainer p.product-detail-description { font-size: 1rem; line-height: 1.7; color: var(--text-color); margin-bottom: 1.5rem; }
#productDetailContainer p.product-detail-stock { font-size: 0.95rem; font-weight: 600; color: var(--dark-color); margin-top: auto; padding-top: 10px; }

/* ==========================================================================
   4. LOGIN Y PANEL DE ADMIN
   ========================================================================== */
.login-container { background-color: var(--color-background-section); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-box { background-color: var(--surface-color); padding: 2.5rem; border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); width: 100%; max-width: 420px; text-align: center; border-top: 5px solid var(--primary-color); }
.login-logo { margin-bottom: 1rem; } .login-logo span { color: var(--primary-color); }
.login-title { font-family: var(--font-secondary); font-size: 2rem; margin-bottom: 0.5rem; }
.login-subtitle { font-size: 1rem; color: var(--text-muted-color); margin-bottom: 2.5rem; }
.input-group { margin-bottom: 1.5rem; text-align: left; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.input-group input, .input-group textarea, .input-group select { width: 100%; padding: 0.9rem 1rem; border: 1px solid var(--color-border); border-radius: var(--border-radius-sm); font-size: 1rem; transition: all 0.2s ease; font-family: var(--font-primary); }
.input-group input:focus, .input-group textarea:focus, .input-group select:focus { outline: none; border-color: var(--input-focus-border-color); box-shadow: var(--input-focus-box-shadow); }
.btn-admin-login { background-color: var(--primary-color); color: #fff; width: 100%; font-size: 1rem; font-weight: 600; padding: 0.9rem; border: none; border-radius: var(--border-radius-sm); }
.btn-admin-login:hover { background-color: var(--primary-color-hover); }
.back-to-site { margin-top: 1.5rem; } .back-to-site a { color: var(--text-muted-color); text-decoration: none; font-size: 0.9rem; }
.back-to-site a:hover { color: var(--primary-color); }
.admin-header { background-color: var(--surface-color); border-bottom: 1px solid var(--color-border); padding: 0.9rem 0; color: var(--text-color); }
.admin-header .logo-text-name, .admin-header .admin-panel-text { color: var(--text-color); }
.admin-header .admin-panel-text { color: var(--text-muted-color); }
.btn-admin-logout { background-color: var(--color-secondary); color: #fff; border: none; }
.btn-admin-logout:hover { background-color: var(--color-secondary-hover); }
.admin-main { background-color: var(--color-background-section); padding: 2.5rem 1rem; }
.admin-main h1 { font-family: var(--font-secondary); font-weight: 700; font-size: 2.2rem; margin-bottom: 1.5rem; text-align: center; }
.admin-main h2 { font-family: var(--font-primary); font-weight: 600; font-size: 1.5rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.75rem; margin-bottom: 1.5rem; }
.admin-tabs { display: flex; border-bottom: 1px solid var(--color-border); margin-bottom: 2rem; }
.tab-btn { background: none; border: none; padding: 1rem 1.5rem; font-size: 1rem; font-weight: 500; color: var(--text-muted-color); cursor: pointer; position: relative; transition: color 0.3s ease; }
.tab-btn::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 3px; background-color: var(--primary-color); transform: scaleX(0); transition: transform 0.3s ease; }
.tab-btn.active { color: var(--text-color); font-weight: 600; }
.tab-btn.active::after { transform: scaleX(1); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInDown 0.5s ease; }
.abm-form-section, .product-list-section { background-color: var(--surface-color); border-radius: var(--border-radius); box-shadow: var(--box-shadow); padding: 1.8rem; margin-bottom: 2rem; }
.input-group.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }
.input-group.checkbox-group input { width: auto; }
.input-group.checkbox-group label { margin-bottom: 0; }
.form-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn-form-submit { background-color: var(--primary-color); color: #fff; }
.btn-form-clear { background-color: var(--text-muted-color); color: #fff; }
.table-responsive { overflow-x: auto; }
#productsTable, #categoriesTable { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 0.9rem; }
#productsTable th, #productsTable td, #categoriesTable th, #categoriesTable td { border: 1px solid var(--color-border); padding: 0.8rem; text-align: left; vertical-align: middle; }
#productsTable th, #categoriesTable th { background-color: var(--color-background-section); font-weight: 600; }
#productsTable img { max-width: 50px; height: auto; border-radius: var(--border-radius-sm); }
.btn-edit { background-color: var(--color-secondary); color: #fff; margin-right: 0.5rem; }
.btn-edit:hover { background-color: var(--color-secondary-hover); }
.btn-delete { background-color: var(--error-color); color: #fff; }
.btn-delete:hover { background-color: #c82333; }
.admin-footer { background-color: var(--dark-color); color: rgba(255, 255, 255, 0.7); }
.login-message, .form-message, .list-message { margin-top: 1rem; font-size: 0.9rem; padding: 0.7rem 1rem; border-radius: var(--border-radius-sm); text-align: center; line-height: 1.4; }
.login-message.error, .form-message.error, .list-message.error { color: var(--error-color); background-color: #fddfe2; border: 1px solid #f5c6cb; }
.login-message.success, .form-message.success, .list-message.success { color: var(--success-color); background-color: #d1e7dd; border: 1px solid #c3e6cb; }

/* ==========================================================================
   5. ANIMACIONES Y DISEÑO RESPONSIVO
   ========================================================================== */
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 992px) { .hero-text h1 { font-size: 3rem; } .hero-text p { font-size: 1.1rem; } .about-content, .info-cards-container { grid-template-columns: 1fr; } .about-image { order: -1; } .about-text, .section-title-left { text-align: center; } .section-title-left::after { left: 50%; transform: translateX(-50%);} }
@media (max-width: 768px) { .site-header { padding: 0.7rem 0; } .main-nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background-color: var(--header-bg-color); box-shadow: 0 5px 10px rgba(0,0,0,0.1); padding: 0.5rem 0; border-top: 1px solid #eee; z-index: 999;} .main-nav.active { display: flex; } .main-nav ul { flex-direction: column; width: 100%; } .main-nav ul li { width: 100%; text-align: center; } .main-nav ul li a { padding: 0.9rem; display: block; width: 100%; border-bottom: 1px solid #f0f0f0; } .main-nav ul li a::after { display: none; } .main-nav ul li:last-child a { border-bottom: none; } .menu-toggle { display: block; } .hero-text h1 { font-size: 2.2rem; } .products-section .product-grid { grid-template-columns: 1fr; } .site-footer-bottom .footer-content { flex-direction: column; gap: 1rem; } .login-box, .admin-main { padding: 2rem 1.5rem; } .admin-header-content { flex-direction: column; gap: 0.5rem; } .admin-main h1 { font-size: 1.8rem; } .abm-form-section, .product-list-section { padding: 1.2rem; } .form-actions { flex-direction: column; } .form-actions .btn { width: 100%; } #productsTable, #categoriesTable { font-size: 0.8rem; } #productsTable th, #productsTable td, #categoriesTable th, #categoriesTable td { padding: 0.4rem; } 
    #productDetailContainer { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 480px) { .hero-text h1 { font-size: 1.8rem; } .hero-text p { font-size: 1rem; } .section-title { font-size: 2rem; } .section-title-left { font-size: 1.8rem; } }