/* CarneOnline.cl · GrupoNEXT SpA */
:root {
    --rojo: #c41e3a;
    --rojo-osc: #8b1428;
    --rojo-claro: #fdecef;
    --gris: #f5f5f5;
    --texto: #2b2b2b;
}
body { color: var(--texto); background: #fff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
a { color: var(--rojo); }
a:hover { color: var(--rojo-osc); }

/* Botones */
.btn-rojo { background: var(--rojo); border-color: var(--rojo); color: #fff; font-weight: 600; }
.btn-rojo:hover, .btn-rojo:focus { background: var(--rojo-osc); border-color: var(--rojo-osc); color: #fff; }
.btn-rojo:disabled { background: #b9b9b9; border-color: #b9b9b9; }
.btn-outline-rojo { border-color: var(--rojo); color: var(--rojo); font-weight: 600; }
.btn-outline-rojo:hover { background: var(--rojo); color: #fff; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--rojo); box-shadow: 0 0 0 .2rem rgba(196, 30, 58, .2); }
.form-check-input:checked { background-color: var(--rojo); border-color: var(--rojo); }
.pagination .page-link { color: var(--rojo); }
.pagination .active .page-link { background: var(--rojo); border-color: var(--rojo); color: #fff; }

/* Navbar tienda */
.navbar-co { background: linear-gradient(135deg, var(--rojo), var(--rojo-osc)); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.navbar-co .navbar-brand { color: #fff; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.navbar-co .nav-link { color: rgba(255,255,255,.9); font-weight: 500; }
.navbar-co .nav-link:hover, .navbar-co .nav-link.active { color: #fff; }
.navbar-co .navbar-toggler { border-color: rgba(255,255,255,.6); }
.navbar-co .navbar-toggler-icon { filter: invert(1); }
.cart-link { position: relative; }
.cart-badge { position: absolute; top: 0; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: var(--rojo); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Hero y secciones */
.hero { background: linear-gradient(135deg, var(--rojo), var(--rojo-osc)); color: #fff; padding: 64px 0; text-align: center; }
.hero h1 { font-weight: 800; font-size: clamp(2rem, 6vw, 3.2rem); }
.section { padding: 48px 0; }
.section.alt { background: var(--gris); }
.section-title { color: var(--rojo); font-weight: 800; text-align: center; margin-bottom: 8px; }
.section-sub { color: #666; text-align: center; margin-bottom: 28px; }
.feature { background: #fff; border-radius: 12px; padding: 22px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.08); height: 100%; }
.feature i { font-size: 34px; color: var(--rojo); margin-bottom: 10px; }

/* Tarjetas */
.producto-card, .pack-card { border: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.1); transition: transform .2s, box-shadow .2s; }
.producto-card:hover, .pack-card:hover { transform: translateY(-4px); box-shadow: 0 8px 18px rgba(0,0,0,.15); }
.producto-img { position: relative; height: 170px; background: linear-gradient(135deg, var(--rojo), var(--rojo-osc)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 44px; overflow: hidden; }
.producto-img img { width: 100%; height: 100%; object-fit: cover; }
.pack-head { position: relative; background: linear-gradient(135deg, var(--rojo), var(--rojo-osc)); color: #fff; padding: 18px; text-align: center; min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.pack-head i { font-size: 30px; }
.pack-head img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; }
.pack-items { padding-left: 1.1rem; margin-bottom: 12px; }
.precio { color: var(--rojo); font-weight: 800; font-size: 1.15rem; }
.precio small { color: #888; font-weight: 500; font-size: .75rem; }
.ribbon { position: absolute; top: 10px; right: 10px; background: #222; color: #fff; padding: 3px 10px; font-size: 12px; border-radius: 12px; }

/* Footer */
.footer-co { background: #1a1a1a; color: #ccc; padding: 44px 0 0; margin-top: 0; }
.footer-co h5 { color: #ff6b81; font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.footer-co a { color: #ccc; text-decoration: none; }
.footer-co a:hover { color: #fff; }
.footer-co .fbottom { border-top: 1px solid #333; margin-top: 28px; padding: 16px 0; font-size: 13px; color: #999; text-align: center; }
.chip { display: inline-block; background: #333; color: #ddd; border-radius: 6px; padding: 5px 10px; font-size: 12px; margin: 0 6px 6px 0; }

/* Autenticación */
.auth-body { background: linear-gradient(135deg, var(--rojo), var(--rojo-osc)); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 12px; }
.auth-card { background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.3); width: 100%; max-width: 480px; padding: 32px; }
.auth-card h1 { color: var(--rojo); font-weight: 800; text-transform: uppercase; font-size: 1.6rem; text-align: center; }
.auth-card .brand-icon { font-size: 44px; color: var(--rojo); display: block; text-align: center; }

/* Carrito / checkout */
.resumen { background: var(--gris); border-radius: 12px; padding: 18px; position: sticky; top: 88px; }
.cart-img { width: 64px; height: 64px; min-width: 64px; border-radius: 8px; object-fit: cover; background: var(--rojo); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.metodo-pago { border: 2px solid #e0e0e0; border-radius: 10px; padding: 12px 14px; cursor: pointer; display: block; }
.metodo-pago:has(input:checked) { border-color: var(--rojo); background: var(--rojo-claro); }

/* Seguimiento del pedido */
.timeline { display: flex; gap: 4px; margin: 10px 0 20px; }
.timeline .paso { flex: 1; text-align: center; font-size: 12px; color: #999; }
.timeline .paso .dot { height: 8px; border-radius: 4px; background: #ddd; margin-bottom: 6px; }
.timeline .paso.done { color: var(--rojo); font-weight: 600; }
.timeline .paso.done .dot { background: var(--rojo); }

/* Admin */
.admin-wrap { display: flex; min-height: 100vh; background: #f4f5f7; }
.admin-side { width: 240px; background: linear-gradient(180deg, var(--rojo), var(--rojo-osc)); color: #fff; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { padding: 20px; text-align: center; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.15); }
.admin-menu a, .admin-menu button { display: block; width: 100%; text-align: left; color: rgba(255,255,255,.88); padding: 11px 20px; border: 0; background: none; border-left: 3px solid transparent; text-decoration: none; }
.admin-menu a:hover, .admin-menu button:hover, .admin-menu a.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #fff; }
.admin-menu i { width: 22px; }
.admin-main { flex: 1; min-width: 0; }
.admin-top { background: #fff; padding: 12px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; align-items: center; gap: 12px; }
.admin-top h1 { font-size: 1.3rem; margin: 0; color: var(--rojo); font-weight: 800; }
.panel { background: #fff; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.07); padding: 18px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.07); padding: 16px 18px; border-left: 4px solid var(--rojo); height: 100%; }
.stat .n { font-size: 1.6rem; font-weight: 800; color: var(--rojo); line-height: 1.1; }
.stat .l { color: #666; font-size: .85rem; }
.table thead th { background: var(--rojo); color: #fff; border: 0; white-space: nowrap; }
.thumb { width: 44px; height: 44px; min-width: 44px; object-fit: cover; border-radius: 6px; background: var(--rojo); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* Repartidor */
.entrega-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.1); border-left: 5px solid var(--rojo); padding: 16px; margin-bottom: 16px; }
.entrega-card.en_ruta { border-left-color: #f5a623; }
.entrega-card.entregado { border-left-color: #28a745; }
.cobrar { background: #fff3cd; border: 1px solid #ffe08a; border-radius: 8px; padding: 8px 12px; font-weight: 700; }

@media print {
    .no-print, .navbar-co, .footer-co, .admin-side, .admin-top { display: none !important; }
    .admin-wrap { display: block; background: #fff; }
    .panel { box-shadow: none; border: 1px solid #ccc; }
}
@media (max-width: 991.98px) {
    .resumen { position: static; }
}

/* Menú móvil del admin */
.admin-off { background: linear-gradient(180deg, var(--rojo), var(--rojo-osc)); color: #fff; width: 270px !important; }

/* ======================================================================
   Adaptación a pantallas (móvil, tablet, escritorio) — v2
   ====================================================================== */
body { overflow-x: clip; }                             /* red de seguridad: jamás scroll horizontal (sin romper sticky) */
img, video, svg { max-width: 100%; }
img { height: auto; }
.producto-img img { height: 100%; }
.pack-head img { height: 140px; }
.panel, .entrega-card, .stat, .resumen, .card-body, td, th, .alert { overflow-wrap: anywhere; }
.table-responsive { -webkit-overflow-scrolling: touch; }
.table td, .table th { vertical-align: middle; }

/* Líneas del carrito: en móvil se apilan en 2 filas */
.cart-line { display: grid; gap: 8px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #eee;
    grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img info del" "img qty sub"; }
.cl-img { grid-area: img; } .cl-info { grid-area: info; } .cl-qty { grid-area: qty; max-width: 150px; }
.cl-sub { grid-area: sub; text-align: right; white-space: nowrap; } .cl-del { grid-area: del; align-self: start; }
@media (min-width: 576px) {
    .cart-line { grid-template-columns: 64px minmax(0, 1fr) 140px 110px auto; grid-template-areas: "img info qty sub del"; }
    .cl-qty { max-width: none; }
}

/* Tarjetas de producto */
.producto-card .card-body { padding: .75rem; }
.producto-card .d-flex { flex-wrap: wrap; gap: .4rem; }

/* Redes sociales (pie de página y popup) */
.footer-redes { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-redes a { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; background: #333; transition: transform .15s; }
.footer-redes a:hover { transform: translateY(-2px); color: #fff; }
.red-wa { background: #25d366 !important; } .red-fb { background: #1877f2 !important; } .red-tt { background: #111 !important; }
.red-yt { background: #e62117 !important; } .red-x { background: #000 !important; }
.red-ig { background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888) !important; }
.redes-modal { border: 0; border-radius: 16px; overflow: hidden; }
.redes-head { position: relative; background: linear-gradient(135deg, var(--rojo), var(--rojo-osc)); color: #fff; text-align: center; padding: 28px 22px 22px; }
.redes-head .btn-close { position: absolute; top: 12px; right: 12px; }
.redes-corazon { font-size: 30px; margin-bottom: 8px; opacity: .95; }
.btn-red { color: #fff !important; font-weight: 600; border: 0; padding: 11px 14px; border-radius: 10px; text-align: center; }
.btn-red i { margin-right: 6px; }
.btn-red:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Teléfonos (< 576 px) */
@media (max-width: 575.98px) {
    .navbar-co .navbar-brand { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; margin-right: 0; }
    .hero { padding: 40px 0; }
    .hero .btn-lg { width: 100%; }
    .section { padding: 32px 0; }
    .auth-card { padding: 24px 18px; }
    .producto-img { height: 130px; }
    .precio { font-size: 1rem; }
    .form-control, .form-select { font-size: 16px; }          /* iOS no hace zoom al enfocar */
    .timeline .paso { font-size: 10.5px; }
    .admin-top { padding: 10px 12px; }
    .admin-top h1 { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .panel { padding: 14px; }
    .stat .n { font-size: 1.3rem; }
    .table thead th { font-size: 12.5px; }
    .btn-lg { font-size: 1rem; }
    .redes-head { padding: 24px 16px 18px; }
    .modal-dialog { margin: 12px; }
}
/* Pantallas muy angostas (< 360 px) */
@media (max-width: 359.98px) {
    .producto-card .card-body { padding: .6rem; }
    .navbar-co .navbar-brand { font-size: .92rem; }
    .cart-line { grid-template-columns: 54px minmax(0, 1fr) auto; }
    .cart-img { width: 54px; height: 54px; min-width: 54px; }
}
/* Tablets: menú lateral del admin más angosto */
@media (min-width: 992px) and (max-width: 1199.98px) { .admin-side { width: 210px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .fade { transition: none !important; } }

/* ===== v3: slider de portada, categorías, por mayor, SEO local ===== */
.hero-brand { font-weight: 800; font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.2; }
.hero-slider .carousel-item { position: relative; height: clamp(360px, 62vh, 640px); background: #2b0a10; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: #fff; padding-top: 24px; padding-bottom: 48px; }
.hero-title { font-weight: 800; font-size: clamp(1.8rem, 5vw, 3.4rem); max-width: 720px; text-shadow: 0 2px 12px rgba(0,0,0,.4); margin-bottom: .6rem; }
.hero-text { font-size: clamp(1rem, 2.2vw, 1.3rem); max-width: 620px; text-shadow: 0 1px 8px rgba(0,0,0,.5); margin-bottom: 1.2rem; }
.hero-slider .carousel-indicators [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; }
.local-intro { padding-bottom: 12px; }
.zonas-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.zona-chip { background: var(--rojo-claro); color: var(--rojo-osc); border-radius: 20px; padding: 4px 12px; font-size: .88rem; font-weight: 600; }
.cat-card { display: block; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.1); color: var(--texto); text-decoration: none; transition: transform .2s, box-shadow .2s; height: 100%; }
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 18px rgba(0,0,0,.15); color: var(--texto); }
.cat-img { aspect-ratio: 4/3; background: linear-gradient(135deg, var(--rojo), var(--rojo-osc)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 40px; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-body { padding: 10px 12px; display: flex; flex-direction: column; }
.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.cat-pills a { white-space: nowrap; border: 2px solid var(--rojo); color: var(--rojo); border-radius: 20px; padding: 5px 14px; font-weight: 600; text-decoration: none; font-size: .92rem; }
.cat-pills a:hover, .cat-pills a.active { background: var(--rojo); color: #fff; }
.cat-pills a.pill-mayor { border-color: #b8860b; color: #8a6400; }
.cat-pills a.pill-mayor:hover, .cat-pills a.pill-mayor.active { background: #b8860b; color: #fff; }
.mayor-tag { font-size: .78rem; background: #fff6d6; color: #7a5800; border-radius: 6px; padding: 3px 7px; margin-bottom: 8px; }
.mayor-hint { color: #7a5800; }
.mayor-banner { background: linear-gradient(135deg, #3b2a05, #7a5800); color: #fff; border-radius: 16px; padding: 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
@media (max-width: 575.98px) {
    .hero-slider .carousel-item { height: 420px; }
    .hero-overlay { background: linear-gradient(0deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.4) 60%, rgba(0,0,0,.25) 100%); }
    .hero-content { justify-content: flex-end; padding-bottom: 56px; }
    .hero-content .btn-lg { width: 100%; }
    .hero-slider .carousel-control-prev, .hero-slider .carousel-control-next { display: none; }
    .mayor-banner { padding: 18px; }
    .mayor-banner .btn { width: 100%; }
}
