/* public/style.css */

/* =========================================
   1. VARIABLES Y RESET
   ========================================= */
:root {
    --bg-body: #f5f5f7;
    --bg-card: #ffffff;
    --text-main: #1d1d1f;
    --text-light: #86868b;
    --accent: #0071e3; /* Apple Blue */
    --accent-hover: #0077ed;
    --danger: #ff3b30;
    --success: #34c759;
    --border: #d2d2d7;
    --sidebar-width: 260px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-stack: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-stack); }
body { background-color: var(--bg-body); color: var(--text-main); overflow-x: hidden; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   2. COMPONENTES GLOBALES (FRONT)
   ========================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }

.btn-primary { 
    background: var(--accent); color: white; padding: 12px 24px; 
    border-radius: 99px; font-size: 0.95rem; font-weight: 500; border: none; 
    cursor: pointer; transition: var(--transition); display: inline-flex; 
    align-items: center; justify-content: center; gap: 8px; 
}
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.02); box-shadow: 0 5px 15px rgba(0, 113, 227, 0.3); }
.btn-primary:disabled { background: var(--text-light); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary { 
    background: #e5e5ea; color: var(--text-main); padding: 10px 20px; 
    border-radius: 99px; border: none; cursor: pointer; font-weight: 500; 
}
.btn-secondary:hover { background: #d1d1d6; }

.hidden { display: none !important; }

.toast { 
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); 
    background: rgba(0,0,0,0.8); color: white; padding: 12px 24px; border-radius: 50px; 
    z-index: 5000; transition: transform 0.3s; display: flex; align-items: center; gap: 10px; 
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* =========================================
   3. TIENDA: HEADER
   ========================================= */
header { 
    position: sticky; top: 0; background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); 
    z-index: 1000; border-bottom: 1px solid rgba(0,0,0,0.05); 
    height: 60px; display: flex; align-items: center; 
}
.navbar { 
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; 
    display: flex; justify-content: space-between; align-items: center; 
}
.logo { font-weight: 600; font-size: 1.3rem; letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 25px; }
.nav-links a { font-size: 0.9rem; color: var(--text-light); transition: 0.2s; }
.nav-links a:hover { color: var(--text-main); }
.cart-icon-wrap { position: relative; cursor: pointer; padding: 5px; }
.cart-count { 
    position: absolute; top: -2px; right: -5px; background: var(--danger); color: white; 
    font-size: 0.7rem; width: 16px; height: 16px; border-radius: 50%; 
    display: flex; justify-content: center; align-items: center; font-weight: 600; 
}

/* =========================================
   4. HERO BANNER (ANIMADO)
   ========================================= */
.hero { position: relative; width: 100%; background: #000; overflow: hidden; margin-bottom: 40px; height: 60vh; }
.hero[data-height="large"] { height: 90vh; }
.hero[data-height="medium"] { height: 60vh; }
.hero[data-height="small"] { height: 40vh; }

.hero-slide { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    opacity: 0; transition: opacity 1s ease-in-out; 
    display: flex; align-items: center; justify-content: center; 
}
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide img { 
    width: 100%; height: 100%; object-fit: cover; 
    position: absolute; top: 0; left: 0; filter: brightness(0.85); 
}
.hero-slide img.blur-bg { filter: blur(3px) brightness(0.7); transform: scale(1.02); }

.hero-content { 
    position: relative; z-index: 2; text-align: center; padding: 20px; max-width: 800px;
    opacity: 0; transition: all var(--hero-speed, 1s) ease-out; 
}
.hero-slide.active .hero-content { opacity: 1; }

.hero-content h2 { margin-bottom: 10px; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.hero-content h2.small { font-size: 2rem; }
.hero-content h2.medium { font-size: 3rem; }
.hero-content h2.large { font-size: 4rem; }
.hero-content h2.xlarge { font-size: 5rem; }

@media (max-width: 768px) { .hero-content h2.large, .hero-content h2.xlarge { font-size: 3rem; } .hero[data-height="large"] { height: 70vh; } }

/* =========================================
   5. ANIMACIONES GENÉRICAS
   ========================================= */
.anim-slide-up { transform: translateY(30px); }
.active .anim-slide-up, .mkt-msg.anim-slide-up.active { transform: translateY(0); }
.mkt-msg.anim-slide-up.exiting { transform: translateY(-30px); }

.anim-slide-left { transform: translateX(50px); }
.active .anim-slide-left, .mkt-msg.anim-slide-left.active { transform: translateX(0); }
.mkt-msg.anim-slide-left.exiting { transform: translateX(-50px); }

.anim-fade { opacity: 0; }
.active .anim-fade, .mkt-msg.anim-fade.active { opacity: 1; }
.mkt-msg.anim-fade.exiting { opacity: 0; }

.anim-zoom { transform: scale(0.8); opacity: 0; }
.active .anim-zoom, .mkt-msg.anim-zoom.active { transform: scale(1); opacity: 1; }
.mkt-msg.anim-zoom.exiting { transform: scale(1.2); opacity: 0; }

/* =========================================
   6. TIENDA: PRODUCTOS & PRECIOS
   ========================================= */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; padding-bottom: 60px; }
.product-card { 
    background: var(--bg-card); border-radius: 18px; padding: 25px; text-align: center; 
    transition: 0.3s; cursor: pointer; box-shadow: var(--shadow-sm); 
    display: flex; flex-direction: column; justify-content: space-between; 
    height: 100%; border: 1px solid transparent; position: relative; overflow: hidden; 
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(0,0,0,0.05); }
.product-card img { height: 200px; width: 100%; object-fit: contain; margin-bottom: 20px; transition: transform 0.4s; }
.product-card:hover img { transform: scale(1.05); }

.price-container { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.old-price { text-decoration: line-through; color: var(--text-light); font-size: 0.9rem; }
.current-price { font-weight: 600; font-size: 1.1rem; color: var(--text-main); }
.discount-badge { 
    position: absolute; top: 15px; left: 15px; background: var(--danger); 
    color: white; font-size: 0.8rem; font-weight: 700; padding: 4px 8px; 
    border-radius: 6px; z-index: 10; 
}
.category-tag { 
    font-size: 0.75rem; color: var(--accent); background: #f0f8ff; 
    padding: 4px 8px; border-radius: 10px; display: inline-block; margin-bottom: 8px; 
}

/* FOOTER */
footer { background: #fff; padding: 60px 20px 20px; margin-top: 60px; border-top: 1px solid #e5e5e5; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.footer-col h4 { margin-bottom: 20px; font-size: 0.9rem; font-weight: 600; text-transform: uppercase; color: var(--text-main); }
.footer-col ul li { margin-bottom: 12px; color: var(--text-light); }
.footer-col ul li a { color: var(--text-light); font-size: 0.9rem; transition: 0.2s; }
.footer-col ul li a:hover { color: var(--text-main); text-decoration: underline; }
.footer-col ul li i { margin-right: 8px; color: var(--accent); width: 20px; text-align: center; }
.social-icons { display: flex; gap: 15px; }
.social-link { 
    width: 36px; height: 36px; border-radius: 50%; background: #f5f5f7; 
    display: flex; align-items: center; justify-content: center; 
    color: var(--text-light); font-size: 1.1rem; transition: 0.2s; 
}
.social-link:hover { background: var(--accent); color: white; transform: translateY(-3px); }
.footer-bottom { text-align: center; margin-top: 50px; padding-top: 20px; border-top: 1px solid #e5e5e5; font-size: 0.8rem; color: var(--text-light); }

/* =========================================
   7. MODALES (CLIENTE)
   ========================================= */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); z-index: 2000; 
    display: flex; justify-content: center; align-items: center; 
    opacity: 0; pointer-events: none; transition: 0.3s ease; 
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-content { 
    background: white; width: 90%; max-width: 950px; border-radius: 24px; padding: 0; 
    display: flex; overflow: hidden; transform: scale(0.95); 
    transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); 
    box-shadow: var(--shadow-lg); max-height: 90vh; 
}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-image-col { flex: 1.2; background: #fbfbfd; display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; }
.modal-image-col img { max-height: 450px; width: auto; object-fit: contain; mix-blend-mode: multiply; }
.modal-info-col { flex: 1; padding: 50px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow-y: auto; }
.close-modal { position: absolute; top: 20px; right: 25px; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--text-light); z-index: 10; }
.modal-title { font-size: 2.2rem; font-weight: 700; margin-bottom: 10px; line-height: 1.1; }
.modal-desc { color: var(--text-light); line-height: 1.6; margin-bottom: 40px; font-size: 1rem; white-space: pre-wrap; }
.modal-actions .btn-primary { width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 12px; }

/* =========================================
   8. CARRITO LATERAL & CHECKOUT
   ========================================= */
.cart-sidebar { 
    position: fixed; top: 0; right: -420px; width: 420px; max-width: 100vw; 
    height: 100%; max-height: 100vh; background: white; z-index: 3000; 
    box-shadow: -10px 0 40px rgba(0,0,0,0.1); 
    transition: right 0.5s cubic-bezier(0.19, 1, 0.22, 1); 
    display: flex; flex-direction: column; 
}
.cart-sidebar.active { right: 0; }
.cart-header { padding: 25px; border-bottom: 1px solid #f5f5f7; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.cart-header h3 { font-weight: 700; font-size: 1.4rem; }
.close-cart { cursor: pointer; font-size: 1.8rem; line-height: 1; color: var(--text-light); }

.cart-body, .checkout-container { 
    flex: 1; overflow-y: auto; overflow-x: hidden; padding: 25px; 
    scrollbar-width: thin; scrollbar-color: #d1d1d6 transparent; 
    background: #fff; animation: fadeIn 0.3s ease; 
}
.cart-body::-webkit-scrollbar, .checkout-container::-webkit-scrollbar { width: 6px; }
.cart-body::-webkit-scrollbar-thumb, .checkout-container::-webkit-scrollbar-thumb { background-color: #d1d1d6; border-radius: 10px; }

.cart-item { display: flex; gap: 20px; margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px solid #f5f5f7; animation: fadeIn 0.3s ease; }
.cart-item img { width: 80px; height: 80px; object-fit: contain; border-radius: 12px; background: #fbfbfd; padding: 5px; border: 1px solid #f0f0f5; }
.cart-footer { padding: 30px; border-top: 1px solid #e5e5e5; background: #fbfbfd; flex-shrink: 0; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.4rem; font-weight: 700; margin-top: 15px; padding-top: 15px; border-top: 1px solid #ddd; color: var(--text-main); }
.btn-checkout { width: 100%; background: var(--text-main); color: white; border: none; padding: 18px; border-radius: 14px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: 0.2s; }

/* Formulario Checkout */
.checkout-container h4 { font-size: 0.95rem; text-transform: uppercase; color: #86868b; font-weight: 600; letter-spacing: 0.5px; margin: 20px 0 12px 0; padding-bottom: 5px; border-bottom: 1px solid #f5f5f7; }

/* Inputs del Checkout (Compartidos visualmente con admin, pero definidos aquí para el front) */
.checkout-container .admin-input { 
    width: 100%; padding: 12px 14px; margin-bottom: 12px; 
    border: 1px solid #e5e5e5; background: #fbfbfd; border-radius: 12px; 
    font-size: 0.95rem; color: #1d1d1f; transition: all 0.2s ease; outline: none; 
}
.checkout-container .admin-input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1); }

.checkout-container select.admin-input { 
    appearance: none; -webkit-appearance: none; -moz-appearance: none; 
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230071e3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); 
    background-repeat: no-repeat; background-position: right 15px top 50%; background-size: 12px auto; padding-right: 40px; cursor: pointer; 
}
.checkout-container select.admin-input:disabled { background-color: #f5f5f7; color: #bbb; cursor: not-allowed; opacity: 0.7; }

.checkout-container label { 
    display: flex !important; align-items: center; gap: 12px; padding: 14px; 
    background: #fff; border: 1px solid #d2d2d7; border-radius: 12px; 
    margin-bottom: 10px; cursor: pointer; transition: 0.2s; position: relative; 
}
.checkout-container label:hover { border-color: #86868b; background: #fafafa; }
.checkout-container label:has(input:checked) { border-color: var(--accent); background: #f0f8ff; box-shadow: 0 2px 8px rgba(0, 113, 227, 0.15); }
.checkout-container label b { font-size: 0.95rem; color: #1d1d1f; }

#addressFields { background: #fafafa; padding: 15px; border-radius: 12px; border: 1px solid #e5e5e5; margin-top: 15px; animation: slideDown 0.3s ease; }
#btnQuote { margin-top: 5px; background: #e5e5ea; color: #1d1d1f; border-radius: 8px; width: 100%; padding: 10px; border: none; cursor: pointer; font-weight: 500; }
#btnQuote:hover { background: #d1d1d6; }
.btn-back-cart { width: 100%; margin-top: 15px; padding: 12px; background: transparent; border: none; color: #86868b; font-weight: 500; font-size: 0.9rem; cursor: pointer; border-radius: 10px; transition: 0.2s; }
.btn-back-cart:hover { background: #f5f5f7; color: #1d1d1f; }

/* =========================================
   9. MARKETING (Top Bar & Popup)
   ========================================= */
.marketing-top-bar { width: 100%; height: 40px; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 500; z-index: 2000; transition: background-color 0.3s; }
.mkt-msg { position: absolute; width: 100%; text-align: center; opacity: 0; pointer-events: none; transition: all var(--anim-speed, 0.5s) ease-in-out; }
.mkt-msg.active { opacity: 1; transform: translateY(0); pointer-events: auto; }

.marketing-popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.marketing-popup-overlay.active { opacity: 1; pointer-events: all; }
.marketing-popup-content { position: relative; max-width: 500px; width: 90%; background: transparent; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.3); transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.marketing-popup-overlay.active .marketing-popup-content { transform: scale(1); }
.marketing-popup-content img { width: 100%; display: block; }
.mkt-close { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.8); color: #333; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: 0.2s; z-index: 10; }
.mkt-close:hover { background: white; color: red; }

/* =========================================
   10. NAVEGACIÓN LATERAL (Menú)
   ========================================= */
.right-nav-sidebar { 
    position: fixed; top: 0; right: -300px; width: 300px; height: 100%; 
    background: white; z-index: 3001; box-shadow: -5px 0 15px rgba(0,0,0,0.1); 
    transition: right 0.3s ease; display: flex; flex-direction: column; 
}
.right-nav-sidebar.active { right: 0; }

.nav-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.nav-body { padding: 20px; overflow-y: auto; }

.nav-item-group { margin-bottom: 15px; }
.nav-main-item { display: block; font-weight: 600; font-size: 1.1rem; margin-bottom: 5px; color: #1d1d1f; }
.nav-sub-item { display: block; padding-left: 15px; color: #666; font-size: 0.95rem; margin-bottom: 3px; }
.nav-sub-item:hover { color:var(--accent); }

/* Página Nosotros - Carrusel */
.about-carousel-wrap { width: 100%; overflow: hidden; position: relative; margin-top: 20px; }
.about-carousel-track { display: flex; gap: 15px; width: calc(250px * 12); animation: scrollInfinite 30s linear infinite; }
.about-slide { width: 250px; height: 350px; flex-shrink: 0; border-radius: 12px; overflow: hidden; }
.about-slide img { width: 100%; height: 100%; object-fit: cover; }
@keyframes scrollInfinite { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-250px * 6)); } }

/* =========================================
   11. RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .cart-sidebar { width: 100%; right: -100%; }
    .nav-links { display: none; } 
    .menu-toggle { display: block !important; }
}
