/**
 * MIATA.SPACE - Diseño Limpio y Moderno
 * ========================================
 * Estilo minimalista, blanco y ligero
 */

/* ====================================
   CSS VARIABLES - Tema Claro Minimalista
   ==================================== */
:root {
    /* Primary colors - Índigo moderno */
    --md-sys-color-primary: #4f46e5;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #e0e7ff;
    --md-sys-color-on-primary-container: #3730a3;
    --md-sys-color-primary-hover: #4338ca;
    
    /* Secondary colors - Gris neutro */
    --md-sys-color-secondary: #64748b;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #f1f5f9;
    --md-sys-color-on-secondary-container: #475569;
    
    /* Tertiary colors - Cyan para acentos */
    --md-sys-color-tertiary: #0891b2;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #cffafe;
    --md-sys-color-on-tertiary-container: #155e75;
    
    /* Error colors */
    --md-sys-color-error: #dc2626;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-error-container: #fef2f2;
    --md-sys-color-on-error-container: #991b1b;
    
    /* Surface colors - Blanco puro y grises suaves */
    --md-sys-color-surface: #ffffff;
    --md-sys-color-on-surface: #1e293b;
    --md-sys-color-surface-variant: #f8fafc;
    --md-sys-color-on-surface-variant: #64748b;
    --md-sys-color-surface-container: #f8fafc;
    --md-sys-color-surface-container-high: #f1f5f9;
    --md-sys-color-surface-container-highest: #e2e8f0;
    
    /* Outline */
    --md-sys-color-outline: #cbd5e1;
    --md-sys-color-outline-variant: #e2e8f0;
    
    /* Background */
    --md-sys-color-background: #f8fafc;
    --md-sys-color-on-background: #1e293b;
    
    /* Inverse */
    --md-sys-color-inverse-surface: #1e293b;
    --md-sys-color-inverse-on-surface: #f8fafc;
    --md-sys-color-inverse-primary: #a5b4fc;
    
    /* Shadow */
    --md-sys-color-shadow: rgba(0, 0, 0, 0.05);
    
    /* Elevation shadows - Sutiles y ligeras */
    --md-sys-elevation-1: 0 1px 2px rgba(0,0,0,0.04);
    --md-sys-elevation-2: 0 1px 3px rgba(0,0,0,0.06);
    --md-sys-elevation-3: 0 2px 4px rgba(0,0,0,0.06);
    --md-sys-elevation-4: 0 4px 6px rgba(0,0,0,0.06);
    --md-sys-elevation-5: 0 8px 16px rgba(0,0,0,0.08);
    
    /* Shape - Border radius */
    --md-sys-shape-corner-none: 0;
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    --md-sys-shape-corner-full: 9999px;
    
    /* Spacing */
    --md-sys-spacing-xs: 4px;
    --md-sys-spacing-sm: 8px;
    --md-sys-spacing-md: 16px;
    --md-sys-spacing-lg: 24px;
    --md-sys-spacing-xl: 32px;
    --md-sys-spacing-2xl: 48px;
    --md-sys-spacing-3xl: 64px;
    
    /* Motion / Transitions */
    --md-sys-motion-duration-short: 100ms;
    --md-sys-motion-duration-medium: 250ms;
    --md-sys-motion-duration-long: 400ms;
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-decelerate: cubic-bezier(0, 0, 0, 1);
    --md-sys-motion-easing-accelerate: cubic-bezier(0.3, 0, 1, 1);
}

/* Dark theme - Solo si el usuario lo prefiere explícitamente
   Por defecto usamos light theme */
[data-theme="dark"] {
    --md-sys-color-primary: #8cd9a9;
    --md-sys-color-on-primary: #003920;
    --md-sys-color-primary-container: #005231;
    --md-sys-color-on-primary-container: #a8f5c4;
    
    --md-sys-color-secondary: #b1cdb5;
    --md-sys-color-on-secondary: #1d3625;
    --md-sys-color-secondary-container: #344c3a;
    --md-sys-color-on-secondary-container: #cce9d0;
    
    --md-sys-color-surface: #1a1c19;
    --md-sys-color-on-surface: #e2e3dd;
    --md-sys-color-surface-variant: #424940;
    --md-sys-color-on-surface-variant: #c2c9be;
    --md-sys-color-surface-container: #1e201c;
    --md-sys-color-surface-container-high: #282b26;
    --md-sys-color-surface-container-highest: #333631;
    
    --md-sys-color-outline: #8c9388;
    --md-sys-color-outline-variant: #424940;
    
    --md-sys-color-background: #1a1c19;
    --md-sys-color-on-background: #e2e3dd;
}

/* ====================================
   RESET & BASE
   ==================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--md-sys-color-on-background);
    background-color: var(--md-sys-color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Evitar selección táctil azul en móvil */
button, a, .categoria-card, .subcategory-chip, .card, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-weight: 500;
    line-height: 1.25;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* ====================================
   ICONS - SVG System
   ==================================== */
.icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 48px; height: 48px; }

/* ====================================
   LAYOUT
   ==================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--md-sys-spacing-md);
}

.container-narrow { max-width: 800px; }
.container-wide { max-width: 1400px; }

.main {
    flex: 1;
    /* padding: var(--md-sys-spacing-lg) 0; */
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--md-sys-spacing-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.gap-xs { gap: var(--md-sys-spacing-xs); }
.gap-sm { gap: var(--md-sys-spacing-sm); }
.gap-md { gap: var(--md-sys-spacing-md); }
.gap-lg { gap: var(--md-sys-spacing-lg); }

/* ====================================
   HEADER - App Bar
   ==================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--md-sys-color-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: var(--md-sys-elevation-1);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    color: var(--md-sys-color-on-surface);
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo .icon {
    color: var(--md-sys-color-primary);
    width: 32px;
    height: 32px;
}

.logo-icon {
    /* width: 32px;
    height: 32px; */
    height:32px;
    width:auto;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-full);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.nav-link:hover {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
}

.nav-link.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: var(--md-sys-spacing-sm);
    background: none;
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    transition: background-color var(--md-sys-motion-duration-short);
}

.menu-toggle:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--md-sys-color-on-surface);
    border-radius: 2px;
}

/* Bottom nav oculto en desktop */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .menu-toggle { display: none; }
    
    /* Ocultar nav del header en móvil */
    .header .nav {
        display: none;
    }
    
    .header-actions { display: none; }
    
    /* Bottom Navigation para móvil */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--md-sys-color-surface);
        border-top: 1px solid var(--md-sys-color-outline-variant);
        padding: var(--md-sys-spacing-xs) 0;
        padding-bottom: env(safe-area-inset-bottom, var(--md-sys-spacing-xs));
        z-index: 1000;
    }
    
    .bottom-nav-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: var(--md-sys-spacing-xs) 0;
        color: var(--md-sys-color-on-surface-variant);
        text-decoration: none;
        font-size: 0.6875rem;
        -webkit-tap-highlight-color: transparent;
    }
    
    .bottom-nav-link .icon {
        width: 24px;
        height: 24px;
    }
    
    .bottom-nav-link.active {
        color: var(--md-sys-color-primary);
    }
    
    /* Espacio para bottom nav y ocultar footer */
    main {
        padding-bottom: 70px;
    }
    
    .footer {
        display: none;
    }
}

