/* ============================================
   BENEDICTUM BY ALUGO — Estilos Globales v2
   Mobile-first, responsive completo
   ============================================ */

:root {
    --naranja:       #F15A24;
    --naranja-hover: #d44e1e;
    --violeta:       #5B2D8E;
    --violeta-hover: #4a2475;
    --violeta-light: #ede8f5;
    --texto:         #1a1a1a;
    --texto-suave:   #666666;
    --borde:         #e5e5e5;
    --fondo:         #f9f9f9;
    --blanco:        #ffffff;
    --sombra:        0 2px 12px rgba(0,0,0,0.08);
    --sombra-hover:  0 6px 24px rgba(0,0,0,0.13);
    --radio:         12px;
    --radio-sm:      8px;
    --fuente:        'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--fuente); color: var(--texto); background: var(--blanco); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
p { color: var(--texto-suave); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* NAVBAR */
.navbar { background: var(--blanco); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.navbar__inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
@media (min-width: 768px) { .navbar__inner { height: 64px; } }
.navbar__logo span { font-size: 1.1rem; font-weight: 800; color: var(--naranja); letter-spacing: -0.5px; white-space: nowrap; }
@media (min-width: 480px) { .navbar__logo span { font-size: 1.25rem; } }
.navbar__logo span em { color: var(--violeta); font-style: normal; }
.navbar__links { display: none; gap: 4px; align-items: center; }
@media (min-width: 768px) { .navbar__links { display: flex; } }
.navbar__links a { font-size: 0.88rem; font-weight: 500; color: var(--texto); padding: 6px 10px; border-radius: var(--radio-sm); transition: background 0.15s; }
.navbar__links a:hover { background: var(--fondo); }
.navbar__actions { display: flex; gap: 8px; align-items: center; }

/* BOTONES */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--fuente); font-size: 0.88rem; font-weight: 700; padding: 10px 18px; border-radius: var(--radio-sm); border: none; cursor: pointer; transition: background 0.18s, transform 0.1s, box-shadow 0.18s; text-align: center; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--naranja); color: var(--blanco); }
.btn-primary:hover { background: var(--naranja-hover); box-shadow: 0 4px 14px rgba(241,90,36,0.35); }
.btn-secondary { background: var(--violeta); color: var(--blanco); }
.btn-secondary:hover { background: var(--violeta-hover); }
.btn-outline-naranja { background: transparent; color: var(--naranja); border: 2px solid var(--naranja); }
.btn-outline-naranja:hover { background: var(--naranja); color: var(--blanco); }
.btn-outline-violeta { background: transparent; color: var(--violeta); border: 2px solid var(--violeta); }
.btn-outline-violeta:hover { background: var(--violeta); color: var(--blanco); }
.btn-sm { font-size: 0.78rem; padding: 7px 14px; }
.btn-lg { font-size: 0.95rem; padding: 13px 28px; border-radius: var(--radio); }
.btn-full { width: 100%; }

/* HERO */
.hero { padding: 36px 0 28px; display: grid; grid-template-columns: 1fr; gap: 28px; text-align: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1fr 1fr; text-align: left; padding: 72px 0 48px; align-items: center; } }
.hero__title { font-size: clamp(1.8rem, 6vw, 2.8rem); font-weight: 800; color: var(--texto); line-height: 1.15; margin-bottom: 14px; }
.hero__subtitle { font-size: clamp(0.9rem, 2.5vw, 1rem); color: var(--texto-suave); margin-bottom: 24px; max-width: 440px; margin-left: auto; margin-right: auto; }
@media (min-width: 900px) { .hero__subtitle { margin-left: 0; margin-right: 0; } }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (min-width: 900px) { .hero__actions { justify-content: flex-start; } }
.hero__image { display: none; }
@media (min-width: 900px) { .hero__image { display: block; } }

