/* ============================================================
   MG MARKET™ — Hoja de estilos principal
   MassolaGroup™
   ============================================================ */

:root {
    --mg-primary:     #1a1a2e;
    --mg-secondary:   #16213e;
    --mg-accent:      #e94560;
    --mg-gold:        #f5a623;
    --mg-arroba:      #c0392b;
    --mg-zoeprint:    #c8960c;
    --mg-light:       #f8f9fa;
    --mg-text:        #2d2d2d;
    --mg-muted:       #6c757d;
    --mg-border:      #e9ecef;
    --mg-radius:      10px;
    --mg-shadow:      0 4px 20px rgba(0,0,0,0.08);
    --mg-shadow-hover:0 8px 30px rgba(0,0,0,0.15);
    --transition:     all 0.25s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--mg-text);
    background: #f0f2f5;
    font-size: 0.95rem;
}

/* ── TOP BAR ─────────────────────────────────────────── */
.topbar {
    background: var(--mg-primary);
    padding: 6px 0;
    border-bottom: 2px solid var(--mg-accent);
}

/* ── NAVBAR ──────────────────────────────────────────── */
.mg-navbar {
    background: var(--mg-secondary) !important;
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.brand-mg {
    color: var(--mg-accent);
    font-style: italic;
}

.brand-market {
    color: #fff;
    margin-left: 2px;
}

.brand-tm {
    color: var(--mg-gold);
    font-size: 0.6rem;
    font-weight: 400;
}

.navbar-search {
    border-radius: 25px 0 0 25px !important;
    border: none;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.navbar-search::placeholder { color: rgba(255,255,255,0.5); }
.navbar-search:focus {
    background: rgba(255,255,255,0.15);
    color: #fff;
    box-shadow: none;
    border-color: transparent;
}

.mg-navbar .btn-warning {
    border-radius: 0 25px 25px 0 !important;
    border: none;
}

.btn-carrito {
    border-radius: 50px !important;
    padding: 8px 16px;
    font-size: 1rem;
}

.mg-navbar .nav-link {
    color: rgba(255,255,255,0.75) !important;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 14px !important;
    border-radius: 6px;
}

.mg-navbar .nav-link:hover,
.mg-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

/* ── HERO ────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-secondary) 50%, #0f3460 100%);
    color: #fff;
    padding: 70px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(233,69,96,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245,166,35,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-title span { color: var(--mg-accent); }

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.75);
    margin-top: 12px;
    max-width: 500px;
}

/* ── SEARCH BAR HERO ─────────────────────────────────── */
.hero-search {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 6px 6px 6px 24px;
    margin-top: 30px;
    max-width: 540px;
}

.hero-search input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    width: calc(100% - 50px);
}

.hero-search input::placeholder { color: rgba(255,255,255,0.5); }

.hero-search .btn {
    border-radius: 50px !important;
}

/* ── SECCIÓN CATEGORÍAS ──────────────────────────────── */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 45px;
    height: 3px;
    background: var(--mg-accent);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ── TARJETA CATEGORÍA ───────────────────────────────── */
.cat-card {
    background: #fff;
    border-radius: var(--mg-radius);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--mg-shadow);
    border: 2px solid transparent;
    text-decoration: none;
    color: var(--mg-text);
    display: block;
    height: 100%;
}

.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mg-shadow-hover);
    border-color: var(--mg-accent);
    color: var(--mg-text);
}

.cat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--mg-primary), var(--mg-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: #fff;
    font-size: 1.4rem;
    transition: var(--transition);
}

.cat-card:hover .cat-icon {
    background: linear-gradient(135deg, var(--mg-accent), #c0392b);
}

.cat-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 8px;
}

.cat-count {
    font-size: 0.78rem;
    color: var(--mg-muted);
    margin-top: 4px;
}

/* ── TARJETA PRODUCTO/SERVICIO ────────────────────────── */
.item-card {
    background: #fff;
    border-radius: var(--mg-radius);
    box-shadow: var(--mg-shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--mg-border);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--mg-shadow-hover);
    border-color: transparent;
}

.item-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f2f5, #e8eaed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.item-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-tipo {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-tipo.producto { background: #1a1a2e; color: #fff; }
.badge-tipo.servicio { background: var(--mg-accent); color: #fff; }

.badge-destacado {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--mg-gold);
    color: #1a1a2e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-erp {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.badge-erp.arroba   { background: var(--mg-arroba); color: #fff; }
.badge-erp.zoeprint { background: var(--mg-zoeprint); color: #fff; }

.item-card-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.item-categoria {
    font-size: 0.75rem;
    color: var(--mg-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.item-nombre {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--mg-text);
    flex-grow: 1;
}

.item-desc {
    font-size: 0.85rem;
    color: var(--mg-muted);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-precio {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--mg-primary);
    margin-bottom: 12px;
}

.item-precio .moneda {
    font-size: 0.8rem;
    color: var(--mg-muted);
    font-weight: 400;
    margin-left: 4px;
}

.item-precio.a-consultar {
    font-size: 0.9rem;
    color: var(--mg-muted);
    font-weight: 500;
    font-style: italic;
}

.item-card-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--mg-border);
    display: flex;
    gap: 8px;
}

/* ── BOTONES ─────────────────────────────────────────── */
.btn-mg-primary {
    background: var(--mg-primary);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: pointer;
}

.btn-mg-primary:hover {
    background: var(--mg-accent);
    color: #fff;
}

.btn-mg-outline {
    background: transparent;
    color: var(--mg-primary);
    border: 2px solid var(--mg-border);
    border-radius: 25px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: pointer;
}

.btn-mg-outline:hover {
    border-color: var(--mg-primary);
    background: var(--mg-primary);
    color: #fff;
}

/* ── STATS BADGE ─────────────────────────────────────── */
.stats-section {
    background: var(--mg-primary);
    color: #fff;
    padding: 40px 0;
}

.stat-box { text-align: center; }
.stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--mg-gold);
}
.stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    margin-top: 4px;
}

