/* ============================================================
   DELOX — Stile Subito.it + Tinder
   Modern, bold, mobile-first
   ============================================================ */

:root {
    --red: #FF4B4B;
    --red-dark: #E03E3E;
    --purple: #6C5CE7;
    --purple-dark: #5A4BD1;
    --green: #00B894;
    --green-dark: #00A381;
    --yellow: #FDCB6E;
    --orange: #FF7675;
    --blue: #0984E3;
    --dark: #0F0F0F;
    --dark-2: #1A1A2E;
    --dark-3: #2D2D44;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    --bg: #F5F5F7;
    --card: #FFFFFF;
    --border: #E5E7EB;
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }
a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 520px; }
.container-md { max-width: 800px; }

/* ---- Typography ---- */
h1,h2,h3,h4 { font-weight: 800; line-height: 1.2; letter-spacing: -.02em; color: var(--gray-900); }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.375rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .625rem 1.5rem; border-radius: var(--radius); font-weight: 700;
    font-size: .9375rem; cursor: pointer; transition: all var(--transition);
    border: 2px solid transparent; font-family: var(--font); text-decoration: none;
    line-height: 1.4; white-space: nowrap; position: relative; overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; box-shadow: 0 4px 14px rgba(255,75,75,.4); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: var(--purple-dark); color: #fff; box-shadow: 0 4px 14px rgba(108,92,231,.4); }
