:root {
    --primary-color: #0d3b66;       /* Azul Industrial */
    --primary-hover: #082642;
    --accent-color: #f4a261;        /* Naranja Seguridad */
    --accent-hover: #e76f51;
    --warning-color: #e9c46a;       /* Amarillo Advertencia */
    --bg-light: #f8f9fa;            /* Gris Metálico Claro */
    --bg-card: #ffffff;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --success-color: #2a9d8f;
    --danger-color: #e63946;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 8px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

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

/* TOP BAR */
.top-bar {
    background-color: #05192d;
    color: #ffffff;
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.map-link {
    color: var(--warning-color);
    text-decoration: none;
    margin-left: 5px;
    font-weight: bold;
}

.security-badge-top { color: #a8dadc; }

/* HEADER & NAVEGACIÓN */
.main-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: white; }
.logo-icon { font-size: 2rem; color: var(--accent-color); }
.brand-name { font-size: 1.3rem; letter-spacing: 0.5px; display: block; }
.brand-tagline { font-size: 0.75rem; color: #cbd5e1; display: block; }

.main-nav ul { display: flex; list-style: none; gap: 20px; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nav-link {
    color: white; text-decoration: none; font-weight: 600; font-size: 0.95rem;
    padding: 6px 12px; border-radius: var(--radius); transition: background 0.2s;
}
.nav-link:hover, .nav-link.active { background-color: rgba(255,255,255,0.15); }

/* BOTONES ADAPTADOS PARA TERRENO Y MAESTROS */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; font-size: 0.95rem; font-weight: 700;
    border-radius: var(--radius); border: none; cursor: pointer;
    transition: all 0.2s ease; text-decoration: none; min-height: 44px;
}

.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: #4a5568; color: white; }
.btn-accent { background-color: var(--accent-color); color: #000; }
.btn-accent:hover { background-color: var(--accent-hover); color: white; }
.btn-outline-light { border: 2px solid white; color: white; background: transparent; }
.btn-outline-light:hover { background: white; color: var(--primary-color); }
.btn-block { width: 100%; }
.btn-large { padding: 14px 24px; font-size: 1.05rem; }

.cart-btn { background-color: var(--accent-color); color: #000; }
.cart-badge {
    background-color: var(--danger-color); color: white;
    border-radius: 50%; padding: 2px 8px; font-size: 0.8rem; font-weight: bold;
}

/* HERO SECTION */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white; padding: 50px 0;
}
.hero-container { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.badge-hero {
    background-color: rgba(255,255,255,0.2); padding: 6px 12px;
    border-radius: 20px; font-size: 0.85rem; display: inline-block; margin-bottom: 15px;
}
.hero-content h1 { font-size: 2.3rem; line-height: 1.2; margin-bottom: 15px; }
.hero-content p { font-size: 1.1rem; margin-bottom: 25px; color: #e2e8f0; }
.hero-buttons { display: flex; gap: 15px; flex-wrap: wrap; }

.quick-info-box {
    background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2); padding: 25px; border-radius: var(--radius);
}
.quick-info-box h3 { margin-bottom: 15px; color: var(--warning-color); }

/* CATÁLOGO DE PRODUCTOS */
.catalog-section { padding: 50px 0; }
.section-header { text-align: center; margin-bottom: 30px; }
.section-header h2 { font-size: 2rem; color: var(--primary-color); }

.filter-bar { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 35px; }
.filter-btn {
    padding: 10px 16px; border: 2px solid var(--border-color); background: white;
    border-radius: 20px; cursor: pointer; font-weight: 600; transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color); color: white; border-color: var(--primary-color);
}

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; }
.product-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 20px; display: flex;
    flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.product-icon-container {
    height: 120px; background-color: var(--bg-light); border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem; color: var(--primary-color); margin-bottom: 15px;
}
.product-icon-container img { width: 72%; height: 72%; object-fit: contain; }
.product-title { font-size: 1.1rem; font-weight: bold; margin-bottom: 8px; }
.product-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 12px; }

.stock-badge {
    display: inline-block; padding: 4px 10px; font-size: 0.8rem;
    border-radius: 12px; font-weight: bold; margin-bottom: 15px;
}
.stock-badge.available { background-color: #d1fae5; color: #065f46; }
.stock-badge.heavy { background-color: #fef3c7; color: #92400e; }

.product-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.product-price { font-size: 1.3rem; font-weight: bold; color: var(--primary-color); }

/* SECCIÓN FLETES DE CARGA */
.flete-banner-section { margin: 30px 0 50px 0; }
.flete-card {
    background: #fff3cd; border: 2px dashed #ffebaa; border-left: 6px solid #ffc107;
    border-radius: var(--radius); padding: 25px; display: flex; gap: 20px; align-items: center;
}
.flete-icon { font-size: 3rem; color: #856404; }

/* SECCIÓN QUIÉNES SOMOS */
.about-section { padding: 20px 0 50px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; align-items: center; margin-bottom: 40px; }
.about-photo img {
    width: 100%; height: 280px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.about-text p { margin-bottom: 15px; color: var(--text-dark); }

.team-header { text-align: center; margin-bottom: 25px; }
.team-header h3 { color: var(--primary-color); font-size: 1.4rem; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.team-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 20px; text-align: center; box-shadow: var(--shadow-sm);
}
.team-photo-placeholder {
    width: 90px; height: 90px; border-radius: 50%; background: var(--bg-light);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 12px auto;
    font-size: 2.2rem; color: var(--primary-color); border: 2px dashed var(--border-color);
}
.team-card h4 { font-size: 1rem; margin-bottom: 4px; }
.team-card p { font-size: 0.85rem; color: var(--text-muted); }

/* UBICACIÓN */
.location-section {
    background: white; border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 30px; margin-bottom: 50px;
}
.location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.location-map-placeholder {
    height: 220px; background: #e2e8f0; border: 2px dashed #cbd5e1;
    border-radius: var(--radius); display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 10px; color: var(--text-muted);
}
.location-map-placeholder i { font-size: 3rem; color: var(--primary-color); }

/* MODALES Y SEGURIDAD */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
.modal-card {
    background: white; width: 90%; max-width: 500px; padding: 30px;
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    position: relative; max-height: 90vh; overflow-y: auto;
}
.cart-modal-card { max-width: 650px; }
.modal-close {
    position: absolute; top: 15px; right: 20px; font-size: 1.8rem;
    background: none; border: none; cursor: pointer; color: var(--text-muted);
}

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 6px; font-size: 0.9rem; }
.form-control {
    width: 100%; padding: 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius); font-size: 1rem;
}
.error-msg { color: var(--danger-color); font-size: 0.8rem; margin-top: 4px; display: block; }
.security-notice {
    background: #e0f2fe; color: #0369a1; padding: 10px;
    border-radius: var(--radius); font-size: 0.82rem; margin-bottom: 20px;
}

.cart-items-list { max-height: 220px; overflow-y: auto; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.cart-item-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.cart-qty-btn { background: #e2e8f0; border: none; width: 28px; height: 28px; border-radius: 4px; cursor: pointer; font-weight: bold; }

.delivery-options, .payment-section { background: var(--bg-light); padding: 15px; border-radius: var(--radius); margin-bottom: 15px; }
.radio-option, .pay-method { display: block; margin-top: 8px; cursor: pointer; font-size: 0.9rem; }

.flete-alert {
    background-color: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
    padding: 12px; border-radius: var(--radius); display: flex; gap: 10px;
    font-size: 0.85rem; margin-bottom: 15px;
}

.price-breakdown { margin: 15px 0; }
.price-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.total-row { font-size: 1.2rem; color: var(--primary-color); border-top: 2px solid var(--border-color); padding-top: 8px; }

.security-seal { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-bottom: 15px; }

.toast {
    position: fixed; bottom: 20px; right: 20px; background: #1e293b; color: white;
    padding: 14px 20px; border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 2000;
}
.hidden { display: none !important; }
.main-footer { background: #0f172a; color: #94a3b8; text-align: center; padding: 25px 0; font-size: 0.9rem; }

/* FLETEROS REALES */
.flete-driver-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0; }
.flete-driver-card {
    background: white; border: 1px solid #ffc107; border-radius: var(--radius);
    padding: 10px 14px; display: flex; flex-direction: column; gap: 3px;
}
.flete-driver-name { font-weight: 700; font-size: 0.9rem; color: #856404; }
.flete-driver-meta { font-size: 0.78rem; color: var(--text-muted); }
.flete-driver-card .flete-phone {
    border: none; padding: 0; background: none; color: var(--primary-color);
    font-size: 0.85rem; margin-top: 2px; justify-content: flex-start;
}
.flete-driver-card .flete-phone:hover { text-decoration: underline; background: none; color: var(--primary-hover); }

/* TABLA DE CONTACTOS REALES */
.contact-table { margin: 18px 0; border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; }
.contact-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; padding: 8px 12px; font-size: 0.9rem; align-items: center; }
.contact-row:nth-child(even) { background: var(--bg-light); }
.contact-row-header { font-weight: 700; background: var(--primary-color); color: white; font-size: 0.8rem; }
.contact-row a { color: var(--primary-color); text-decoration: none; }
.contact-row a:hover { text-decoration: underline; }
.contact-emails { margin-bottom: 16px; }
.contact-emails p { font-size: 0.9rem; margin-bottom: 6px; }
.contact-emails a { color: var(--primary-color); }

@media (max-width: 480px) {
    .contact-row { grid-template-columns: 1fr; gap: 2px; padding: 10px 12px; }
    .contact-row-header { display: none; }
}

/* BOTONES DOBLES EN PRODUCTOS (Cotizar + Agregar) */
.product-btn-group { display: flex; gap: 8px; }
.btn-outline-quote {
    background: white; border: 2px solid var(--primary-color); color: var(--primary-color);
    padding: 10px 12px; min-width: 44px;
}
.btn-outline-quote:hover { background: var(--primary-color); color: white; }

/* MÓDULO DE COTIZACIONES */
.quotes-adding-hint {
    background: #e0f2fe; color: #0369a1; padding: 10px 14px; border-radius: var(--radius);
    font-size: 0.85rem; margin-top: 10px;
}
.quotes-guest-hint {
    background: #fef3c7; color: #92400e; padding: 10px 14px; border-radius: var(--radius);
    font-size: 0.82rem; margin-top: 10px;
}
.new-quote-form { display: flex; gap: 10px; margin: 18px 0; }
.new-quote-form .form-control { flex: 1; }
.quotes-list { display: flex; flex-direction: column; gap: 14px; max-height: 55vh; overflow-y: auto; }
.quote-card {
    border: 1px solid var(--border-color); border-radius: var(--radius); padding: 14px 16px;
    background: var(--bg-light);
}
.quote-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.quote-card-header h4 { font-size: 1rem; margin-bottom: 2px; }
.quote-card-meta { font-size: 0.78rem; color: var(--text-muted); }
.quote-icon-btn {
    background: none; border: none; color: var(--danger-color); cursor: pointer;
    font-size: 0.95rem; padding: 4px 8px; flex-shrink: 0;
}
.quote-icon-btn:hover { color: #a01c28; }
.quote-items { margin: 10px 0; border-top: 1px dashed var(--border-color); padding-top: 8px; }
.quote-item-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; padding: 3px 0; }
.quote-item-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 6px; }
.quote-item-remove:hover { color: var(--danger-color); }
.quote-card-actions { margin-top: 10px; }
.quote-card-actions .btn { width: 100%; }
.quote-card-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* MIS PEDIDOS (historial + pendientes) */
.orders-section-title { margin: 18px 0 10px 0; font-size: 1rem; color: var(--primary-color); }
.orders-list { display: flex; flex-direction: column; gap: 12px; max-height: 40vh; overflow-y: auto; margin-bottom: 18px; }
.order-card { border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px 14px; background: var(--bg-light); }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-date { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.order-status { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.order-status-pending { background: #fef3c7; color: #92400e; }
.order-status-confirmed { background: #d1fae5; color: #065f46; }
.order-status-cancelled { background: #fee2e2; color: #991b1b; }
.order-items { font-size: 0.85rem; margin-bottom: 8px; }
.order-item-row { padding: 2px 0; color: var(--text-dark); }
.order-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

/* DETALLES DE PAGO */
.pay-method-coming-soon {
    display: flex; align-items: center; gap: 10px; padding: 8px 4px;
    color: var(--text-muted); font-size: 0.9rem; opacity: 0.75;
}
.transfer-details {
    background: #e0f2fe; border: 1px solid #7dd3fc; border-radius: var(--radius);
    padding: 12px 14px; margin-top: 10px; font-size: 0.85rem; color: #075985;
}
.transfer-details p { margin-top: 4px; line-height: 1.5; }
.transfer-details a { color: #0369a1; font-weight: 600; }
.flete-numbers-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
    color: #991b1b; font-weight: 700; font-size: 0.85rem; text-decoration: none;
}
.flete-numbers-link:hover { text-decoration: underline; }

/* SELECTOR DE CANTIDAD EN PRODUCTO */
.product-qty-control {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 12px; background: var(--bg-light); border-radius: var(--radius); padding: 6px;
}
.product-qty-btn {
    width: 30px; height: 30px; border: none; background: white; border-radius: 6px;
    font-size: 1.1rem; font-weight: bold; color: var(--primary-color); cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.product-qty-btn:hover { background: var(--primary-color); color: white; }
.product-qty-value { font-weight: 700; min-width: 24px; text-align: center; }

/* DIRECCIÓN PROPIA DE BODEGA EN SU TARJETA */
.inventory-address {
    display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 4px;
}
.hours-closed { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; }

/* LOGO */
.logo-icon-img { border-radius: 6px; }

/* FOTO DE FACHADA EN HERO */
.hero-photo-frame {
    position: relative; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-md); min-height: 260px; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
}
.hero-photo-frame img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; display: block; }
.hero-photo-frame.img-fallback img { display: none; }
.hero-photo-frame.img-fallback::before {
    content: "\f54f"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    display: flex; align-items: center; justify-content: center; min-height: 260px;
    font-size: 3rem; color: rgba(255,255,255,0.4);
}
.hero-photo-caption {
    position: absolute; bottom: 0; left: 0; right: 0; background: rgba(5,25,45,0.85);
    color: white; padding: 10px 14px; font-size: 0.85rem;
}
.quick-info-box--wide { margin-top: 30px; text-align: center; }
.quick-info-box--wide p { margin: 4px 0; }

/* DIVISIÓN TIENDA / BODEGA */
.inventory-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.inventory-card {
    display: block; text-align: left; background: var(--bg-card); border: 2px solid var(--border-color);
    border-radius: var(--radius); overflow: hidden; cursor: pointer; padding: 0;
    transition: border-color 0.2s, transform 0.2s; box-shadow: var(--shadow-sm);
}
.inventory-card:hover { transform: translateY(-2px); }
.inventory-card.active { border-color: var(--primary-color); box-shadow: var(--shadow-md); }
.inventory-card-img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--bg-light); }
.inventory-card-body { padding: 16px 18px; }
.inventory-card-body i { font-size: 1.6rem; color: var(--primary-color); margin-bottom: 6px; display: block; }
.inventory-card-body h3 { font-size: 1.1rem; margin-bottom: 4px; }
.inventory-card-body p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.inventory-card.active .inventory-card-body i { color: var(--accent-color); }

.empty-inventory-msg { text-align: center; color: var(--text-muted); padding: 30px 0; }

/* BÚSQUEDA DE PRODUCTOS */
.catalog-search {
    position: relative; max-width: 500px; margin: 0 auto 25px auto;
}
.catalog-search i {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 1rem; pointer-events: none;
}
.catalog-search input {
    width: 100%; padding: 13px 16px 13px 44px; border: 2px solid var(--border-color);
    border-radius: 24px; font-size: 0.95rem; transition: border-color 0.2s;
}
.catalog-search input:focus { outline: none; border-color: var(--primary-color); }

/* NIVEL 2: TARJETAS DE CATEGORÍA ESTILO SODIMAC */
.category-tiles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px; margin-bottom: 30px;
}
.category-tile {
    background: var(--bg-card); border: 2px solid var(--border-color); border-radius: var(--radius);
    padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; text-align: center; transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.category-tile:hover { border-color: var(--primary-color); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.category-tile i { font-size: 2rem; color: var(--primary-color); margin-bottom: 4px; }
.category-tile-label { font-weight: 700; font-size: 0.92rem; }
.category-tile-count { font-size: 0.75rem; color: var(--text-muted); }

.back-to-categories { margin-bottom: 20px; }

/* BADGE: PRODUCTO DE BODEGA MOSTRADO EN SALA DE VENTAS */
.bodega-cross-badge {
    position: absolute; top: 8px; right: 8px; background: #92400e; color: white;
    font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 4px;
}
.product-icon-container { position: relative; }

/* SECCIÓN NUESTRA HISTORIA */
.history-section { padding: 20px 0 50px 0; }
.history-content {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 30px; box-shadow: var(--shadow-sm); max-width: 900px; margin: 0 auto;
}
.history-content p { margin-bottom: 14px; color: var(--text-dark); }
.history-content p:last-child { margin-bottom: 0; }

/* TELÉFONOS DE FLETE */
.flete-phone-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.flete-phone {
    display: inline-flex; align-items: center; gap: 6px; background: white;
    border: 1px solid #ffc107; color: #856404; padding: 6px 12px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 600; text-decoration: none;
}
.flete-phone:hover { background: #ffc107; color: #000; }
.flete-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }

/* AUTH MODAL: TABS, GOOGLE BUTTON, ESTADO LOGUEADO */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
    flex: 1; padding: 10px; border: none; background: var(--bg-light); border-radius: var(--radius);
    font-weight: 700; cursor: pointer; color: var(--text-muted);
}
.auth-tab.active { background: var(--primary-color); color: white; }
.google-btn { border-color: var(--border-color); color: var(--text-dark); margin-bottom: 14px; }
.google-btn:hover { background: var(--bg-light); color: var(--text-dark); }
.auth-divider { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; position: relative; }
.auth-divider::before, .auth-divider::after {
    content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border-color);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-user-email { font-weight: 600; margin-bottom: 15px; color: var(--text-muted); }
.profile-notice {
    background: #e0f2fe; color: #0369a1; padding: 12px; border-radius: var(--radius);
    font-size: 0.85rem; margin-bottom: 18px;
}

@media (max-width: 768px) {
    .hero-container, .location-grid, .about-grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
    .inventory-switch { grid-template-columns: 1fr; }
    .header-actions .cart-title, .header-actions .btn-text { display: none; }
    .header-actions .btn { padding: 10px 12px; }
}/* AVISO: PÁGINA EN CONSTRUCCIÓN / INVENTARIO NO ACTUALIZADO */
.construction-banner {
    background: repeating-linear-gradient(45deg, #fbbf24, #fbbf24 12px, #1e1e1e 12px, #1e1e1e 24px);
    padding: 3px 0;
}
.construction-banner-content {
    background: #fef3c7; color: #7c2d12; padding: 10px 16px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    text-align: center; font-weight: 700; font-size: 0.9rem;
}
.construction-banner-content i { color: #b45309; font-size: 1.1rem; flex-shrink: 0; }

/* CATÁLOGO CONECTADO AL INVENTARIO (SEGI) */
.catalog-status { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 18px 0 6px; min-height: 1.2em; }
.load-more-wrap { text-align: center; margin: 6px 0 30px; }
.product-title { word-break: break-word; }
.product-sku { font-size: 0.75rem; color: var(--text-muted); margin: -4px 0 8px; letter-spacing: 0.02em; }
.stock-badge.consult { background-color: #e9ecef; color: #495057; }
.product-sale-rule {
    font-size: 0.8rem; color: #92400e; background: #fef3c7; border-radius: 6px;
    padding: 4px 8px; margin-bottom: 10px; align-self: flex-start;
}
.product-price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.price-unit { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
.price-old { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; font-weight: 400; flex-basis: 100%; }
.product-new-badge {
    position: absolute; top: 8px; left: 8px; background: var(--accent-hover); color: #fff;
    font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 10px;
}
.cart-item-rule { font-size: 0.75rem; color: #92400e; }

/* Precio y botones: nunca se pisan; si no caben, los botones bajan a otra línea */
.product-bottom { flex-wrap: wrap; gap: 10px; }
.product-price { min-width: 0; }
.product-btn-group { flex-shrink: 0; margin-left: auto; }

/* Aviso superior una vez lanzado el catálogo con productos de SEGI */
.construction-banner.is-live { background: var(--primary-color); padding: 0; }
.construction-banner.is-live .construction-banner-content { background: #e0f2fe; color: #0c4a6e; font-weight: 600; }
.construction-banner.is-live .construction-banner-content i { color: #0369a1; }


/* ===== Collage portada + Tour virtual (Ferretería Collao) =====
   Pegar al final de styles.css (o enlazar como archivo aparte). */

.hero-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.collage-tile {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-md);
    color: #fff;
    text-decoration: none;
    font: inherit;
    text-align: left;
}

.collage-tile img,
.collage-tile video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.collage-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 25, 45, 0.85);
    color: #fff;
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.3;
}

.collage-caption i { margin-right: 4px; color: var(--accent-color); }

a.collage-tile,
button.collage-tile { cursor: pointer; }

a.collage-tile:hover img,
button.collage-tile:hover video,
button.collage-tile:hover img { transform: scale(1.05); }

a.collage-tile:focus-visible,
button.collage-tile:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* --- Cuadro del tour --- */
.collage-tour { border-color: rgba(244, 162, 97, 0.7); }

.tour-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: #e8f23a;
    color: #141414;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    padding: 4px 8px;
    transform: rotate(-2deg);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.tour-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    padding-left: 4px;
    box-shadow: 0 0 0 0 rgba(244, 162, 97, 0.6);
    animation: tourPulse 2.2s infinite;
}

.collage-tour:hover .tour-play { background: var(--accent-hover); }

@keyframes tourPulse {
    0%   { box-shadow: 0 0 0 0 rgba(244, 162, 97, 0.6); }
    70%  { box-shadow: 0 0 0 16px rgba(244, 162, 97, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 162, 97, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .tour-play { animation: none; }
    .collage-tile img, .collage-tile video { transition: none; }
}

@media (max-width: 480px) {
    .hero-collage { gap: 8px; }
    .collage-caption { font-size: 0.72rem; padding: 6px 8px; }
    .tour-play { width: 48px; height: 48px; margin: -24px 0 0 -24px; font-size: 1.1rem; }
}

/* --- Ventana del tour --- */
.tour-modal {
    margin: auto;          /* centra la ventana aunque el sitio use * { margin: 0 } */
    border: 0;
    padding: 0;
    width: min(94vw, calc(72vh * 9 / 16));
    min-width: min(94vw, 300px);
    max-height: 96vh;
    overflow: hidden;
    border-radius: 12px;
    background: #0b1e33;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tour-modal::backdrop {
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.tour-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px 10px 14px;
    font-weight: 700;
    font-size: 0.95rem;
}

.tour-modal-head small { display: block; font-weight: 400; color: #c8d6e6; font-size: 0.78rem; }

.tour-close {
    flex: none;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.tour-close:hover { background: rgba(255, 255, 255, 0.22); }

.tour-video {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 72vh;
    background: #000;
    object-fit: contain;
}

.tour-chapters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 12px 12px;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
}

.tour-chapters button {
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-radius: 999px;
    padding: 6px 11px;
    font: inherit;
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
}

.tour-chapters button b { color: var(--accent-color); margin-right: 4px; }

.tour-chapters button.is-active {
    background: #e8f23a;
    border-color: #e8f23a;
    color: #141414;
}

.tour-chapters button.is-active b { color: #141414; }