/* ====================================
   BUTTONS - Material Design 3
   ==================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-sm);
    min-height: 40px;
    padding: 0 var(--md-sys-spacing-lg);
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: currentColor;
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short);
}

.btn:hover::before { opacity: 0.08; }
.btn:active::before { opacity: 0.12; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* Filled Button (Primary) */
.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-primary:hover { box-shadow: var(--md-sys-elevation-1); }

/* Outlined Button */
.btn-outline {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
}

/* Text Button */
.btn-ghost {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 var(--md-sys-spacing-md);
}

/* Tonal Button (Secondary) */
.btn-secondary {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

/* Error/Danger Button */
.btn-error {
    background-color: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
}

.btn-error:hover {
    background-color: var(--md-sys-color-error);
    filter: brightness(1.1);
}

/* Elevated Button */
.btn-elevated {
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.btn-elevated:hover { box-shadow: var(--md-sys-elevation-2); }

/* Button sizes */
.btn-sm {
    min-height: 32px;
    padding: 0 var(--md-sys-spacing-md);
    font-size: 0.75rem;
}

.btn-lg {
    min-height: 48px;
    padding: 0 var(--md-sys-spacing-xl);
}

/* Icon Button */
.btn-icon {
    width: 40px;
    height: 40px;
    min-height: unset;
    padding: 0;
    border-radius: var(--md-sys-shape-corner-full);
    background-color: transparent;
    color: var(--md-sys-color-on-surface-variant);
}

.btn-icon:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

/* FAB - Floating Action Button */
.fab {
    position: fixed;
    bottom: var(--md-sys-spacing-md);
    right: var(--md-sys-spacing-md);
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-large);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-sys-elevation-3);
    z-index: 100;
}

.fab:hover { box-shadow: var(--md-sys-elevation-4); }

/* WhatsApp Button */
.btn-whatsapp {
    background-color: #25D366;
    color: #ffffff;
}

/* ====================================
   CARDS - Material Design 3
   ==================================== */
.card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    transition: box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.card-elevated { box-shadow: var(--md-sys-elevation-1); }
.card-elevated:hover { box-shadow: var(--md-sys-elevation-2); }
.card-filled { background-color: var(--md-sys-color-surface-container-highest); }
.card-outlined { border: 1px solid var(--md-sys-color-outline-variant); }

.card a {
    color: inherit;
    text-decoration: none;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: var(--md-sys-spacing-md);
}

.card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-sm);
}

.card-text {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.card-actions {
    display: flex;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md) var(--md-sys-spacing-md);
}

/* ====================================
   CHIPS & BADGES
   ==================================== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    height: 32px;
    padding: 0 var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
}

.chip-filled {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--md-sys-spacing-sm);
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 0.6875rem;
    font-weight: 500;
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.badge-primary { background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.badge-success { background-color: var(--md-sys-color-tertiary); color: var(--md-sys-color-on-tertiary); }
.badge-warning { background-color: var(--md-sys-color-tertiary); color: var(--md-sys-color-on-tertiary); }
.badge-error { background-color: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }

/* ====================================
   FORMS - Material Design 3
   ==================================== */
.form-group {
    margin-bottom: var(--md-sys-spacing-md);
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: var(--md-sys-spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 56px;
    padding: var(--md-sys-spacing-md);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-size: 1rem;
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface);
    transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--md-sys-color-on-surface);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
}

.form-input::placeholder { color: var(--md-sys-color-on-surface-variant); }

/* Form validation states */
.form-input:invalid:not(:placeholder-shown),
.form-select:invalid:not(:placeholder-shown),
.form-textarea:invalid:not(:placeholder-shown) {
    border-color: var(--md-sys-color-error);
}

.form-input:invalid:not(:placeholder-shown):focus,
.form-select:invalid:not(:placeholder-shown):focus,
.form-textarea:invalid:not(:placeholder-shown):focus {
    border-color: var(--md-sys-color-error);
    box-shadow: 0 0 0 1px var(--md-sys-color-error);
}

/* Required indicator style */
.form-label::after {
    content: '';
}

.form-group.required .form-label::after,
.form-label[data-required]::after {
    content: ' *';
    color: var(--md-sys-color-error);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: var(--md-sys-spacing-xs);
}

.form-error { color: var(--md-sys-color-error); }

/* Search field */
.search-field {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    min-height: 48px;
    padding: 0 var(--md-sys-spacing-md);
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short);
}

.search-field:focus-within {
    background-color: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-2);
}

.search-field input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--md-sys-color-on-surface);
    outline: none;
}

.search-field .icon { color: var(--md-sys-color-on-surface-variant); }

/* ====================================
   HERO SECTION
   ==================================== */
.hero {
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #002a17 100%);
    color: var(--md-sys-color-on-primary);
    padding: var(--md-sys-spacing-3xl) 0;
    text-align: center;
}

/* Hero con imagen de fondo */
.hero.hero-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: var(--md-sys-spacing-3xl) 0;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg, 
        rgba(0, 42, 23, 0.5) 0%, 
        rgba(79, 70, 229, 0.35) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: var(--md-sys-spacing-md);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto var(--md-sys-spacing-lg);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hero-actions {
    display: flex;
    gap: var(--md-sys-spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================
   PAGE HEADER (Eventos, Marketplace)
   ========================================= */
.page-header {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: var(--md-sys-spacing-3xl) var(--md-sys-spacing-lg);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 0;
}

.page-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 42, 23, 0.7) 0%,
        rgba(79, 70, 229, 0.5) 100%
    );
    z-index: 1;
}

.page-header-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.page-header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--md-sys-spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-sm);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.page-header-content h1 .icon {
    width: 36px;
    height: 36px;
}

.page-header-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: var(--md-sys-spacing-lg);
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.page-header-content .btn-light {
    background: white;
    color: var(--md-sys-color-primary);
    border: none;
    font-weight: 600;
}

.page-header-content .btn-light:hover {
    background: #f0f0f0;
}

/* Page Content con padding */
.page-content {
    padding: var(--md-sys-spacing-xl) var(--md-sys-spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .page-header {
        min-height: 160px;
        padding: var(--md-sys-spacing-xl) var(--md-sys-spacing-md);
    }
    
    .page-header-content h1 {
        font-size: 1.5rem;
    }
    
    .page-header-content h1 .icon {
        width: 28px;
        height: 28px;
    }
    
    .page-content {
        padding: var(--md-sys-spacing-lg) var(--md-sys-spacing-md);
    }
}

.hero .btn-primary {
    background-color: var(--md-sys-color-on-primary);
    color: var(--md-sys-color-primary);
}

.hero .btn-outline {
    border-color: var(--md-sys-color-on-primary);
    color: var(--md-sys-color-on-primary);
}

.hero .btn-outline-light {
    border: 2px solid rgba(255,255,255,0.8);
    color: white;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
}

.hero .btn-outline-light:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
}