.btn-blue { background: #3498db; color: #fff; }
.btn-blue:hover { background: #2980b9; color: #fff; box-shadow: 0 4px 14px rgba(52,152,219,.4); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-dark { background: var(--gray-900); color: #fff; }
.btn-dark:hover { background: var(--dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: .375rem .875rem; font-size: .8125rem; border-radius: 8px; }
.btn-lg { padding: .875rem 2rem; font-size: 1.0625rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn-icon.sm { width: 32px; height: 32px; font-size: .75rem; }

/* ---- Cards ---- */
.card {
    background: var(--card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    overflow: hidden; transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 1.25rem; }

/* ---- Badge ---- */
.badge {
    display: inline-flex; align-items: center; padding: .125rem .625rem;
    border-radius: var(--radius-full); font-size: .6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
}
.badge-red { background: rgba(255,75,75,.1); color: var(--red); }
.badge-green { background: rgba(0,184,148,.1); color: var(--green); }
.badge-purple { background: rgba(108,92,231,.1); color: var(--purple); }
.badge-yellow { background: rgba(253,203,110,.15); color: #D68910; }
.badge-danger { background: rgba(239,68,68,.1); color: var(--danger); }
.badge-count {
    background: var(--red); color: #fff; min-width: 18px; height: 18px;
    border-radius: 9px; font-size: .625rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: .5rem; font-weight: 700; font-size: .8125rem; color: var(--gray-700); text-transform: uppercase; letter-spacing: .04em; }
.form-input, .form-select, .form-textarea, select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"], input[type="date"], input[type="search"], textarea {
    width: 100%; padding: .75rem 1rem; border: 2px solid var(--gray-200);
    border-radius: var(--radius); font-size: .9375rem; font-family: var(--font);
    transition: all var(--transition); background: var(--white); color: var(--gray-900);
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus, select:focus, input:focus, textarea:focus {
    border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,75,75,.12);
}
textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: .75rem; color: var(--gray-500); margin-top: .25rem; }
.form-check { display: flex; align-items: flex-start; gap: .75rem; }
.form-check input[type="checkbox"] { margin-top: .3rem; accent-color: var(--red); width: 18px; height: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Alerts */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: .9375rem; font-weight: 500; }
.alert-error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }

/* ---- Navbar ---- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.92); backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: .625rem; text-decoration: none; }
.logo-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--red), var(--purple));
    color: #fff; font-weight: 900; font-size: .875rem;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: -.03em;
}
.logo-text { font-weight: 900; font-size: 1.375rem; color: var(--gray-900); letter-spacing: -.03em; }
.nav-links { display: flex; align-items: center; gap: .125rem; }
.nav-link {
    padding: .5rem .875rem; border-radius: var(--radius); font-weight: 600;
    font-size: .875rem; color: var(--gray-600); transition: all var(--transition);
    text-decoration: none; display: flex; align-items: center; gap: .375rem;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-link.active { background: rgba(255,75,75,.08); color: var(--red); }
.nav-link .badge-count { margin-left: 2px; }
.nav-admin { color: var(--purple) !important; font-weight: 700; }
.nav-auth { display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gray-900); margin: 5px 0; transition: .3s; border-radius: 2px; }

/* ---- Avatar ---- */
.avatar {
    border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: linear-gradient(135deg, var(--red), var(--purple));
    color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-md { width: 48px; height: 48px; font-size: 1.125rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 2rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 3rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Dropdown ---- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0; background: var(--white);
    border-radius: var(--radius); box-shadow: var(--shadow-xl);
    min-width: 220px; padding: .5rem; display: none; z-index: 50;
    border: 1px solid var(--border);
}
.dropdown-menu.show { display: block; animation: dropIn .15s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.dropdown-item {
    display: flex; align-items: center; gap: .625rem; padding: .625rem .875rem;
    border-radius: 8px; color: var(--gray-700); font-size: .875rem; font-weight: 500;
    transition: all var(--transition); text-decoration: none;
}
.dropdown-item:hover { background: var(--gray-100); color: var(--gray-900); }
.dropdown-divider { border-top: 1px solid var(--gray-200); margin: .375rem 0; }
.text-danger { color: var(--danger) !important; }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff; padding: 3.5rem 0 3rem; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(231,76,60,.08) 0%, transparent 60%);
    z-index: 0;
}
.hero::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 80px;
    background: linear-gradient(to top, var(--bg), transparent);
    z-index: 0;
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(255,75,75,.2); border: 1px solid rgba(255,75,75,.4);
    padding: .375rem 1rem; border-radius: var(--radius-full);
    font-size: .8125rem; font-weight: 700; margin-bottom: 1.5rem; backdrop-filter: blur(8px);
    color: #fff;
}
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: 1.25rem; letter-spacing: -.03em; color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.hero h1 .text-gradient { background: linear-gradient(135deg, #FF6B6B, #EE5A24, #FDCB6E); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.hero p { font-size: 1.125rem; opacity: .9; margin-bottom: 2rem; line-height: 1.7; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-stats {
    display: flex; gap: 2.5rem; margin-top: 1.5rem; padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.25);
}
.hero-stats .stat strong { display: block; font-size: 1.75rem; font-weight: 800; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.3); }
.hero-stats .stat span { font-size: .8125rem; opacity: .8; color: #fff; }

/* ---- Section ---- */
.section { padding: 2rem 0; }
.section-title { margin-bottom: .5rem; }
.section-subtitle { color: var(--gray-500); font-size: 1rem; margin-bottom: 1rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.section-dark { background: var(--gray-900); color: #fff; }
.section-dark .section-title { color: #fff; }
.section-gradient { background: linear-gradient(135deg, var(--red), var(--purple)); color: #fff; }
.section-gradient .section-title { color: #fff; }

/* ---- Categories Grid ---- */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.category-card {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding: 1.25rem .75rem; border-radius: var(--radius-lg); background: var(--white);
    border: 2px solid var(--gray-200); transition: all var(--transition);
    text-decoration: none; color: var(--gray-700); font-weight: 600; font-size: .8125rem;
    text-align: center;
}
.category-card:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-icon { font-size: 2rem; }

/* ---- Listing Card ---- */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.listing-card {
    display: block; text-decoration: none; color: inherit;
    background: var(--white); border-radius: var(--radius-lg);
    border: 1px solid var(--border); overflow: hidden;
    transition: all var(--transition);
}
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.listing-image { position: relative; aspect-ratio: 4/3; background: var(--gray-100); overflow: hidden; }
.listing-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.listing-card:hover .listing-image img { transform: scale(1.05); }
.listing-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--gray-300); }
.listing-badge { position: absolute; top: .75rem; left: .75rem; z-index: 2; }
.badge-featured { background: var(--yellow); color: #92400E; padding: .25rem .75rem; border-radius: var(--radius-full); font-size: .6875rem; font-weight: 800; }
.listing-body { padding: 1rem; }
.listing-category { font-size: .75rem; color: var(--gray-500); font-weight: 600; margin-bottom: .25rem; }
.listing-title { font-size: .9375rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .5rem; color: var(--gray-900); }
.listing-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .25rem; }
.listing-price { color: var(--red); font-weight: 800; font-size: 1.125rem; }
.listing-price .price-free { color: var(--green); }
.listing-location { font-size: .75rem; color: var(--gray-500); }
.listing-footer { display: flex; justify-content: space-between; margin-top: .5rem; font-size: .75rem; color: var(--gray-400); }
.featured-card { border: 2px solid var(--yellow); }

/* ---- Swipe (Dating) ---- */
.swipe-container { max-width: 380px; margin: 0 auto; perspective: 1000px; }
.swipe-card {
    width: 100%; aspect-ratio: 3/4; border-radius: var(--radius-xl); overflow: hidden;
    background: var(--gray-900); box-shadow: var(--shadow-xl); position: relative;
    cursor: grab; user-select: none;
}
.swipe-card:active { cursor: grabbing; }
.swipe-photo { width: 100%; height: 100%; object-fit: cover; }
.swipe-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--red), var(--purple));
    font-size: 5rem; color: rgba(255,255,255,.8); font-weight: 900;
}
.swipe-info {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.85));
    padding: 4rem 1.5rem 1.5rem; color: #fff;
}
.swipe-info h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.swipe-info p { font-size: .875rem; opacity: .8; }
.swipe-bio { margin-top: .5rem; font-size: .8125rem; opacity: .7; line-height: 1.4; }
.swipe-actions { display: flex; justify-content: center; gap: 1.25rem; margin-top: 1.5rem; }
.swipe-btn {
    width: 60px; height: 60px; border-radius: 50%; background: var(--white);
    box-shadow: var(--shadow-lg); border: none; display: flex; align-items: center;
    justify-content: center; font-size: 1.5rem; cursor: pointer; transition: all var(--transition);
}
.swipe-btn:hover { transform: scale(1.15); }
.swipe-btn.dislike:hover { box-shadow: 0 0 20px rgba(239,68,68,.3); }
.swipe-btn.like:hover { box-shadow: 0 0 20px rgba(16,185,129,.3); }