/* BUSCADOR */
.search-bar { background: var(--blanco); border: 1.5px solid var(--borde); border-radius: 100px; display: flex; align-items: center; overflow: hidden; box-shadow: var(--sombra); width: 100%; }
.search-bar input { flex: 1; border: none; outline: none; font-size: 0.9rem; padding: 12px 16px; font-family: var(--fuente); color: var(--texto); background: transparent; min-width: 0; }
.search-bar button { background: var(--naranja); border: none; padding: 10px 16px; cursor: pointer; color: var(--blanco); font-size: 1rem; transition: background 0.15s; display: flex; align-items: center; flex-shrink: 0; }
.search-bar button:hover { background: var(--naranja-hover); }

/* SECCIÓN */
.section { padding: 36px 0; }
@media (min-width: 768px) { .section { padding: 56px 0; } }
.section--grey { background: var(--fondo); }
.section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.section__title { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 700; }
.section__link { color: var(--naranja); font-size: 0.88rem; font-weight: 600; }

/* GRIDS */
.tiendas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 480px) { .tiendas-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; } }
@media (min-width: 768px) { .tiendas-grid { gap: 24px; } }

.productos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 480px) { .productos-grid { gap: 14px; } }
@media (min-width: 640px) { .productos-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (min-width: 768px) { .productos-grid { gap: 20px; } }

/* CARD TIENDA */
.tienda-card { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; display: block; }
.tienda-card:hover { box-shadow: var(--sombra-hover); transform: translateY(-2px); }
.tienda-card__banner { height: 80px; overflow: hidden; }
@media (min-width: 480px) { .tienda-card__banner { height: 110px; } }
@media (min-width: 768px) { .tienda-card__banner { height: 130px; } }
.tienda-card__banner img { width: 100%; height: 100%; object-fit: cover; }
.tienda-card__body { padding: 12px; }
@media (min-width: 480px) { .tienda-card__body { padding: 16px; } }
.tienda-card__logo { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--blanco); background: var(--blanco); box-shadow: 0 2px 8px rgba(0,0,0,0.12); overflow: hidden; margin-top: -28px; margin-bottom: 8px; }
@media (min-width: 480px) { .tienda-card__logo { width: 52px; height: 52px; margin-top: -34px; } }
.tienda-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.tienda-card__nombre { font-size: 0.85rem; font-weight: 700; color: var(--texto); }
@media (min-width: 480px) { .tienda-card__nombre { font-size: 0.95rem; } }
.tienda-card__desc { font-size: 0.75rem; color: var(--texto-suave); margin: 4px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* CARD PRODUCTO */
.producto-card { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column; }
.producto-card:hover { box-shadow: var(--sombra-hover); transform: translateY(-2px); }
.producto-card__img { height: 130px; background: var(--fondo); overflow: hidden; position: relative; }
@media (min-width: 480px) { .producto-card__img { height: 160px; } }
@media (min-width: 768px) { .producto-card__img { height: 200px; } }
.producto-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.producto-card:hover .producto-card__img img { transform: scale(1.04); }
.badge-destacado { position: absolute; top: 8px; left: 8px; background: var(--violeta); color: var(--blanco); font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 100px; }
.producto-card__body { padding: 10px; flex: 1; display: flex; flex-direction: column; }
@media (min-width: 480px) { .producto-card__body { padding: 14px; } }
.producto-card__tag { font-size: 0.65rem; font-weight: 700; color: var(--naranja); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 3px; }
.producto-card__nombre { font-size: 0.82rem; font-weight: 700; color: var(--texto); margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 480px) { .producto-card__nombre { font-size: 0.9rem; } }
.producto-card__categoria { font-size: 0.73rem; color: var(--texto-suave); margin-bottom: 8px; }
.producto-card__precio { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--texto-suave); margin-top: auto; margin-bottom: 10px; }
.producto-card__footer { padding: 0 10px 10px; }
@media (min-width: 480px) { .producto-card__footer { padding: 0 14px 14px; } }