@media (max-width: 768px) {
    .hero.hero-bg {
        min-height: 350px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

/* ====================================
   FOOTER
   ==================================== */
.footer {
    background-color: var(--md-sys-color-surface-container);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding: var(--md-sys-spacing-2xl) 0 var(--md-sys-spacing-lg);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--md-sys-spacing-xl);
    margin-bottom: var(--md-sys-spacing-xl);
}

.footer-section h3,
.footer-section h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-md);
}

.footer-section p {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.footer-section a {
    display: block;
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    padding: var(--md-sys-spacing-xs) 0;
}

.footer-section a:hover { color: var(--md-sys-color-primary); }

.footer-bottom {
    text-align: center;
    padding-top: var(--md-sys-spacing-lg);
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* ====================================
   UTILITIES
   ==================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--md-sys-color-primary); }
.text-secondary { color: var(--md-sys-color-on-surface-variant); }
.text-error { color: var(--md-sys-color-error); }
.text-success { color: var(--md-sys-color-tertiary); }

.bg-surface { background-color: var(--md-sys-color-surface); }
.bg-surface-container { background-color: var(--md-sys-color-surface-container); }

.mt-xs { margin-top: var(--md-sys-spacing-xs); }
.mt-sm { margin-top: var(--md-sys-spacing-sm); }
.mt-md { margin-top: var(--md-sys-spacing-md); }
.mt-lg { margin-top: var(--md-sys-spacing-lg); }
.mt-xl { margin-top: var(--md-sys-spacing-xl); }
.mt-2xl { margin-top: var(--md-sys-spacing-2xl); }

.mb-xs { margin-bottom: var(--md-sys-spacing-xs); }
.mb-sm { margin-bottom: var(--md-sys-spacing-sm); }
.mb-md { margin-bottom: var(--md-sys-spacing-md); }
.mb-lg { margin-bottom: var(--md-sys-spacing-lg); }
.mb-xl { margin-bottom: var(--md-sys-spacing-xl); }
.mb-2xl { margin-bottom: var(--md-sys-spacing-2xl); }

.p-xs { padding: var(--md-sys-spacing-xs); }
.p-sm { padding: var(--md-sys-spacing-sm); }
.p-md { padding: var(--md-sys-spacing-md); }
.p-lg { padding: var(--md-sys-spacing-lg); }
.p-xl { padding: var(--md-sys-spacing-xl); }

.rounded-sm { border-radius: var(--md-sys-shape-corner-small); }
.rounded-md { border-radius: var(--md-sys-shape-corner-medium); }
.rounded-lg { border-radius: var(--md-sys-shape-corner-large); }
.rounded-full { border-radius: var(--md-sys-shape-corner-full); }

.elevation-1 { box-shadow: var(--md-sys-elevation-1); }
.elevation-2 { box-shadow: var(--md-sys-elevation-2); }
.elevation-3 { box-shadow: var(--md-sys-elevation-3); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--md-sys-spacing-2xl);
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-2xl);
    color: var(--md-sys-color-on-surface-variant);
}

.loading-container .spinner {
    display: inline-block;
    vertical-align: middle;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-surface-container);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

svg.spinner {
    width: auto;
    height: auto;
    border: none;
    color: var(--md-sys-color-primary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====================================
   HOME PAGE - Layout de dos columnas
   ==================================== */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--md-sys-spacing-xl);
}

@media (max-width: 900px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

.home-column {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    border: 1px solid var(--md-sys-color-outline-variant);
    overflow: hidden;
}

.home-column .section-header {
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-lowest);
}

.home-column .section-title {
    font-size: 1rem;
}

/* Lista compacta de items */
.list-compact {
    display: flex;
    flex-direction: column;
}

.list-item-compact {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    transition: background var(--md-sys-motion-duration-short);
}

.list-item-compact:last-child {
    border-bottom: none;
}

.list-item-compact:hover {
    background: var(--md-sys-color-surface-container-low);
}

.list-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-small);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--md-sys-color-surface-container);
}

.list-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-info {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 var(--md-sys-spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--md-sys-color-on-surface);
}

.list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-sm);
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

.list-item-meta span {
    display: flex;
    align-items: center;
    gap: 2px;
}

.list-item-meta .icon {
    width: 12px;
    height: 12px;
}

.list-item-badge {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.list-item-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

/* Empty state para listas */
.list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--md-sys-spacing-2xl);
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}

.list-empty .icon {
    width: 40px;
    height: 40px;
    opacity: 0.5;
    margin-bottom: var(--md-sys-spacing-sm);
}

.list-empty p {
    font-size: 0.875rem;
    margin-bottom: var(--md-sys-spacing-md);
}

/* Skeleton para lista */
.list-item-compact.skeleton {
    pointer-events: none;
}

.list-item-compact .skeleton-image {
    width: 56px;
    height: 56px;
    animation: shimmer 1.5s infinite;
}

.list-item-compact .skeleton-text {
    height: 12px;
    background: var(--md-sys-color-surface-container);
    border-radius: 4px;
    margin-bottom: 6px;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* =========================================
   PRODUCTO DETALLE - Vista mejorada
   ========================================= */
.producto-detalle-page {
    background: var(--md-sys-color-surface-container-low);
    min-height: calc(100vh - 70px);
    padding-bottom: var(--md-sys-spacing-3xl);
}

.detalle-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--md-sys-spacing-md) 0;
}

.detalle-actions {
    display: flex;
    gap: var(--md-sys-spacing-sm);
}

.btn-icon-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--md-sys-color-on-surface-variant);
}

.btn-icon-lg:hover {
    background: var(--md-sys-color-surface-container);
    border-color: var(--md-sys-color-outline);
}

.btn-icon-lg.active {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
}

.btn-icon-lg .icon {
    width: 22px;
    height: 22px;
}

/* Grid principal */
.producto-detalle-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--md-sys-spacing-xl);
    margin-bottom: var(--md-sys-spacing-xl);
}

/* Galería */
.producto-galeria {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
}

.galeria-main {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--md-sys-color-surface-container);
}

.galeria-principal {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.galeria-badge {
    position: absolute;
    top: var(--md-sys-spacing-md);
    left: var(--md-sys-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-sm);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-subasta {
    background: #fef3c7;
    color: #92400e;
}

.galeria-thumbs {
    display: flex;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-md);
    overflow-x: auto;
    scrollbar-width: thin;
}

.galeria-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--md-sys-shape-corner-small);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0;
    background: var(--md-sys-color-surface-container);
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.galeria-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galeria-thumb:hover {
    border-color: var(--md-sys-color-outline);
}

.galeria-thumb.active {
    border-color: var(--md-sys-color-primary);
}