/* ── FILTROS CATÁLOGO ────────────────────────────────── */
.filter-sidebar {
    background: #fff;
    border-radius: var(--mg-radius);
    padding: 24px;
    box-shadow: var(--mg-shadow);
    position: sticky;
    top: 80px;
}

.filter-title {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mg-muted);
    margin-bottom: 12px;
    margin-top: 16px;
}

.filter-title:first-child { margin-top: 0; }

/* ── PAGINACIÓN ──────────────────────────────────────── */
.mg-pagination .page-link {
    border-radius: 8px !important;
    margin: 0 3px;
    border: 1px solid var(--mg-border);
    color: var(--mg-text);
    font-weight: 500;
}

.mg-pagination .page-item.active .page-link {
    background: var(--mg-primary);
    border-color: var(--mg-primary);
}

/* ── DASHBOARD CLIENTE ───────────────────────────────── */
.dash-sidebar {
    background: #fff;
    border-radius: var(--mg-radius);
    overflow: hidden;
    box-shadow: var(--mg-shadow);
}

.dash-profile {
    background: linear-gradient(135deg, var(--mg-primary), var(--mg-secondary));
    padding: 30px 20px;
    text-align: center;
    color: #fff;
}

.dash-avatar {
    width: 80px;
    height: 80px;
    background: var(--mg-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 12px;
    font-weight: 700;
    color: #fff;
}

.dash-nav .nav-link {
    color: var(--mg-text);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    font-weight: 500;
    transition: var(--transition);
}

.dash-nav .nav-link:hover,
.dash-nav .nav-link.active {
    color: var(--mg-accent);
    border-left-color: var(--mg-accent);
    background: rgba(233,69,96,0.05);
}

.dash-card {
    background: #fff;
    border-radius: var(--mg-radius);
    padding: 24px;
    box-shadow: var(--mg-shadow);
    margin-bottom: 20px;
}

.estado-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.estado-pendiente   { background: #fff3cd; color: #856404; }
.estado-en_revision { background: #cce5ff; color: #004085; }
.estado-cotizada    { background: #d1ecf1; color: #0c5460; }
.estado-aprobada    { background: #d4edda; color: #155724; }
.estado-rechazada   { background: #f8d7da; color: #721c24; }
.estado-contrato    { background: #e2d9f3; color: #432874; }
.estado-activo      { background: #d4edda; color: #155724; }
.estado-finalizado  { background: #e9ecef; color: #495057; }
.estado-pagada      { background: #d4edda; color: #155724; }
.estado-vencida     { background: #f8d7da; color: #721c24; }

/* ── CARRITO / SOLICITUD ─────────────────────────────── */
.carrito-item {
    background: #fff;
    border-radius: var(--mg-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--mg-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.carrito-item-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: var(--mg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--mg-muted);
    flex-shrink: 0;
    overflow: hidden;
}

/* ── NOTIFICACIONES ERP (para usar desde PHP) ─────────── */
.mg-notif-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--mg-accent);
    border-radius: 50%;
    margin-left: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(233,69,96,0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(233,69,96,0); }
    100% { box-shadow: 0 0 0 0 rgba(233,69,96,0); }
}

/* ── FOOTER ──────────────────────────────────────────── */
.mg-footer {
    background: var(--mg-primary);
    color: rgba(255,255,255,0.7);
    padding: 50px 0 20px;
}

.footer-brand { font-size: 1.4rem; font-weight: 800; }

.footer-heading {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.footer-links li { margin-bottom: 8px; }
.footer-links a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition);
}
.footer-links a:hover { color: var(--mg-gold); }

.footer-hr { border-color: rgba(255,255,255,0.1); margin: 30px 0 16px; }

.footer-proyecto {
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.arroba-link   { background: var(--mg-arroba);   color: #fff; }
.zoeprint-link { background: var(--mg-zoeprint); color: #fff; }

.arroba-link:hover   { background: #a93226; color: #fff; }
.zoeprint-link:hover { background: #a67c0a; color: #fff; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-title { font-size: 1.8rem; }
    .hero-section { padding: 40px 0; }
}

@media (max-width: 576px) {
    .topbar .text-end .btn { display: none; }
    .topbar .text-end .btn:last-child { display: inline-block; }
}