/* DETALLE PRODUCTO */
.producto-detalle { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 20px 0; }
@media (min-width: 768px) { .producto-detalle { grid-template-columns: 1fr 1fr; gap: 48px; padding: 48px 0; align-items: start; } }
.producto-galeria__principal { border-radius: var(--radio); overflow: hidden; background: var(--fondo); aspect-ratio: 4/3; }
.producto-galeria__principal img { width: 100%; height: 100%; object-fit: cover; }
.producto-info__tag { font-size: 0.75rem; font-weight: 700; color: var(--naranja); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.producto-info__nombre { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 800; margin-bottom: 8px; }
.producto-info__categoria { color: var(--texto-suave); margin-bottom: 16px; font-size: 0.9rem; }
.producto-info__precio-box { background: var(--fondo); border-radius: var(--radio-sm); padding: 14px 18px; margin-bottom: 20px; }
.producto-info__precio-box .precio { font-size: clamp(1.4rem, 4vw, 1.8rem); font-weight: 800; color: var(--violeta); }
.producto-info__precio-box .unidad { font-size: 0.85rem; color: var(--texto-suave); }
.producto-info__descripcion { font-size: 0.92rem; color: var(--texto-suave); line-height: 1.7; margin-bottom: 24px; }
.producto-info__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.producto-info__actions .btn { flex: 1; min-width: 130px; }

/* BREADCRUMB */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--texto-suave); padding: 12px 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--naranja); font-weight: 500; }
.breadcrumb__sep { color: var(--borde); }

/* BANNER TIENDA */
.tienda-banner { height: 140px; position: relative; overflow: hidden; }
@media (min-width: 768px) { .tienda-banner { height: 220px; } }
.tienda-banner img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.tienda-header { display: flex; align-items: flex-end; gap: 12px; padding: 0 0 16px; margin-top: -32px; position: relative; flex-wrap: wrap; }
@media (min-width: 768px) { .tienda-header { gap: 20px; padding: 0 0 24px; margin-top: -40px; } }
.tienda-header__logo { width: 64px; height: 64px; border-radius: var(--radio-sm); border: 4px solid var(--blanco); background: var(--blanco); box-shadow: var(--sombra); overflow: hidden; flex-shrink: 0; }
@media (min-width: 768px) { .tienda-header__logo { width: 80px; height: 80px; } }
.tienda-header__logo img { width: 100%; height: 100%; object-fit: cover; }
.tienda-header__info h1 { font-size: clamp(1.1rem, 4vw, 1.6rem); margin-bottom: 4px; }

/* TIENDA LAYOUT */
.tienda-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .tienda-layout { grid-template-columns: 200px 1fr; gap: 32px; } }

/* FORMULARIOS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--texto); }
.form-group input, .form-group textarea, .form-group select { width: 100%; border: 1.5px solid var(--borde); border-radius: var(--radio-sm); padding: 11px 14px; font-size: 0.93rem; font-family: var(--fuente); color: var(--texto); background: var(--blanco); transition: border-color 0.15s, box-shadow 0.15s; outline: none; -webkit-appearance: none; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--violeta); box-shadow: 0 0 0 3px rgba(91,45,142,0.12); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input[type="file"] { padding: 8px 12px; cursor: pointer; }
.form-grid-2 { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 480px) { .form-grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; } }

/* CARD */
.card { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px; box-shadow: var(--sombra); }
@media (min-width: 768px) { .card { padding: 28px; } }