/* Info del producto */
.producto-info-section {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-lg);
}

.producto-header {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-1);
}

.producto-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-sm);
    margin-bottom: var(--md-sys-spacing-md);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag .icon {
    width: 14px;
    height: 14px;
}

.tag-categoria {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
}

/* Colores de categoría para tags */
.tag-categoria[data-cat-color="motor"] { background: #fef2f2; color: #dc2626; }
.tag-categoria[data-cat-color="transmision"] { background: #faf5ff; color: #9333ea; }
.tag-categoria[data-cat-color="suspension"] { background: #eff6ff; color: #2563eb; }
.tag-categoria[data-cat-color="frenos"] { background: #fdf2f8; color: #db2777; }
.tag-categoria[data-cat-color="interior"] { background: #f0fdfa; color: #0d9488; }
.tag-categoria[data-cat-color="exterior"] { background: #ecfeff; color: #0891b2; }
.tag-categoria[data-cat-color="electrico"] { background: #fffbeb; color: #d97706; }
.tag-categoria[data-cat-color="ruedas"] { background: #f8fafc; color: #475569; }
.tag-categoria[data-cat-color="escape"] { background: #fafaf9; color: #57534e; }
.tag-categoria[data-cat-color="accesorios"] { background: #f0fdf4; color: #16a34a; }
.tag-categoria[data-cat-color="coche"] { background: #eef2ff; color: #4f46e5; }
.tag-categoria[data-cat-color="capota"] { background: #f5f3ff; color: #7c3aed; }
.tag-categoria[data-cat-color="otros"] { background: #f9fafb; color: #4b5563; }

.tag-estado {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
}

.tag-estado.tag-nuevo { background: #dcfce7; color: #166534; }
.tag-estado.tag-seminuevo { background: #dbeafe; color: #1e40af; }
.tag-estado.tag-usado { background: #fef3c7; color: #92400e; }
.tag-estado.tag-para_piezas { background: #fee2e2; color: #991b1b; }

.tag-feature {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.producto-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-sm);
    line-height: 1.3;
}

.producto-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-md);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
}

.producto-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.producto-meta .icon {
    width: 16px;
    height: 16px;
}

/* Precio card */
.producto-precio-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-1);
}

.precio-venta {
    text-align: center;
}

.precio-label {
    display: block;
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: var(--md-sys-spacing-xs);
}

.precio-amount {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--md-sys-color-primary);
}

/* Acciones */
.producto-acciones {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-sm);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
}

.btn-outline:hover {
    background: var(--md-sys-color-surface-container);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-primary);
}

/* Vendedor card */
.vendedor-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
}

.vendedor-header {
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.vendedor-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-on-surface-variant);
}

.vendedor-info {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    transition: background 0.15s ease;
}

.vendedor-info:hover {
    background: var(--md-sys-color-surface-container-low);
}

.vendedor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--md-sys-color-primary-container);
    flex-shrink: 0;
}

.vendedor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vendedor-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-primary-container);
}

.vendedor-datos {
    flex: 1;
    min-width: 0;
}

.vendedor-datos h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 2px;
}

.vendedor-username {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

.vendedor-arrow {
    color: var(--md-sys-color-on-surface-variant);
}

.vendedor-arrow .icon {
    width: 20px;
    height: 20px;
}

/* Descripción section */
.producto-descripcion-section {
    margin-top: var(--md-sys-spacing-lg);
}

.producto-descripcion-section .card-header {
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.producto-descripcion-section .card-header h3 {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.descripcion-texto {
    line-height: 1.7;
    color: var(--md-sys-color-on-surface);
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 992px) {
    .producto-detalle-grid {
        grid-template-columns: 1fr;
    }
    
    .producto-galeria-section {
        order: 1;
    }
    
    .producto-info-section {
        order: 2;
    }
}

@media (max-width: 768px) {
    .producto-detalle-page {
        background: var(--md-sys-color-surface);
    }
    
    .producto-header,
    .producto-precio-card,
    .vendedor-card,
    .producto-galeria {
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--md-sys-color-outline-variant);
    }
    
    .producto-titulo {
        font-size: 1.25rem;
    }
    
    .precio-amount {
        font-size: 1.75rem;
    }
    
    .galeria-thumb {
        width: 60px;
        height: 60px;
    }
}

/* =========================================
   EVENTO DETALLE - Vista mejorada
   ========================================= */
.evento-detalle-page {
    background: var(--md-sys-color-surface-container-low);
    min-height: calc(100vh - 70px);
    padding-bottom: var(--md-sys-spacing-3xl);
}

/* Hero del evento */
.evento-hero {
    background: var(--md-sys-color-surface);
    margin-bottom: var(--md-sys-spacing-xl);
}

.evento-hero-image {
    position: relative;
    max-height: 400px;
    overflow: hidden;
    background: var(--md-sys-color-surface-container);
}

.evento-hero-image img {
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: cover;
}

.evento-badge-past {
    position: absolute;
    top: var(--md-sys-spacing-md);
    left: var(--md-sys-spacing-md);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.8125rem;
    font-weight: 600;
}

.evento-hero .galeria-thumbs {
    padding: var(--md-sys-spacing-md) 0;
}

/* Grid principal */
.evento-detalle-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--md-sys-spacing-xl);
    max-width: 100%;
    overflow: hidden;
}

/* Columna principal */
.evento-main-section {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-lg);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Header card */
.evento-header-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-xl);
    box-shadow: var(--md-sys-elevation-1);
}

.evento-titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-lg);
    line-height: 1.3;
}

.evento-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--md-sys-spacing-md);
}

.evento-info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-medium);
}

.evento-info-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-small);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.evento-info-icon .icon {
    width: 20px;
    height: 20px;
}

/* Colores para cada tipo de info */
.evento-info-item.color-fecha .evento-info-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.evento-info-item.color-hora .evento-info-icon {
    background: #fef3c7;
    color: #d97706;
}

.evento-info-item.color-ubicacion .evento-info-icon {
    background: #dcfce7;
    color: #16a34a;
}

.evento-info-item.color-asistentes .evento-info-icon {
    background: #f3e8ff;
    color: #9333ea;
}

/* Cards con colores */
.card.card-info {
    border-left: 4px solid #3b82f6;
}

.card.card-info .card-header h3 {
    color: #1d4ed8;
}

.card.card-ubicacion {
    border-left: 4px solid #22c55e;
}

.card.card-ubicacion .card-header h3 {
    color: #16a34a;
}

.evento-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.evento-info-label {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.evento-info-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* Sidebar */
.evento-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-lg);
}

/* Card de inscripción */
.inscripcion-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-1);
}

.inscripcion-card.past {
    background: var(--md-sys-color-surface-container);
}

.inscripcion-past {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-sm);
    color: var(--md-sys-color-on-surface-variant);
    padding: var(--md-sys-spacing-md);
}

.inscripcion-past-icon {
    opacity: 0.5;
}

