/* ============================================
   VarsityPlug — Global Design System (Light/Blue Glassmorphism)
   ============================================ */

@font-face {
    font-family: 'Deltha';
    src: url('../deltha/Deltha.ttf') format('truetype'),
         url('../deltha/Deltha.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Snell Roundhand';
    src: url('../Snell-Roundhand/Snell-Roundhand/Snell Roundhand Regular.woff2') format('woff2'),
         url('../Snell-Roundhand/Snell-Roundhand/Snell Roundhand Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Snell Roundhand';
    src: url('../Snell-Roundhand/Snell-Roundhand/Snell Roundhand Bold.woff2') format('woff2'),
         url('../Snell-Roundhand/Snell-Roundhand/Snell Roundhand Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* === CSS Variables === */
:root {
    --primary: #020617;
    /* Navy 950 */
    --primary-light: #0F172A;
    /* Navy 900 */
    --primary-dark: #000000;
    /* Black */
    --accent: #0b7a70; /* Darker Teal for accessibility */
    --accent-light: #0D9488;
    --accent-hover: #08635c;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    --bg-color: #f8f9fa;

    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);

    --featured-glow: 0 0 20px rgba(15, 23, 42, 0.1), 0 10px 30px rgba(0, 0, 0, 0.05);
    --featured-border: rgba(15, 23, 42, 0.2);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --navy-50: #f8fafc;
    --navy-100: #f1f5f9;
    --navy-200: #e2e8f0;
    --navy-300: #cbd5e1;
    --navy-400: #94a3b8;
    --navy-500: #64748b;
    --navy-600: #475569;
    --navy-700: #334155;
    --navy-800: #0F172A;
    --navy-900: #020617;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    --nav-height: 70px;

    --font-sans: 'Titillium Web', sans-serif;
    --font-display: 'Deltha', 'Space Grotesk', sans-serif;
    --font-logo: 'Snell Roundhand', cursive;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Titillium Web', sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    width: 100%;
    margin: 0;
    padding: 0;
}

/* === Icons === */
i[data-lucide] {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.125em;
    display: inline-block;
}

/* === Image & Base Reset === */
img {
    pointer-events: none;
    /* Prevents dragging ghosts */
}

/* === View Transitions API (Cross-Document) === */
@view-transition {
    navigation: auto;
}

.transition-hero-img {
    contain: paint;
    view-transition-name: product-hero-image;
}

.transition-hero-title {
    contain: paint;
    view-transition-name: product-hero-title;
}

/* Base View Transition Morph Settings */
::view-transition-old(*),
::view-transition-new(*) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Custom Utilities === */
.glass {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
}

.glass:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.hero-gradient {
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(20, 184, 166, 0.05), transparent 40%);
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.glass-card.featured {
    border-color: var(--featured-border);
    background: #f0f9ff;
}

.glass-form {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow-hover);
    padding: 2.5rem;
}

/* === Modal System === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === Premium Button System === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.75rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}

.btn-accent {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.3);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1.5px solid var(--card-border);
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1.5px solid #fee2e2;
}

.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}

.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.2);
}

.btn-sm {
    padding: 0.5rem 1.4rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 1.1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

.btn-pill {
    border-radius: 12px !important;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* === Form Inputs === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.form-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

select.form-control option {
    background: #ffffff;
    color: var(--text-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* === Navigation === */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.navbar-inner {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.navbar-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific styling for the VarsityPlug brand name across all headers */
.navbar-brand span, 
.flex.items-center span.tracking-tight,
.logo-text {
    font-family: var(--font-logo) !important;
    font-weight: 700 !important; /* Made bold for more presence */
    letter-spacing: normal !important;
    font-size: 1.6rem !important; /* Needs to be slightly larger as script fonts appear smaller */
}

@media (min-width: 640px) {
    .navbar-brand span, 
    .flex.items-center span.tracking-tight,
    .logo-text {
        font-size: 2.2rem !important;
    }
}


.navbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.navbar-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}

.navbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.navbar-search input::placeholder {
    color: var(--text-muted);
}

.navbar-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* === Unified Avatar System === */
.avatar-container,
.user-avatar {
    border-radius: 50%;
    background: var(--navy-50, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px solid var(--card-bg);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    overflow: hidden;
    flex-shrink: 0;
    transition: var(--transition);
}

.user-avatar {
    width: 36px;
    height: 36px;
}

/* Legacy Default */

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sizes */
.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
}

.avatar-md {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
}

.avatar-lg {
    width: 96px;
    height: 96px;
    font-size: 2rem;
    border-width: 3px;
}

@media (min-width: 768px) {
    .avatar-lg {
        width: 128px;
        height: 128px;
        font-size: 2.5rem;
        border-width: 4px;
    }
}

/* Squircle variation for premium feel (Dashboard/Profile) */
.avatar-squircle {
    border-radius: 0.75rem;
}

.avatar-lg.avatar-squircle {
    border-radius: 1rem;
}

@media (min-width: 768px) {
    .avatar-squircle {
        border-radius: 0.875rem;
    }

    .avatar-lg.avatar-squircle {
        border-radius: 1.25rem;
    }
}

.avatar-container:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

/* === Tags & Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    /* 12px */
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-category {
    background: #eff6ff;
    color: var(--primary-dark);
    border: 1px solid #bfdbfe;
}

.badge-featured {
    background: #f0f9ff;
    color: var(--accent);
    border: 1px solid #bae6fd;
}

.badge-active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.badge-expired {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid #e2e8f0;
}

/* === Loading States === */
.skeleton {
    background: linear-gradient(90deg,
            #f1f5f9 25%,
            #e2e8f0 50%,
            #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* === Toast Notifications (Unified System) === */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 450px;
    padding: 1.25rem;
    background: #050912;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

.toast.success {
    border-left: 6px solid #10b981;
}

.toast.error {
    border-left: 6px solid #ef4444;
}

.toast.info {
    border-left: 6px solid #3b82f6;
}

.toast.sold {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1rem;
    min-width: 300px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.toast-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-light);
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.toast-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    background: #ecfdf5;
    color: #10b981;
}

.toast.error .toast-icon {
    background: #fef2f2;
    color: #ef4444;
}

.toast.info .toast-icon {
    background: #eff6ff;
    color: #3b82f6;
}

/* === Trust & Safety === */
.safe-map-card {
    background: linear-gradient(135deg, var(--navy-50) 0%, #ffffff 100%);
    border: 1px dashed var(--navy-200);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}


.trust-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.trust-tooltip .tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: 80vw;
    background-color: #0f172a;
    color: #fff;
    text-align: center;
    border-radius: 0.625rem;
    padding: 1rem;
    position: absolute;
    z-index: 100;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    font-size: 0.75rem;
    line-height: 1.4;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.trust-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Pro Store Premium UI === */
.pro-store-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}


.pro-store-header .avatar-container {
    background: var(--card-bg);
}

#store-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}


/* === Trending Sidebar & Section === */
.trending-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    position: sticky;
    top: 6rem;
}

#trending-container {
    scroll-padding: 0 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 1400px) {
    #trending-container {
        padding-left: 0;
        padding-right: 0;
    }
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.625rem;
    transition: var(--transition);
    cursor: pointer;
}