/* ---- Chat ---- */
.chat-layout { display: flex; height: calc(100vh - 64px); background: var(--white); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.chat-sidebar { width: 320px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
.chat-sidebar h3 { padding: 1.25rem; font-size: 1.125rem; border-bottom: 1px solid var(--border); }
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--gray-50); }
.chat-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--white); display: flex; align-items: center; gap: .75rem; font-weight: 700; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .625rem; }
.chat-input { padding: 1rem; border-top: 1px solid var(--border); background: var(--white); display: flex; gap: .5rem; }
.chat-input input { flex: 1; border-radius: var(--radius-full) !important; padding-left: 1.25rem !important; }
.chat-item {
    display: flex; align-items: center; gap: .75rem; padding: .875rem 1.25rem;
    cursor: pointer; transition: background var(--transition); border-bottom: 1px solid var(--gray-100);
    text-decoration: none; color: inherit;
}
.chat-item:hover, .chat-item.active { background: rgba(255,75,75,.04); }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-info strong { display: block; font-size: .875rem; }
.chat-item-info small { display: block; font-size: .75rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message { max-width: 70%; padding: .75rem 1rem; border-radius: var(--radius-lg); font-size: .9375rem; line-height: 1.5; }
.message.mine { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 4px; }
.message.theirs { align-self: flex-start; background: var(--white); color: var(--gray-900); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.message-time { font-size: .6875rem; opacity: .6; margin-top: .25rem; }

/* ---- Filter bar ---- */
.filters-bar { background: var(--white); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem; border: 1px solid var(--border); }
.filters-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.filters-row .form-group { flex: 1; min-width: 160px; margin-bottom: 0; }
.filters-row .btn { flex-shrink: 0; }

/* ---- Stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem;
    border: 1px solid var(--border); text-align: center; transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-number { font-size: 2.25rem; font-weight: 900; letter-spacing: -.03em; background: linear-gradient(135deg, var(--red), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: .75rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: .25rem; }

/* ---- Dashboard ---- */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.dashboard-section { margin-top: 2.5rem; }
.dashboard-section h2 { margin-bottom: 1.25rem; }
.listings-table { display: flex; flex-direction: column; gap: .5rem; }
.listing-row {
    display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--white);
    border-radius: var(--radius); border: 1px solid var(--border); transition: all var(--transition);
}
.listing-row:hover { box-shadow: var(--shadow); }
.listing-row-thumb { width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--gray-100); flex-shrink: 0; }
.listing-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.listing-row-info { flex: 1; min-width: 0; }
.listing-row-info a { font-weight: 700; color: var(--gray-900); }
.listing-row-info small { display: block; font-size: .75rem; color: var(--gray-500); margin-top: .125rem; }

/* ---- Status badges ---- */
.status-badge { display: inline-flex; padding: .25rem .75rem; border-radius: var(--radius-full); font-size: .6875rem; font-weight: 700; text-transform: uppercase; }
.status-active { background: rgba(16,185,129,.1); color: var(--success); }
.status-pending { background: rgba(245,158,11,.1); color: var(--warning); }
.status-removed, .status-sold, .status-expired { background: rgba(239,68,68,.1); color: var(--danger); }

/* ---- Pricing ---- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; max-width: 960px; margin: 0 auto; }
.pricing-card { text-align: center; padding: 2.5rem 1.5rem; position: relative; background: var(--white); border-radius: var(--radius-xl); border: 2px solid var(--border); }
.pricing-card.popular { border-color: var(--red); }
.pricing-popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: .25rem 1rem; border-radius: var(--radius-full); font-size: .6875rem; font-weight: 800; text-transform: uppercase; }
.pricing-name { font-size: 1.25rem; font-weight: 800; margin-bottom: .5rem; }
.pricing-price { font-size: 3rem; font-weight: 900; margin: 1rem 0; letter-spacing: -.04em; }
.pricing-price span { font-size: 1rem; font-weight: 500; color: var(--gray-500); }
.pricing-features { list-style: none; text-align: left; margin: 1.5rem 0; }
.pricing-features li { padding: .5rem 0; font-size: .875rem; display: flex; align-items: center; gap: .5rem; }
.pricing-features li .check { color: var(--success); font-weight: 700; }
.pricing-features li .cross { color: var(--gray-300); }

/* ---- Auth ---- */
.auth-card { background: var(--white); border-radius: var(--radius-xl); padding: 2.5rem 2rem; box-shadow: var(--shadow-lg); border: 1px solid var(--border); max-width: 440px; margin: 0 auto; }
.auth-title { text-align: center; margin-bottom: .5rem; }
.auth-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 2rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--gray-500); }
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; color: var(--gray-400); font-size: .8125rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