.plazas-progress {
    margin-bottom: var(--md-sys-spacing-lg);
}

.plazas-info {
    display: flex;
    align-items: baseline;
    gap: var(--md-sys-spacing-xs);
    margin-bottom: var(--md-sys-spacing-sm);
}

.plazas-count {
    font-size: 2rem;
    font-weight: 800;
    color: var(--md-sys-color-primary);
}

.plazas-total {
    font-size: 1rem;
    color: var(--md-sys-color-on-surface-variant);
}

.plazas-bar {
    height: 8px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-full);
    overflow: hidden;
}

.plazas-fill {
    height: 100%;
    background: var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-full);
    transition: width 0.3s ease;
}

.plazas-full {
    display: block;
    text-align: center;
    margin-top: var(--md-sys-spacing-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626;
}

.asistentes-count {
    text-align: center;
    margin-bottom: var(--md-sys-spacing-lg);
}

.asistentes-numero {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--md-sys-color-primary);
}

.asistentes-label {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.inscripcion-action .btn {
    width: 100%;
    justify-content: center;
}

/* Organizador card */
.organizador-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
}

.organizador-header {
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.organizador-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-on-surface-variant);
}

.organizador-info {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    transition: background 0.15s ease;
}

.organizador-info:hover {
    background: var(--md-sys-color-surface-container-low);
}

.organizador-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--md-sys-color-primary-container);
    flex-shrink: 0;
}

.organizador-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.organizador-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-primary-container);
}

.organizador-datos {
    flex: 1;
    min-width: 0;
}

.organizador-datos h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 2px;
}

.organizador-username {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

.organizador-arrow {
    color: var(--md-sys-color-on-surface-variant);
}

/* Share card */
.share-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-1);
    text-align: center;
}

.share-label {
    display: block;
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: var(--md-sys-spacing-md);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: var(--md-sys-spacing-sm);
}

.btn-share-social {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.btn-share-social:hover {
    transform: scale(1.1);
}

.btn-share-social.whatsapp {
    background: #25d366;
    color: white;
}

.btn-share-social.copy {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
}

.btn-share-social .icon {
    width: 22px;
    height: 22px;
}

/* Card estilos compartidos */
.evento-main-section .card {
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-1);
}

.evento-main-section .card-header {
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.evento-main-section .card-header h3 {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.evento-main-section .card-footer {
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive */
@media (max-width: 992px) {
    .evento-detalle-grid {
        grid-template-columns: 1fr;
    }
    
    .evento-sidebar-section {
        order: -1;
    }
}

@media (max-width: 768px) {
    .evento-detalle-page {
        background: var(--md-sys-color-surface);
    }
    
    .evento-hero {
        margin-bottom: 0;
    }
    
    .evento-hero-image {
        max-height: 250px;
    }
    
    .evento-header-card,
    .inscripcion-card,
    .organizador-card,
    .share-card,
    .evento-main-section .card {
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--md-sys-color-outline-variant);
    }
    
    .evento-titulo {
        font-size: 1.25rem;
    }
    
    .evento-info-grid {
        grid-template-columns: 1fr;
    }
    
    .evento-detalle-grid {
        gap: 0;
    }
}

/* =========================================
   MI CUENTA - Página de perfil
   ========================================= */

/* Hero del perfil */
.mi-cuenta-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: var(--md-sys-spacing-3xl) 0 var(--md-sys-spacing-2xl);
    margin-bottom: var(--md-sys-spacing-xl);
    overflow: hidden;
}

.mi-cuenta-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.85) 0%, rgba(49, 46, 129, 0.9) 100%);
}

.mi-cuenta-header {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xl);
    color: white;
    position: relative;
    z-index: 1;
}

.mi-cuenta-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.mi-cuenta-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.3);
    background: var(--md-sys-color-surface);
}

.mi-cuenta-avatar-edit {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    color: var(--md-sys-color-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-2);
    transition: transform 0.15s ease;
}

.mi-cuenta-avatar-edit:hover {
    transform: scale(1.1);
}

.mi-cuenta-info {
    flex: 1;
}

.mi-cuenta-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 var(--md-sys-spacing-xs);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mi-cuenta-username {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0 0 var(--md-sys-spacing-sm);
}

.mi-cuenta-email {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0;
}

.mi-cuenta-email .icon {
    width: 16px;
    height: 16px;
}

.mi-cuenta-code {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    font-size: 0.8125rem;
    font-family: monospace;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: var(--md-sys-shape-corner-small);
    margin: var(--md-sys-spacing-xs) 0;
    width: fit-content;
}

.mi-cuenta-code .icon {
    width: 14px;
    height: 14px;
}

.mi-cuenta-actions {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-sm);
}

.mi-cuenta-actions .btn {
    white-space: nowrap;
}

.mi-cuenta-actions .btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(4px);
}

.mi-cuenta-actions .btn-ghost {
    color: rgba(255,255,255,0.9);
}

/* Content section */
.mi-cuenta-content {
    padding-bottom: var(--md-sys-spacing-3xl);
}

/* Stats */
.mi-cuenta-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--md-sys-spacing-md);
    margin-bottom: var(--md-sys-spacing-xl);
    margin-top: calc(var(--md-sys-spacing-xl) * -1);
    position: relative;
    z-index: 10;
}

.stat-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    box-shadow: var(--md-sys-elevation-2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--md-sys-elevation-3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .icon {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--md-sys-color-on-surface);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 2px;
}

/* Quick actions */
.mi-cuenta-quick-actions {
    margin-bottom: var(--md-sys-spacing-xl);
}

.mi-cuenta-quick-actions .section-title {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--md-sys-spacing-md);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--md-sys-spacing-md);
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-lg);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    border: 1px solid var(--md-sys-color-outline-variant);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    transition: all 0.15s ease;
}

.quick-action-card:hover {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-2);
    text-decoration: none;
}

.quick-action-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--md-sys-shape-corner-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-action-icon.event {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
    color: #92400e;
}