/* ALERTAS */
.alert { padding: 12px 16px; border-radius: var(--radio-sm); font-size: 0.88rem; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: #edfaf1; color: #1a7a40; border: 1px solid #a3e9bf; }
.alert-error   { background: #fff0ee; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-info    { background: #ede8f5; color: var(--violeta); border: 1px solid #c9b8e8; }

/* DASHBOARD */
.dashboard { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 56px); }
@media (min-width: 900px) { .dashboard { grid-template-columns: 220px 1fr; min-height: calc(100vh - 64px); } }
.sidebar { background: var(--texto); padding: 24px 0; display: none; }
@media (min-width: 900px) { .sidebar { display: block; } }
.sidebar-mobile { background: var(--texto); display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sidebar-mobile::-webkit-scrollbar { display: none; }
.sidebar-mobile a { display: flex; align-items: center; gap: 6px; padding: 14px 16px; font-size: 0.8rem; color: rgba(255,255,255,0.7); white-space: nowrap; font-weight: 600; border-bottom: 3px solid transparent; }
.sidebar-mobile a.active { color: var(--blanco); border-bottom-color: var(--naranja); }
@media (min-width: 900px) { .sidebar-mobile { display: none; } }
.sidebar__tienda { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 12px; }
.sidebar__tienda-nombre { font-size: 0.88rem; font-weight: 700; color: var(--blanco); }
.sidebar__tienda-rol { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.sidebar__nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 0.88rem; color: rgba(255,255,255,0.75); transition: background 0.15s, color 0.15s; font-weight: 500; }
.sidebar__nav a:hover, .sidebar__nav a.active { background: rgba(255,255,255,0.08); color: var(--blanco); }
.sidebar__nav a.active { border-left: 3px solid var(--naranja); }
.dashboard__main { padding: 20px 16px; background: var(--fondo); }
@media (min-width: 768px) { .dashboard__main { padding: 32px; } }
.dashboard__title { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 700; margin-bottom: 20px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
@media (min-width: 768px) { .stats-grid { gap: 16px; margin-bottom: 28px; } }
.stat-card { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; text-align: center; box-shadow: var(--sombra); }
.stat-card__num { font-size: 1.5rem; font-weight: 800; }
@media (min-width: 768px) { .stat-card__num { font-size: 1.8rem; } }
.stat-card__label { font-size: 0.72rem; color: var(--texto-suave); margin-top: 2px; }

/* TABLA */
.tabla-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radio); box-shadow: var(--sombra); }
.tabla-admin { width: 100%; border-collapse: collapse; background: var(--blanco); min-width: 560px; }
.tabla-admin th { background: var(--fondo); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--texto-suave); padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--borde); }
.tabla-admin td { padding: 11px 14px; font-size: 0.85rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla-admin tr:last-child td { border-bottom: none; }
.tabla-admin tr:hover td { background: var(--fondo); }
.tabla-admin__img { width: 44px; height: 44px; border-radius: var(--radio-sm); object-fit: cover; border: 1px solid var(--borde); }

/* BADGE */
.badge { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 100px; }
.badge-activo { background: #edfaf1; color: #1a7a40; }
.badge-inactivo { background: #f5f5f5; color: #888; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state__icon { font-size: 2.5rem; margin-bottom: 14px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--texto); margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; color: var(--texto-suave); margin-bottom: 18px; }

/* COLOR PICKER */
.color-picker-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.color-opt { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform 0.15s, border-color 0.15s; }
.color-opt:hover { transform: scale(1.15); }
.color-opt.selected { border-color: var(--texto); transform: scale(1.1); }

/* FOOTER */
.footer { background: var(--texto); color: rgba(255,255,255,0.7); padding: 40px 0 24px; margin-top: 60px; }
.footer__grid { display: grid; grid-template-columns: 1fr; gap: 28px; margin-bottom: 28px; }
@media (min-width: 640px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer__brand { font-size: 1.2rem; font-weight: 800; color: var(--blanco); margin-bottom: 8px; }
.footer__brand span { color: var(--naranja); }
.footer__desc { font-size: 0.85rem; line-height: 1.7; }
.footer__title { font-size: 0.85rem; font-weight: 700; color: var(--blanco); margin-bottom: 10px; }
.footer__links a { display: block; font-size: 0.82rem; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.footer__links a:hover { color: var(--blanco); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 0.8rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer__bottom a { color: var(--naranja); }