/* ---- Admin ---- */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.admin-sidebar { background: var(--gray-900); color: #fff; padding: 1.5rem 0; }
.admin-sidebar-header { padding: 0 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 1rem; }
.admin-sidebar-header h3 { font-size: 1rem; color: #fff; }
.admin-sidebar-header small { color: rgba(255,255,255,.4); font-size: .75rem; }
.admin-nav { list-style: none; }
.admin-nav a {
    display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem;
    color: rgba(255,255,255,.6); font-size: .875rem; font-weight: 600;
    transition: all var(--transition); text-decoration: none; border-left: 3px solid transparent;
}
.admin-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.admin-nav a.active { color: var(--red); background: rgba(255,75,75,.1); border-left-color: var(--red); }
.admin-content { padding: 2rem; overflow-y: auto; }
.admin-content h1 { margin-bottom: 1.5rem; }

/* Admin Table */
.admin-table-wrapper { overflow-x: auto; background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { padding: .75rem 1rem; text-align: left; font-weight: 700; font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--border); }
.admin-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,75,75,.02); }
.admin-table .actions { display: flex; gap: .375rem; flex-wrap: wrap; }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: .75rem; color: var(--gray-500); }

/* ---- Match Popup ---- */
.match-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: linear-gradient(135deg, var(--red), var(--purple));
    display: none; align-items: center; justify-content: center;
    text-align: center; color: #fff; flex-direction: column; gap: 1rem;
}
.match-overlay.show { display: flex; animation: matchPop .5s ease; }
@keyframes matchPop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.match-overlay h1 { font-size: 3.5rem; }
.match-overlay p { font-size: 1.25rem; opacity: .85; }
.match-emoji { font-size: 5rem; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ---- Profile ---- */
.profile-header { display: flex; gap: 2rem; align-items: flex-start; margin-bottom: 2rem; }
.profile-info { flex: 1; }
.profile-meta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; font-size: .875rem; color: var(--gray-500); }
.profile-bio { margin-top: 1rem; color: var(--gray-600); line-height: 1.7; }
.profile-avatar-section { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--red), var(--purple)); color: #fff; font-weight: 900; border-radius: 50%; }
.avatar-placeholder.large { width: 80px; height: 80px; font-size: 2rem; }

/* ---- Match Grid ---- */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.match-card { background: var(--white); border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border); text-align: center; padding-bottom: 1.25rem; }
.match-photo { aspect-ratio: 1; overflow: hidden; }
.match-photo img { width: 100%; height: 100%; object-fit: cover; }
.match-card h3 { padding: .75rem .75rem 0; font-size: 1rem; }
.match-card p { font-size: .8125rem; color: var(--gray-500); }
.match-date { font-size: .75rem; color: var(--gray-400); margin-bottom: .75rem; }

/* ---- Listing Detail ---- */
.listing-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.gallery-main { border-radius: var(--radius-xl); overflow: hidden; aspect-ratio: 4/3; background: var(--gray-100); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .75rem; }
.gallery-thumb { width: 72px; height: 54px; border-radius: 8px; object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); opacity: .7; }
.gallery-thumb:hover, .gallery-thumb.active { border-color: var(--red); opacity: 1; }
.gallery-placeholder { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; background: var(--gray-100); border-radius: var(--radius-xl); font-size: 3rem; color: var(--gray-300); }
.listing-detail .listing-header h1 { font-size: 1.75rem; margin-bottom: .5rem; }
.listing-detail .listing-price { font-size: 2rem; font-weight: 900; color: var(--red); margin-bottom: 1rem; }
.listing-detail .listing-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .875rem; color: var(--gray-500); margin-bottom: 1.5rem; }
.listing-actions { display: flex; gap: .75rem; margin-bottom: 1.5rem; }
.listing-description { margin-bottom: 2rem; }
.listing-description h3 { margin-bottom: .75rem; }
.listing-description p { color: var(--gray-600); line-height: 1.7; }
.seller-card {
    display: flex; gap: 1rem; padding: 1.25rem; background: var(--gray-50);
    border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.seller-info { flex: 1; }
.seller-name { font-weight: 700; color: var(--gray-900); font-size: 1rem; }
.seller-meta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .375rem; font-size: .75rem; color: var(--gray-500); }

/* Favorite btn */
.favorite-btn { cursor: pointer; }
.favorite-btn.favorited { border-color: var(--red); color: var(--red); }
.btn-fav-overlay { position: absolute; top: .75rem; right: .75rem; z-index: 2; background: rgba(255,255,255,.9); backdrop-filter: blur(4px); border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition); font-size: 1.125rem; }
.btn-fav-overlay:hover { transform: scale(1.15); }