.quick-action-icon.product {
    background: linear-gradient(135deg, #dbeafe, #60a5fa);
    color: #1e40af;
}

.quick-action-icon.comunidad {
    background: linear-gradient(135deg, #d1fae5, #34d399);
    color: #065f46;
}

.quick-action-icon .icon {
    width: 26px;
    height: 26px;
}

.quick-action-info {
    flex: 1;
    min-width: 0;
}

.quick-action-title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.quick-action-desc {
    display: block;
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

.quick-action-arrow {
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

/* Tabs */
.mi-cuenta-tabs {
    display: flex;
    gap: var(--md-sys-spacing-sm);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    margin-bottom: var(--md-sys-spacing-lg);
    overflow-x: auto;
    scrollbar-width: none;
}

.mi-cuenta-tabs::-webkit-scrollbar {
    display: none;
}

.mi-cuenta-tab {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.mi-cuenta-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    border-radius: 2px 2px 0 0;
    transition: background 0.15s ease;
}

.mi-cuenta-tab:hover {
    color: var(--md-sys-color-on-surface);
}

.mi-cuenta-tab.active {
    color: var(--md-sys-color-primary);
}

.mi-cuenta-tab.active::after {
    background: var(--md-sys-color-primary);
}

.mi-cuenta-tab .icon {
    width: 18px;
    height: 18px;
}

/* Tab panels */
.mi-cuenta-tab-content {
    position: relative;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Mi Cuenta */
@media (max-width: 992px) {
    .mi-cuenta-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mi-cuenta-hero {
        padding: var(--md-sys-spacing-xl) 0 var(--md-sys-spacing-lg);
    }
    
    .mi-cuenta-header {
        flex-direction: column;
        text-align: center;
        gap: var(--md-sys-spacing-md);
    }
    
    .mi-cuenta-avatar {
        width: 100px;
        height: 100px;
    }
    
    .mi-cuenta-name {
        font-size: 1.5rem;
    }
    
    .mi-cuenta-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .mi-cuenta-stats {
        grid-template-columns: repeat(2, 1fr);
        margin-top: var(--md-sys-spacing-md);
    }
    
    .stat-card {
        padding: var(--md-sys-spacing-md);
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .mi-cuenta-tab {
        padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .mi-cuenta-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: var(--md-sys-spacing-md);
    }
}

/* Comunidades list en mi-cuenta */
.comunidades-list {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-sm);
}

.comunidad-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    transition: all 0.15s ease;
}

.comunidad-item:hover {
    background: var(--md-sys-color-surface-container-high);
    transform: translateX(4px);
}

.comunidad-item.unread {
    background: var(--md-sys-color-primary-container);
}

.comunidad-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--md-sys-color-surface-container-high);
    flex-shrink: 0;
}

.comunidad-info {
    flex: 1;
    min-width: 0;
}

.comunidad-name {
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
}

.comunidad-name .icon {
    width: 14px;
    height: 14px;
    color: var(--md-sys-color-on-surface-variant);
}

.comunidad-meta,
.comunidad-rol {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 2px;
}

.comunidad-item .badge {
    flex-shrink: 0;
}

/* =========================================
   CHAT Y LLAMADAS
   ========================================= */

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 80px;
    right: var(--md-sys-spacing-md);
    z-index: 2000;
    display: none;
}

.chat-container.open {
    display: block;
}

.chat-panel {
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--md-sys-spacing-md);
    background: var(--md-sys-color-primary);
    color: white;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.chat-header .btn-icon {
    color: white;
    background: rgba(255,255,255,0.1);
}

.chat-header .btn-icon:hover {
    background: rgba(255,255,255,0.2);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.chat-title-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    background: var(--md-sys-color-surface-container-low);
}

/* Lista de conversaciones */
.conversation-list {
    display: flex;
    flex-direction: column;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md);
    cursor: pointer;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    transition: background 0.15s ease;
}

.conversation-item:hover {
    background: var(--md-sys-color-surface-container);
}

.conversation-item.unread {
    background: var(--md-sys-color-primary-container);
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.conversation-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--md-sys-color-on-surface);
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

.conversation-product {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--md-sys-color-primary);
    margin-bottom: 2px;
}

.conversation-product .icon {
    width: 12px;
    height: 12px;
}

.conversation-preview {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--md-sys-color-primary);
    color: white;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat vacío */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--md-sys-spacing-xl);
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}

.chat-empty .icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--md-sys-spacing-md);
    opacity: 0.5;
}

.chat-empty p {
    font-weight: 500;
    margin-bottom: var(--md-sys-spacing-xs);
}

.chat-empty span {
    font-size: 0.8125rem;
}

/* Banner de producto en chat */
.chat-product-banner {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.chat-product-banner img {
    width: 44px;
    height: 44px;
    border-radius: var(--md-sys-shape-corner-small);
    object-fit: cover;
}

.chat-product-info {
    flex: 1;
    min-width: 0;
}

.chat-product-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-product-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

/* Mensajes */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--md-sys-spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-sm);
}

.chat-empty-messages {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
}

.chat-message {
    max-width: 80%;
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-medium);
    position: relative;
}

.chat-message.own {
    align-self: flex-end;
    background: var(--md-sys-color-primary);
    color: white;
    border-bottom-right-radius: var(--md-sys-shape-corner-extra-small);
}

.chat-message.other {
    align-self: flex-start;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border-bottom-left-radius: var(--md-sys-shape-corner-extra-small);
    box-shadow: var(--md-sys-elevation-1);
}

.message-content {
    font-size: 0.9375rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.message-time {
    font-size: 0.6875rem;
    opacity: 0.7;
}

.message-status {
    font-size: 0.6875rem;
    opacity: 0.7;
}

/* Mensaje de llamada */
.chat-message-call {
    align-self: center;
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

.chat-message-call.llamada_completada .icon {
    color: #22c55e;
}

.chat-message-call.llamada_perdida .icon {
    color: #ef4444;
}

/* Input de chat */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface);
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.chat-actions {
    display: flex;
    gap: 4px;
}

.chat-input {
    flex: 1;
    border: none;
    background: var(--md-sys-color-surface-container);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 0.9375rem;
    outline: none;
}

.chat-input:focus {
    background: var(--md-sys-color-surface-container-high);
}

.btn-send {
    background: var(--md-sys-color-primary);
    color: white;
}

.btn-send:hover {
    background: var(--md-sys-color-primary-hover);
}

.btn-call {
    color: var(--md-sys-color-primary);
}

/* Botón flotante de chat */
.chat-fab {
    position: fixed;
    bottom: var(--md-sys-spacing-lg);
    right: var(--md-sys-spacing-lg);
    width: 56px;
    height: 56px;
    background: var(--md-sys-color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1999;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.chat-fab .icon {
    width: 28px;
    height: 28px;
}

.chat-fab .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: #ef4444;
    color: white;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Overlay de llamada */
#call-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

#call-overlay.active {
    display: flex;
}

.call-container {
    text-align: center;
    color: white;
    padding: var(--md-sys-spacing-xl);
}

.call-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--md-sys-spacing-xl);
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,0.2);
    animation: pulse-ring 2s ease infinite;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.3); }
    50% { box-shadow: 0 0 0 20px rgba(255,255,255,0); }
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 var(--md-sys-spacing-sm);
}

.call-status {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0 0 var(--md-sys-spacing-md);
}

.call-timer {
    font-size: 2rem;
    font-weight: 300;
    font-family: monospace;
    margin-bottom: var(--md-sys-spacing-xl);
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: var(--md-sys-spacing-xl);
    margin-bottom: var(--md-sys-spacing-2xl);
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn .icon {
    width: 28px;
    height: 28px;
    color: white;
}

.call-accept {
    background: #22c55e;
}

.call-end {
    background: #ef4444;
}

.call-note {
    font-size: 0.8125rem;
    opacity: 0.6;
    line-height: 1.6;
}

.call-note .icon {
    vertical-align: middle;
    margin-right: 4px;
}

/* Responsive chat */
@media (max-width: 768px) {
    .chat-container {
        bottom: 70px;
        right: 0;
        left: 0;
    }
    
    .chat-panel {
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 140px);
        max-height: none;
        border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
    }
    
    .chat-fab {
        bottom: 80px;
        right: var(--md-sys-spacing-md);
    }
}