.trending-item:hover {
    background: var(--navy-50);
    transform: translateX(4px);
}

/* === Just Sold Toasts === */
.toast.sold {
    background: #050912;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}


.toast.sold .toast-icon {
    background: #14b8a6;
    /* Teal accent */
    color: white;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    width: 100%;
    max-width: 540px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* === Page Layout === */
.page-content {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--nav-height));
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === Divider === */
.divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

/* === Spinner === */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Footer === */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 4rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .navbar-search {
        max-width: none;
        flex: 1;
    }

    .container {
        padding: 0 1rem;
    }

    .glass-form {
        padding: 1.5rem;
    }

    .navbar-brand .logo-text {
        display: none;
    }

    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: unset;
    }
}

@media (max-width: 480px) {
    :root {
        --nav-height: 60px;
    }

    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    p,
    span,
    div {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 14px;
    }

    .btn {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* === Verified Badge & Promo === */
.verified-badge-icon {
    color: #3b82f6 !important;
    width: 14px !important;
    height: 14px !important;
    margin-left: 2px;
    display: inline-block;
    vertical-align: middle;
}

.sidebar-promo {
    padding: 0 1rem;
}

.promo-card-mini {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.promo-card-mini.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.promo-card-mini .promo-icon {
    color: #3b82f6;
}

.promo-card-mini.success .promo-icon {
    color: #22c55e;
}

.promo-card-mini strong {
    font-size: 0.85rem;
    display: block;
}

.promo-card-mini p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.promo-card-mini.success p {
    color: #166534;
    opacity: 0.8;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.7rem;
    width: 100%;
}

/* === Unified Listing Card & Grid System === */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

@media (min-width: 480px) {
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 640px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

.listing-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInUp 0.4s ease both;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.listing-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.listing-card .card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: transparent;
    transform: translateZ(0); /* Fix for sub-pixel rounding artifacts */
}

.listing-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.listing-card:hover .card-image img {
    transform: scale(1.05);
}

.listing-card .card-body {
    padding: 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.listing-card .card-title {
    min-height: 2.8rem; /* Ensure 2 lines space on desktop */
}

@media (max-width: 767px) {
    .listings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.4rem;
    }

    .listing-card {
        border-radius: 8px !important;
    }

    .listing-card .card-image {
        aspect-ratio: 4/5;
    }

    .listing-card .card-body {
        padding: 0.4rem;
        gap: 0.2rem;
    }

    .card-title {
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
        min-height: 1.875rem !important; /* Force 2 lines space on mobile */
    }

    .card-price {
        font-size: 0.85rem !important;
    }

    .card-description {
        display: none !important;
    }

    .card-meta {
        font-size: 0.6rem !important;
    }

    .card-seller-row {
        padding-top: 0.25rem !important;
        margin-top: 0.1rem !important;
    }

    .seller-avatar {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.6rem !important;
    }

    .seller-name {
        font-size: 0.65rem !important;
    }
}