/* ---- Interests ---- */
.interests { display: flex; flex-wrap: wrap; gap: .5rem; }
.interest-tag {
    padding: .375rem .875rem; border-radius: var(--radius-full); font-size: .8125rem;
    font-weight: 600; cursor: pointer; transition: all var(--transition);
    background: var(--gray-100); color: var(--gray-600); border: none;
}
.interest-tag.active, .interest-tag:hover { background: var(--red); color: #fff; }

/* ---- Consent ---- */
.consent-box { border: 1px solid var(--gray-200); background: var(--gray-50); border-radius: var(--radius); padding: 1.25rem; margin: 1rem 0; }

/* ---- Review ---- */
.review-card { padding: 1rem; background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: .75rem; }
.review-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; font-size: .875rem; }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; align-items: center; gap: .5rem; margin-top: 2rem; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: var(--radius); font-weight: 700; font-size: .875rem; border: 2px solid var(--gray-200); color: var(--gray-700); transition: all var(--transition); text-decoration: none; }
.page-link:hover, .page-link.active { border-color: var(--red); color: var(--red); }
.results-info { margin-bottom: 1rem; font-size: .875rem; color: var(--gray-500); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state .emoji { font-size: 4rem; margin-bottom: 1rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { margin-bottom: .5rem; }
.empty-state p { color: var(--gray-500); margin-bottom: 1.5rem; }
.empty-small { padding: 2rem; text-align: center; color: var(--gray-500); }

/* ---- Legal ---- */
.legal-content h2 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: .5rem; }
.legal-content p, .legal-content ul { margin-bottom: 1rem; color: var(--gray-600); line-height: 1.7; }
.legal-content ul { padding-left: 1.5rem; }

/* ---- Msg preview (dashboard) ---- */
.msg-preview { display: flex; align-items: center; gap: .75rem; padding: .75rem; background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: .5rem; font-size: .875rem; }
.msg-preview strong { flex-shrink: 0; }
.msg-preview span { flex: 1; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-preview small { color: var(--gray-400); flex-shrink: 0; }

/* ---- Form card ---- */
.form-card { background: var(--white); border-radius: var(--radius-xl); padding: 2rem; border: 1px solid var(--border); }
.form .form-group label { font-size: .8125rem; font-weight: 700; color: var(--gray-700); }

/* Dating header */
.dating-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.dating-header h1 { flex: 1; }

/* ---- Thumb sm ---- */
.thumb-sm { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); margin-top: .5rem; }

/* ---- Footer ---- */
.footer { background: var(--gray-900); color: #fff; padding: 3.5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-logo { display: flex; align-items: center; gap: .625rem; margin-bottom: 1rem; }
.footer-logo .logo-text { color: #fff; }
.footer p { color: rgba(255,255,255,.5); font-size: .875rem; line-height: 1.6; }
.footer h4 { color: var(--red); font-size: .875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: .5rem; }
.footer ul a { color: rgba(255,255,255,.5); font-size: .875rem; transition: color var(--transition); }
.footer ul a:hover { color: #fff; }
.footer-social { display: flex; gap: .75rem; margin-top: 1rem; }
.footer-social a { color: rgba(255,255,255,.4); transition: color var(--transition); }
.footer-social a:hover { color: var(--red); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 2.5rem; padding-top: 1.5rem; text-align: center; }
.footer-bottom p { color: rgba(255,255,255,.3); font-size: .75rem; }

/* ---- Spinner ---- */
.spinner { width: 40px; height: 40px; border: 3px solid var(--gray-200); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Maintenance ---- */
.maintenance-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--dark), var(--dark-2));
    color: #fff; text-align: center; padding: 2rem; flex-direction: column; gap: 1rem;
}
.maintenance-page h1 { font-size: 3rem; }
.maintenance-page p { font-size: 1.25rem; opacity: .6; max-width: 500px; }
.maintenance-icon { font-size: 5rem; margin-bottom: 1rem; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* ---- Settings form (admin) ---- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.settings-section { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; border: 1px solid var(--border); }
.settings-section h3 { margin-bottom: 1.25rem; font-size: 1rem; }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-white { color: #fff; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; } .mt-6 { margin-top: 2rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; } .mb-6 { margin-bottom: 2rem; }
.p-4 { padding: 1.25rem; }
.gap-2 { gap: .5rem; } .gap-4 { gap: 1rem; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.d-none-mobile { display: inline; }
.hidden { display: none; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-success { color: var(--success); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .admin-sidebar.open { display: block; position: fixed; top: 64px; left: 0; bottom: 0; width: 280px; z-index: 200; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .listing-detail { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero { padding: 2.5rem 0 2rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero-stats { gap: 1.5rem; }
    .nav-links { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--white); flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 100; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .d-none-mobile { display: none; }
    .chat-sidebar { width: 100%; }
    .chat-layout { flex-direction: column; height: auto; min-height: calc(100vh - 64px); }
    .footer-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-meta { justify-content: center; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .listings-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .hero-stats { flex-wrap: wrap; gap: 1rem; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .listings-grid { grid-template-columns: 1fr; }
    .match-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================================================
   SUBITO-STYLE MARKETPLACE & DETAIL
   =========================================================== */

/* ---- Filters Bar (Subito style) ---- */
.sb-filters { background: var(--white); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1rem; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.sb-filters-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.sb-filter-search { display: flex; align-items: center; gap: .5rem; flex: 2; min-width: 200px; background: var(--gray-50); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 0 .75rem; transition: border-color .2s; }
.sb-filter-search:focus-within { border-color: var(--red); }
.sb-filter-search input { border: none; background: transparent; padding: .6rem 0; flex: 1; font-size: .9rem; outline: none; }
.sb-filters-row select { flex: 1; min-width: 150px; padding: .6rem .75rem; border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--white); font-size: .85rem; color: var(--gray-700); cursor: pointer; }
.sb-filters-row select:focus { border-color: var(--red); outline: none; }
.sb-results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.sb-results-count { font-size: .875rem; color: var(--gray-500); font-weight: 600; }
.sb-clear-filters { font-size: .8rem; color: var(--red); text-decoration: none; font-weight: 600; }
.sb-clear-filters:hover { text-decoration: underline; }

/* ---- Horizontal Listing Cards (Subito style) ---- */
.sb-listings { display: flex; flex-direction: column; gap: .75rem; }
.sb-card {
    display: flex; text-decoration: none; color: inherit;
    background: var(--white); border-radius: var(--radius-lg);
    border: 1px solid var(--border); overflow: hidden;
    transition: all .2s ease;
}
.sb-card:hover { box-shadow: var(--shadow-lg); border-color: var(--gray-300); }
.sb-card--featured { border: 2px solid var(--yellow); background: #fffbeb; }
.sb-card__img {
    width: 220px; min-width: 220px; height: 165px;
    background: var(--gray-100); overflow: hidden; position: relative; flex-shrink: 0;
}
.sb-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.sb-card:hover .sb-card__img img { transform: scale(1.04); }
.sb-card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--gray-300); }
.sb-card__badge { position: absolute; top: .5rem; left: .5rem; background: var(--yellow); color: #92400E; padding: .2rem .6rem; border-radius: var(--radius-full); font-size: .65rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.sb-card__badge--inline { position: static; display: inline-block; margin-bottom: .5rem; }
.sb-card__body { flex: 1; padding: 1rem 1.25rem; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.sb-card__top { margin-bottom: .25rem; }
.sb-card__title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin: 0 0 .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sb-card__cat { font-size: .75rem; color: var(--gray-400); font-weight: 500; }
.sb-card__price { font-size: 1.25rem; font-weight: 900; color: var(--red); margin: .25rem 0; }
.sb-card__bottom { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sb-card__location { display: flex; align-items: center; gap: .25rem; font-size: .8rem; color: var(--gray-500); }
.sb-card__location svg { flex-shrink: 0; }
.sb-card__time { font-size: .75rem; color: var(--gray-400); white-space: nowrap; }

/* Vertical card variant (for related) */
.sb-listings--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; flex-direction: unset; }
.sb-card--vertical { flex-direction: column; }
.sb-card--vertical .sb-card__img { width: 100%; min-width: unset; height: 160px; }

/* ---- Detail Page (Subito style) ---- */
.sb-detail-section { padding-bottom: 5rem; }
.sb-breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--gray-400); margin-bottom: 1.25rem; flex-wrap: wrap; }
.sb-breadcrumb a { color: var(--gray-500); text-decoration: none; }
.sb-breadcrumb a:hover { color: var(--red); text-decoration: underline; }
.sb-breadcrumb__current { color: var(--gray-700); font-weight: 600; }

.sb-sold-banner { background: #dc2626; color: #fff; text-align: center; padding: .75rem; border-radius: var(--radius-lg); font-weight: 700; font-size: .95rem; margin-bottom: 1rem; }
.sb-expired-banner { background: #f59e0b; color: #fff; text-align: center; padding: .75rem; border-radius: var(--radius-lg); font-weight: 700; font-size: .95rem; margin-bottom: 1rem; }
.sb-detail { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }

/* Gallery */
.sb-gallery__main { position: relative; border-radius: var(--radius-xl); overflow: hidden; aspect-ratio: 4/3; background: var(--gray-100); }
.sb-gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.sb-gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.45); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; line-height: 1; }
.sb-gallery__nav:hover { background: rgba(0,0,0,.7); }
.sb-gallery__nav--prev { left: .75rem; }
.sb-gallery__nav--next { right: .75rem; }
.sb-gallery__counter { position: absolute; bottom: .75rem; right: .75rem; background: rgba(0,0,0,.6); color: #fff; padding: .2rem .6rem; border-radius: var(--radius-full); font-size: .75rem; font-weight: 600; }
.sb-gallery__thumbs { display: flex; gap: .5rem; margin-top: .75rem; overflow-x: auto; padding-bottom: .25rem; }
.sb-gallery__thumb { width: 72px; height: 54px; border-radius: 8px; object-fit: cover; cursor: pointer; border: 2px solid transparent; opacity: .65; transition: all .2s; flex-shrink: 0; }
.sb-gallery__thumb:hover, .sb-gallery__thumb.active { border-color: var(--red); opacity: 1; }
.sb-gallery__placeholder { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; background: var(--gray-100); border-radius: var(--radius-xl); font-size: 3rem; color: var(--gray-300); }

/* Description */
.sb-description { margin-top: 2rem; }
.sb-description h2 { font-size: 1.25rem; margin-bottom: .75rem; }
.sb-description__text { color: var(--gray-600); line-height: 1.75; font-size: .925rem; }

/* Sidebar */
.sb-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1rem; }
.sb-sidebar__card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.25rem; }
.sb-sidebar__price { font-size: 1.85rem; font-weight: 900; color: var(--red); line-height: 1.2; }
.sb-sidebar__title { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); margin: .5rem 0; line-height: 1.4; }
.sb-sidebar__meta { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--gray-500); }
.sb-sidebar__meta span { display: flex; align-items: center; gap: .25rem; }

/* Phone reveal button */
.sb-btn-phone {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    padding: .85rem 1rem; border: 2px solid var(--green); border-radius: var(--radius-lg);
    background: var(--white); cursor: pointer; transition: all .2s;
}
.sb-btn-phone:hover { background: #f0fdf4; }
.sb-btn-phone svg { color: var(--green); flex-shrink: 0; }
.sb-btn-phone__label { display: flex; flex-direction: column; text-align: left; }
.sb-btn-phone__label strong { font-size: .9rem; color: var(--gray-900); }
.sb-btn-phone__label small { font-size: .8rem; color: var(--gray-500); }
.sb-btn-phone--revealed { border-color: var(--green); background: #f0fdf4; }
.sb-btn-phone--revealed .sb-btn-phone__label small { color: var(--green); font-weight: 700; font-size: .95rem; }

/* Contact button */
.sb-btn-contact {
    display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
    padding: .85rem 1rem; background: var(--red); color: var(--white); border: none;
    border-radius: var(--radius-lg); font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all .2s; text-decoration: none;
}
.sb-btn-contact:hover { background: #b91c1c; color: var(--white); }

/* Secondary actions */
.sb-sidebar__secondary-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.sb-btn-secondary {
    flex: 1; padding: .6rem; border: 1px solid var(--border); background: var(--white);
    border-radius: var(--radius-md); font-size: .8rem; font-weight: 600; cursor: pointer;
    color: var(--gray-600); transition: all .2s; text-align: center;
}
.sb-btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.sb-btn-secondary.favorited { border-color: var(--red); color: var(--red); }
.sb-sidebar__owner-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }

/* Seller card */
.sb-seller__header { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.sb-seller__info { flex: 1; }
.sb-seller__name { font-weight: 700; color: var(--gray-900); font-size: 1rem; text-decoration: none; display: block; }
.sb-seller__name:hover { color: var(--red); }
.sb-seller__loc { font-size: .8rem; color: var(--gray-500); }
.sb-seller__stats { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .75rem; color: var(--gray-500); margin-bottom: .75rem; }
.sb-seller__link { font-size: .85rem; color: var(--red); font-weight: 600; text-decoration: none; }
.sb-seller__link:hover { text-decoration: underline; }

/* Dati Principali - Subito style attributes table */
.sb-attributes { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.sb-attributes h2 { font-size: 1.25rem; margin-bottom: 1rem; font-weight: 700; color: var(--gray-900); }
.sb-attributes__grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--white);
}
.sb-attributes__item {
    display: flex; justify-content: space-between; align-items: center;
    padding: .5rem .75rem; border-bottom: 1px solid var(--border);
    font-size: .8rem;
}
.sb-attributes__item:nth-child(odd) { border-right: 1px solid var(--border); }
.sb-attributes__item:nth-last-child(1), .sb-attributes__item:nth-last-child(2) { border-bottom: none; }
.sb-attributes__label { color: var(--gray-500); font-weight: 400; }
.sb-attributes__value { color: var(--gray-900); font-weight: 600; text-align: right; }
@media (max-width: 600px) {
    .sb-attributes__grid { grid-template-columns: 1fr; }
    .sb-attributes__item:nth-child(odd) { border-right: none; }
    .sb-attributes__item:nth-last-child(2) { border-bottom: 1px solid var(--border); }
    .sb-attributes__item:last-child { border-bottom: none; }
}

/* Comments */
.sb-comments { margin-top: 2rem; }
.sb-comments h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.sb-comment-form { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.5rem; }
.sb-comment-form textarea { width: 100%; padding: .75rem; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: .9rem; resize: vertical; font-family: inherit; }
.sb-comment-form textarea:focus { border-color: var(--red); outline: none; }
.sb-comment-form .btn { align-self: flex-end; }
.sb-comments__login, .sb-comments__empty { font-size: .875rem; color: var(--gray-400); }
.sb-comments__login a { color: var(--red); font-weight: 600; }
.sb-comment { display: flex; gap: .75rem; padding: 1rem; background: var(--gray-50); border-radius: var(--radius-md); margin-bottom: .5rem; }
.sb-comment__body { flex: 1; }
.sb-comment__header { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.sb-comment__header a { font-weight: 700; font-size: .85rem; color: var(--gray-900); text-decoration: none; }
.sb-comment__header small { color: var(--gray-400); }
.sb-comment__body p { font-size: .875rem; color: var(--gray-600); margin: 0; line-height: 1.5; }

/* Related */
.sb-related { margin-top: 3rem; }
.sb-related h2 { font-size: 1.25rem; margin-bottom: 1rem; }

/* Mobile sticky bar */
.sb-mobile-bar {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--white); border-top: 1px solid var(--border); padding: .75rem 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    align-items: center; justify-content: space-between; gap: .75rem;
}
.sb-mobile-bar__price { font-size: 1.15rem; font-weight: 900; color: var(--red); }
.sb-mobile-bar__actions { display: flex; gap: .5rem; }
.sb-mobile-bar__btn {
    display: flex; align-items: center; gap: .35rem; padding: .6rem 1rem;
    border-radius: var(--radius-md); font-size: .85rem; font-weight: 700;
    text-decoration: none; white-space: nowrap;
}
.sb-mobile-bar__btn--phone { background: var(--white); border: 2px solid var(--green); color: var(--green); }
.sb-mobile-bar__btn--chat { background: var(--red); color: var(--white); border: none; }

/* ===== Grid layout Subito-style ===== */
.sb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.sb-grid-card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}
.sb-grid-card:hover { box-shadow: var(--shadow-lg); border-color: var(--gray-300); }
.sb-grid-card--featured { border: 2px solid var(--yellow); background: #fffbeb; }
.sb-grid-card__link { text-decoration: none; color: inherit; display: block; }
.sb-grid-card__img {
    position: relative; width: 100%; aspect-ratio: 1/1; background: var(--gray-100); overflow: hidden;
}
.sb-grid-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.sb-grid-card:hover .sb-grid-card__img img { transform: scale(1.05); }
.sb-grid-card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--gray-300); }
.sb-grid-card__count {
    position: absolute; bottom: .5rem; left: .5rem;
    background: rgba(0,0,0,.6); color: #fff; padding: .2rem .5rem;
    border-radius: var(--radius-full); font-size: .7rem; font-weight: 600;
    display: flex; align-items: center; gap: .25rem;
}
.sb-grid-card__badge {
    position: absolute; top: .5rem; left: .5rem;
    background: var(--yellow); color: #92400E; padding: .15rem .5rem;
    border-radius: var(--radius-full); font-size: .6rem; font-weight: 800;
    letter-spacing: .5px; text-transform: uppercase;
}
.sb-grid-card__fav {
    position: absolute; top: .5rem; right: .5rem;
    background: rgba(255,255,255,.9); border: none; border-radius: 50%;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--gray-400); transition: all .2s; z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.sb-grid-card__fav:hover { background: #fff; color: var(--red); transform: scale(1.1); }
.sb-grid-card__fav--active { color: var(--red); }
.sb-grid-card__body { padding: .75rem; }
.sb-grid-card__title {
    font-size: .85rem; font-weight: 600; color: var(--gray-900);
    margin: 0 0 .25rem; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sb-grid-card__price { font-size: 1rem; font-weight: 800; color: var(--gray-900); margin-bottom: .25rem; }
.sb-grid-card__location { font-size: .75rem; color: var(--gray-500); }

@media (max-width: 600px) {
    .sb-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .sb-grid-card__body { padding: .5rem; }
    .sb-grid-card__title { font-size: .78rem; }
    .sb-grid-card__price { font-size: .9rem; }
    .sb-grid-card__fav { width: 28px; height: 28px; }
    .sb-grid-card__fav svg { width: 16px; height: 16px; }
}

/* ---- Responsive overrides ---- */
@media (max-width: 1024px) {
    .sb-detail { grid-template-columns: 1fr; }
    .sb-sidebar { position: static; }
    .sb-mobile-bar { display: flex; }
    .sb-detail-section { padding-bottom: 6rem; }
}

@media (max-width: 768px) {
    .sb-card__img { width: 140px; min-width: 140px; height: 120px; }
    .sb-card__title { font-size: .9rem; }
    .sb-card__price { font-size: 1.05rem; }
    .sb-filters-row { flex-direction: column; }
    .sb-filter-search { min-width: 100%; }
    .sb-filters-row select { min-width: 100%; }
}

@media (max-width: 480px) {
    .sb-card__img { width: 120px; min-width: 120px; height: 100px; }
    .sb-card__body { padding: .75rem; }
    .sb-card__cat { display: none; }
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: modalIn .2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