/* ==========================================
   PÁGINA DE MENSAJES
   ========================================== */

.mensajes-page {
    padding-top: var(--md-sys-spacing-lg);
    padding-bottom: var(--md-sys-spacing-lg);
    height: calc(100vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mensajes-page .page-header {
    margin-bottom: var(--md-sys-spacing-lg);
}

.mensajes-page .page-header h1 {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    font-size: 1.5rem;
    font-weight: 600;
}

.mensajes-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
    flex: 1;
    min-height: 0; /* Importante para que funcione el scroll interno */
}

/* Panel de conversaciones */
.conversaciones-panel {
    border-right: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    background: var(--md-sys-color-surface-container-low);
    overflow: hidden;
    min-height: 0;
}

.conversaciones-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.conversaciones-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* Búsqueda de usuario por código */
.conversaciones-search {
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    background: var(--md-sys-color-surface-container-low);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.search-input-wrapper {
    display: flex;
    gap: var(--md-sys-spacing-xs);
}

.search-input-wrapper .form-input {
    flex: 1;
    font-family: monospace;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

#resultado-busqueda-usuario {
    margin-top: var(--md-sys-spacing-sm);
}

.search-result-user {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
}

.search-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--md-sys-color-surface-container);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-user-info {
    flex: 1;
    min-width: 0;
}

.search-user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
}

.search-user-code {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    font-family: monospace;
}

.search-user-actions {
    display: flex;
    gap: var(--md-sys-spacing-xs);
}

.search-loading,
.search-error,
.search-not-found {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    font-size: 0.8125rem;
    border-radius: var(--md-sys-shape-corner-small);
}

.search-loading {
    color: var(--md-sys-color-on-surface-variant);
}

.search-error {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.search-not-found {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
}

.conversaciones-list {
    flex: 1;
    overflow-y: auto;
}

.conversacion-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.conversacion-item:hover {
    background: var(--md-sys-color-surface-container);
}

.conversacion-item.active {
    background: var(--md-sys-color-primary-container);
}

.conversacion-item.unread {
    background: var(--md-sys-color-surface-container-high);
}

.conversacion-item.unread .conversacion-nombre {
    font-weight: 700;
}

.conversacion-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--md-sys-color-surface-container);
}

.conversacion-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversacion-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
}

.conversacion-info {
    flex: 1;
    min-width: 0;
}

.conversacion-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.conversacion-nombre {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversacion-vendedor {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    margin-bottom: 2px;
}

.conversacion-tiempo {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.conversacion-preview {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

.conversacion-preview p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversacion-preview .text-muted {
    opacity: 0.6;
    font-style: italic;
}

.conversacion-avatar .producto-thumb {
    border-radius: var(--md-sys-shape-corner-small);
}

.conversacion-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--md-sys-color-primary);
    color: white;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-conversaciones {
    padding: var(--md-sys-spacing-xl);
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-conversaciones .icon {
    width: 48px;
    height: 48px;
    opacity: 0.5;
    margin-bottom: var(--md-sys-spacing-md);
}

.empty-conversaciones p {
    font-weight: 500;
    margin-bottom: var(--md-sys-spacing-xs);
}

.empty-conversaciones span {
    font-size: 0.875rem;
}

/* Panel de chat principal */
.chat-panel-main {
    display: flex;
    flex-direction: column;
    background: var(--md-sys-color-surface);
    overflow: hidden;
    min-height: 0; /* Importante para que flex funcione con overflow */
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
    padding: var(--md-sys-spacing-xl);
}

.chat-empty-state .icon {
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: var(--md-sys-spacing-lg);
}

.chat-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: var(--md-sys-spacing-xs);
}

.chat-empty-state p {
    font-size: 0.875rem;
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-low);
}

.chat-header-main .btn-back-chat {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.chat-user-info:hover {
    opacity: 0.8;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--md-sys-color-surface-container);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-user-details {
    display: flex;
    flex-direction: column;
}

.chat-user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--md-sys-color-on-surface);
}

.chat-producto {
    font-size: 0.75rem;
    color: var(--md-sys-color-primary);
}

.chat-actions {
    display: flex;
    gap: var(--md-sys-spacing-xs);
}

.chat-messages-main {
    flex: 1;
    overflow-y: auto;
    padding: var(--md-sys-spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-sm);
}

/* Mini card de producto en chat */
.chat-producto-card {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface-container);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.chat-producto-card:hover {
    background: var(--md-sys-color-surface-container-high);
}

.chat-producto-foto {
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--md-sys-color-surface-container-highest);
}

.chat-producto-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-producto-no-foto {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
}

.chat-producto-info {
    flex: 1;
    min-width: 0;
}

.chat-producto-titulo {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--md-sys-color-on-surface);
}

.chat-producto-descripcion {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-producto-meta {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    flex-wrap: wrap;
}

.chat-producto-precio {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

.chat-producto-ubicacion {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 2px;
}

.chat-producto-ubicacion .icon {
    width: 14px;
    height: 14px;
}

.chat-producto-arrow {
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.chat-producto-arrow .icon {
    width: 20px;
    height: 20px;
}

.chat-empty-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
}

.chat-empty-messages p {
    font-weight: 500;
}

.chat-empty-messages span {
    font-size: 0.875rem;
}

.mensaje {
    max-width: 75%;
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-large);
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.mensaje.enviado {
    align-self: flex-end;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-bottom-right-radius: 4px;
    margin-left: 20%;
}

.mensaje.recibido {
    align-self: flex-start;
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-bottom-left-radius: 4px;
    margin-right: 20%;
}

.mensaje p {
    margin: 0;
    word-wrap: break-word;
}

.mensaje-hora {
    display: block;
    font-size: 0.6875rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.mensaje.recibido .mensaje-hora {
    text-align: left;
}

.llamada-info {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    font-size: 0.8125rem;
}

.llamada-info.missed {
    color: #ef4444;
}

.llamada-info.completed .icon {
    color: #22c55e;
}

.chat-input-main {
    display: flex;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-low);
}

.chat-input-main .form-input {
    flex: 1;
}

.chat-loading,
.chat-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-md);
}

/* Nav badges */
.nav-link {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    border-radius: 9px;
    font-size: 0.6875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-link {
    position: relative;
}

.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 24px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: white;
    border-radius: 8px;
    font-size: 0.625rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive mensajes */
@media (max-width: 768px) {
    .mensajes-layout {
        grid-template-columns: 1fr;
        height: calc(100vh - 180px);
    }
    
    .conversaciones-panel {
        border-right: none;
    }
    
    .chat-panel-main {
        position: fixed;
        inset: 0;
        z-index: 2000;
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }
    
    .chat-panel-main.active {
        transform: translateX(0);
    }
    
    .chat-header-main .btn-back-chat {
        display: flex;
    }
}

/* Fotos existentes en edición */
.fotos-existentes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--md-sys-spacing-md);
    margin-bottom: var(--md-sys-spacing-md);
}

.foto-existente {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    background: var(--md-sys-color-surface-container);
}

.foto-existente img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-existente .btn-eliminar-foto {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.foto-existente .btn-eliminar-foto:hover {
    background: #ef4444;
}

.foto-existente .preview-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--md-sys-color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
}

/* Zona peligrosa */
.danger-zone {
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding-top: var(--md-sys-spacing-lg);
}

.danger-zone h3 {
    color: #ef4444;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* =====================================================
   SISTEMA DE VALORACIONES Y RESEÑAS
   ===================================================== */

/* Estrellas */
.estrellas {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.estrella {
    color: var(--md-sys-color-outline);
}

.estrella.llena,
.estrella.media {
    color: #f59e0b;
}

.estrella .icon {
    width: 18px;
    height: 18px;
}

/* Valoración en perfil */
.perfil-valoracion {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    margin: var(--md-sys-spacing-sm) 0;
}

.perfil-valoracion-media {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.perfil-valoracion-total {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* Rating input en modal */
.rating-input {
    display: flex;
    gap: var(--md-sys-spacing-sm);
    justify-content: center;
    padding: var(--md-sys-spacing-md) 0;
}

.rating-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--md-sys-spacing-xs);
    color: var(--md-sys-color-outline);
    transition: color 0.15s, transform 0.15s;
}

.rating-star:hover,
.rating-star.active {
    color: #f59e0b;
    transform: scale(1.2);
}

.rating-star .icon {
    width: 32px;
    height: 32px;
}

/* Estadísticas de reseñas */
.resenas-stats {
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-lg);
    margin-bottom: var(--md-sys-spacing-lg);
}

.resenas-stats-general {
    display: flex;
    gap: var(--md-sys-spacing-xl);
    flex-wrap: wrap;
}

.resenas-stats-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    min-width: 120px;
}

.stats-numero {
    font-size: 3rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    line-height: 1;
}

.stats-total {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.resenas-stats-desglose {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-xs);
    min-width: 200px;
}

.stats-barra {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.stats-barra-label {
    width: 45px;
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 2px;
}

.stats-barra-label .icon {
    color: #f59e0b;
}

.stats-barra-track {
    flex: 1;
    height: 8px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: 4px;
    overflow: hidden;
}

.stats-barra-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stats-barra-count {
    width: 30px;
    text-align: right;
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* Lista de reseñas */
.resenas-lista {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-md);
}

.resena-card {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-md);
}

.resena-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--md-sys-spacing-md);
    margin-bottom: var(--md-sys-spacing-sm);
}

.resena-autor {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.resena-autor-foto {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.resena-autor-nombre {
    display: block;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.resena-tipo {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

.resena-rating .estrellas .icon {
    width: 16px;
    height: 16px;
}

.resena-comentario {
    color: var(--md-sys-color-on-surface);
    line-height: 1.5;
    margin: var(--md-sys-spacing-sm) 0;
}

.resena-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: var(--md-sys-spacing-sm);
    padding-top: var(--md-sys-spacing-sm);
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.resena-producto {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Chat: Banner trato cerrado */
.chat-trato-cerrado {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.chat-trato-cerrado a {
    color: white;
    text-decoration: underline;
}

.chat-trato-cerrado .icon {
    width: 18px;
    height: 18px;
}

/* Chat: Username bajo nombre */
.chat-user-username {
    display: block;
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* Botón success */
.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--md-sys-elevation-5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.modal-body {
    padding: var(--md-sys-spacing-lg);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

/* Check circle icon */
.icon-check-circle {
    color: #10b981;
}

/* =====================================================
   BOTONES CIRCULARES
   ===================================================== */

.btn-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.btn-circle:hover {
    background: var(--md-sys-color-surface-container-highest);
}

.btn-circle:active {
    transform: scale(0.95);
}

.btn-circle .icon {
    width: 20px;
    height: 20px;
}

/* =====================================================
   CHAT HEADER MEJORADO
   ===================================================== */

.chat-header-main {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface);
    min-height: 60px;
}

.chat-header-main .btn-back-chat {
    background: transparent;
}

.chat-header-main .btn-back-chat:hover {
    background: var(--md-sys-color-surface-container);
}

.chat-avatar-header {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    color: var(--md-sys-color-on-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.chat-username-link {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-user-info:hover .chat-username-link {
    color: var(--md-sys-color-primary);
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    flex-shrink: 0;
}

/* =====================================================
   CHAT INPUT MEJORADO
   ===================================================== */

.chat-input-main {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface);
}

.chat-input-main .form-input {
    flex: 1;
    border-radius: 20px;
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface-container);
    border: none;
}

.btn-attach {
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
}

.btn-attach:hover {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-primary);
}

.btn-send {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-send:hover {
    background: var(--md-sys-color-primary);
    filter: brightness(1.1);
}

/* =====================================================
   MENSAJES MULTIMEDIA
   ===================================================== */

.mensaje-media {
    max-width: 250px;
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    cursor: pointer;
}

.mensaje-media img {
    width: 100%;
    display: block;
    transition: opacity 0.2s;
}

.mensaje-media img:hover {
    opacity: 0.9;
}

.mensaje-video {
    position: relative;
}

.mensaje-video video {
    width: 100%;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

.btn-play-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.btn-play-video:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.btn-play-video .icon {
    width: 28px;
    height: 28px;
}

.btn-fullscreen-video {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.mensaje-video:hover .btn-fullscreen-video {
    opacity: 1;
}

.btn-fullscreen-video .icon {
    width: 18px;
    height: 18px;
}

/* Video fullscreen modal */
.video-fullscreen-modal {
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999 !important;
}

.video-fullscreen-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-fullscreen-container video {
    max-width: 100%;
    max-height: 100%;
}

.btn-close-video {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-close-video:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mensaje de sistema */
.mensaje-sistema {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-xs);
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-sm);
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

.mensaje-sistema .icon {
    color: #10b981;
}

.mensaje.mensaje-trato_cerrado {
    background: transparent !important;
    align-self: center;
    max-width: 100%;
}

/* =====================================================
   DRAWER HEADER MEJORADO
   ===================================================== */

@media (max-width: 768px) {
    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
        border-bottom: 1px solid var(--md-sys-color-outline-variant);
        gap: var(--md-sys-spacing-sm);
    }
    
    .drawer-header h3 {
        flex: 1;
        text-align: center;
        margin: 0;
        font-size: 1rem;
        font-weight: 500;
    }
    
    .drawer-header .btn-circle {
        background: transparent;
    }
}
