/*
 * Shopbazaar Customer Portal — Design System
 * customer/assets/css/customer.css
 *
 * Tailwind CDN is loaded in header.php. This file adds:
 *   1. CSS custom properties (design tokens)
 *   2. Dark mode overrides via [data-theme="dark"]
 *   3. Component classes not expressible cleanly in Tailwind utilities
 *   4. Animations and transitions
 *   5. Third-party overrides (Mapbox, etc.)
 *
 * Mobile-first throughout.
 */

/* ══════════════════════════════════════════════════════════════════════════════
   FONTS
══════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Syne:wght@600;700;800&display=swap');

/* ══════════════════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES — LIGHT MODE (default)
══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Brand */
    --brand:          #10b981;
    --brand-dark:     #059669;
    --brand-light:    #d1fae5;
    --brand-muted:    rgba(16, 185, 129, 0.1);

    /* Semantic colours */
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #6366f1;

    /* Backgrounds */
    --bg-body:        #f8fafc;
    --bg-surface:     #ffffff;
    --bg-elevated:    #f1f5f9;
    --bg-overlay:     rgba(0, 0, 0, 0.5);

    /* Borders */
    --border:         #e2e8f0;
    --border-focus:   #10b981;

    /* Text */
    --text:           #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --text-on-brand:  #ffffff;

    /* Shadows */
    --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:      0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:      0 10px 40px rgba(0,0,0,.12);
    --shadow-card:    0 2px 8px rgba(0,0,0,.06);

    /* Layout */
    --nav-height:     64px;
    --bottom-nav-h:   60px;
    --radius-sm:      6px;
    --radius:         10px;
    --radius-lg:      16px;
    --radius-xl:      24px;

    /* Fonts */
    --font-body:      'DM Sans', system-ui, -apple-system, sans-serif;
    --font-display:   'Syne', sans-serif;

    /* Z-index scale */
    --z-dropdown:     100;
    --z-sticky:       200;
    --z-nav:          300;
    --z-modal:        400;
    --z-toast:        500;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DARK MODE
══════════════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
    --bg-body:        #0f172a;
    --bg-surface:     #1e293b;
    --bg-elevated:    #273344;
    --border:         #334155;
    --text:           #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --shadow-card:    0 2px 8px rgba(0,0,0,.3);
    --shadow-md:      0 4px 16px rgba(0,0,0,.3);
}

/* ══════════════════════════════════════════════════════════════════════════════
   BASE RESET & TYPOGRAPHY
══════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family:      var(--font-body);
    background-color: var(--bg-body);
    color:            var(--text);
    line-height:      1.6;
    min-height:       100vh;
    padding-bottom:   var(--bottom-nav-h); /* room for mobile bottom nav */
    transition:       background-color .2s, color .2s;
}

@media (min-width: 768px) {
    body { padding-bottom: 0; }
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color .15s;
}
a:hover { color: var(--brand-dark); }

/* ══════════════════════════════════════════════════════════════════════════════
   TOP NAVIGATION
══════════════════════════════════════════════════════════════════════════════ */

.sb-nav {
    position:        fixed;
    top:             0;
    left:            0;
    right:           0;
    height:          var(--nav-height);
    background:      var(--bg-surface);
    border-bottom:   1px solid var(--border);
    z-index:         var(--z-nav);
    display:         flex;
    align-items:     center;
    padding:         0 16px;
    gap:             12px;
    transition:      background .2s, border-color .2s;
}

.sb-nav__logo {
    font-family:  var(--font-display);
    font-size:    1.25rem;
    font-weight:  800;
    color:        var(--brand);
    white-space:  nowrap;
    flex-shrink:  0;
}

.sb-nav__search {
    flex:           1;
    min-width:      0;
    max-width:      480px;
    position:       relative;
}

.sb-nav__search input {
    width:          100%;
    background:     var(--bg-elevated);
    border:         1px solid var(--border);
    border-radius:  var(--radius-xl);
    padding:        8px 16px 8px 40px;
    font-size:      .875rem;
    color:          var(--text);
    outline:        none;
    transition:     border-color .15s, box-shadow .15s;
    font-family:    var(--font-body);
}

.sb-nav__search input:focus {
    border-color: var(--brand);
    box-shadow:   0 0 0 3px rgba(16,185,129,.12);
}

.sb-nav__search-icon {
    position:     absolute;
    left:         13px;
    top:          50%;
    transform:    translateY(-50%);
    color:        var(--text-muted);
    font-size:    .875rem;
    pointer-events: none;
}

.sb-nav__actions {
    display:      flex;
    align-items:  center;
    gap:          6px;
    flex-shrink:  0;
    margin-left:  auto;
}

.sb-nav__icon-btn {
    position:     relative;
    width:        40px;
    height:       40px;
    border-radius: var(--radius);
    background:   transparent;
    border:       none;
    color:        var(--text-secondary);
    display:      flex;
    align-items:  center;
    justify-content: center;
    cursor:       pointer;
    font-size:    1.1rem;
    transition:   background .15s, color .15s;
    text-decoration: none;
}

.sb-nav__icon-btn:hover {
    background: var(--bg-elevated);
    color:      var(--text);
}

.sb-nav__badge {
    position:     absolute;
    top:          4px;
    right:        4px;
    min-width:    18px;
    height:       18px;
    border-radius: 9px;
    background:   var(--danger);
    color:        #fff;
    font-size:    .65rem;
    font-weight:  800;
    display:      flex;
    align-items:  center;
    justify-content: center;
    padding:      0 4px;
    line-height:  1;
}

/* Avatar button */
.sb-nav__avatar {
    width:        36px;
    height:       36px;
    border-radius: 50%;
    background:   var(--brand-muted);
    color:        var(--brand);
    font-size:    .8rem;
    font-weight:  700;
    font-family:  var(--font-display);
    display:      flex;
    align-items:  center;
    justify-content: center;
    border:       2px solid var(--brand-light);
    cursor:       pointer;
    overflow:     hidden;
    flex-shrink:  0;
    transition:   border-color .15s;
}

.sb-nav__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-nav__avatar:hover {
    border-color: var(--brand);
}

/* Page content offset for fixed nav */
.sb-page {
    padding-top: calc(var(--nav-height) + 16px);
    min-height:  100vh;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
══════════════════════════════════════════════════════════════════════════════ */

.sb-bottom-nav {
    display:         flex;
    position:        fixed;
    bottom:          0;
    left:            0;
    right:           0;
    height:          var(--bottom-nav-h);
    background:      var(--bg-surface);
    border-top:      1px solid var(--border);
    z-index:         var(--z-nav);
}

@media (min-width: 768px) {
    .sb-bottom-nav { display: none; }
}

.sb-bottom-nav__item {
    flex:            1;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             3px;
    color:           var(--text-muted);
    text-decoration: none;
    font-size:       .65rem;
    font-weight:     600;
    transition:      color .15s;
    position:        relative;
    cursor:          pointer;
    background:      none;
    border:          none;
    font-family:     var(--font-body);
    padding:         0;
}

.sb-bottom-nav__item i {
    font-size: 1.2rem;
    transition: transform .15s;
}

.sb-bottom-nav__item.active,
.sb-bottom-nav__item:hover {
    color: var(--brand);
}

.sb-bottom-nav__item.active i {
    transform: scale(1.1);
}

.sb-bottom-nav__badge {
    position:  absolute;
    top:       6px;
    right:     calc(50% - 18px);
    min-width: 16px;
    height:    16px;
    border-radius: 8px;
    background: var(--danger);
    color:     #fff;
    font-size: .6rem;
    font-weight: 800;
    display:   flex;
    align-items: center;
    justify-content: center;
    padding:   0 3px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DEAL CARDS
══════════════════════════════════════════════════════════════════════════════ */

.deal-card {
    background:      var(--bg-surface);
    border-radius:   var(--radius-lg);
    border:          1px solid var(--border);
    overflow:        hidden;
    transition:      transform .2s, box-shadow .2s;
    display:         flex;
    flex-direction:  column;
    height:          100%;
}

.deal-card:hover {
    transform:   translateY(-3px);
    box-shadow:  var(--shadow-lg);
}

.deal-card__image-wrap {
    position:    relative;
    aspect-ratio: 16/10;
    overflow:    hidden;
    background:  var(--bg-elevated);
    flex-shrink: 0;
}

.deal-card__image-wrap img {
    width:       100%;
    height:      100%;
    object-fit:  cover;
    transition:  transform .3s;
    display:     block;
}

.deal-card:hover .deal-card__image-wrap img {
    transform: scale(1.04);
}

.deal-card__body {
    padding:     12px 14px;
    flex:        1;
    display:     flex;
    flex-direction: column;
    gap:         6px;
}

.deal-card__footer {
    padding:     0 14px 14px;
}

/* Type badges */
.deal-type-badge {
    position:    absolute;
    top:         10px;
    left:        10px;
    padding:     3px 9px;
    border-radius: var(--radius-xl);
    font-size:   .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

/* Wishlist button */
.deal-wishlist-btn {
    position:    absolute;
    top:         8px;
    right:       8px;
    width:       32px;
    height:      32px;
    border-radius: 50%;
    background:  rgba(255,255,255,.9);
    border:      none;
    display:     flex;
    align-items: center;
    justify-content: center;
    cursor:      pointer;
    color:       var(--text-secondary);
    font-size:   .95rem;
    transition:  background .15s, color .15s, transform .15s;
    backdrop-filter: blur(4px);
}

.deal-wishlist-btn:hover,
.deal-wishlist-btn.active {
    background: #fff0f0;
    color:      var(--danger);
    transform:  scale(1.1);
}

/* Flash countdown badge */
.deal-flash-badge {
    position:    absolute;
    bottom:      10px;
    left:        10px;
    top:         auto;
    right:       auto;
    background:  linear-gradient(135deg, #ef4444, #dc2626);
    color:       #fff;
    padding:     3px 9px;
    border-radius: var(--radius-xl);
    font-size:   .68rem;
    font-weight: 700;
    display:     flex;
    align-items: center;
    gap:         4px;
    animation:   pulse-flash 1.5s ease-in-out infinite;
}

@keyframes pulse-flash {
    0%, 100% { opacity: 1; }
    50%       { opacity: .8; }
}

/* Price display */
.deal-price {
    font-size:  1.1rem;
    font-weight: 800;
    color:      var(--brand-dark);
}

.deal-original-price {
    font-size:   .8rem;
    color:       var(--text-muted);
    text-decoration: line-through;
}

.deal-discount-badge {
    display:     inline-block;
    background:  rgba(16,185,129,.12);
    color:       var(--brand-dark);
    padding:     2px 8px;
    border-radius: var(--radius-xl);
    font-size:   .72rem;
    font-weight: 700;
}

/* Business info row */
.deal-card__biz {
    display:     flex;
    align-items: center;
    gap:         6px;
}

.deal-card__biz-logo {
    width:       22px;
    height:      22px;
    border-radius: 50%;
    object-fit:  cover;
    flex-shrink: 0;
    border:      1px solid var(--border);
}

.deal-card__biz-name {
    font-size:   .75rem;
    color:       var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

/* Title */
.deal-card__title {
    font-size:       .9rem;
    font-weight:     600;
    color:           var(--text);
    line-height:     1.35;
    display:         -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow:        hidden;
}

/* Stats row */
.deal-card__stats {
    font-size:   .73rem;
    color:       var(--text-muted);
    display:     flex;
    gap:         10px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════════ */

.btn {
    display:        inline-flex;
    align-items:    center;
    justify-content: center;
    gap:            7px;
    padding:        9px 18px;
    border-radius:  var(--radius-xl);
    font-family:    var(--font-body);
    font-size:      .875rem;
    font-weight:    600;
    cursor:         pointer;
    border:         none;
    outline:        none;
    transition:     background .15s, transform .1s, box-shadow .15s, opacity .15s;
    text-decoration: none;
    white-space:    nowrap;
    line-height:    1;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--brand);
    color:      var(--text-on-brand);
}
.btn-primary:hover:not(:disabled) {
    background:  var(--brand-dark);
    box-shadow:  0 4px 12px rgba(16,185,129,.3);
    color:       var(--text-on-brand);
}

.btn-secondary {
    background: var(--bg-elevated);
    color:      var(--text-secondary);
    border:     1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    color:      var(--text);
}

.btn-danger {
    background: var(--danger);
    color:      #fff;
}
.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    color:      #fff;
}

.btn-ghost {
    background: transparent;
    color:      var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-elevated);
    color:      var(--text);
}

.btn-outline-brand {
    background:  transparent;
    color:       var(--brand);
    border:      1.5px solid var(--brand);
}
.btn-outline-brand:hover:not(:disabled) {
    background:  var(--brand-muted);
    color:       var(--brand-dark);
}

.btn-sm  { padding: 6px 13px; font-size: .8rem; }
.btn-lg  { padding: 12px 24px; font-size: 1rem; }
.btn-xl  { padding: 14px 28px; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* Spinner inside button */
.btn-spinner {
    width:   14px;
    height:  14px;
    border:  2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    flex-shrink: 0;
}

.btn-secondary .btn-spinner,
.btn-ghost .btn-spinner {
    border-color:     rgba(0,0,0,.15);
    border-top-color: var(--text-secondary);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 18px; }

.form-label {
    display:     block;
    font-size:   .775rem;
    font-weight: 700;
    color:       var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.form-input,
.form-select,
.form-textarea {
    width:        100%;
    background:   var(--bg-elevated);
    border:       1.5px solid var(--border);
    border-radius: var(--radius);
    padding:      10px 14px;
    font-size:    .9rem;
    font-family:  var(--font-body);
    color:        var(--text);
    outline:      none;
    transition:   border-color .15s, box-shadow .15s;
    appearance:   none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand);
    box-shadow:   0 0 0 3px rgba(16,185,129,.12);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-select {
    background-image:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat:   no-repeat;
    background-position: right 12px center;
    padding-right:       34px;
}

.form-textarea { resize: vertical; min-height: 90px; }

.form-hint {
    font-size:  .77rem;
    color:      var(--text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

.form-error {
    font-size:  .77rem;
    color:      var(--danger);
    margin-top: 5px;
}

.form-input.error,
.form-select.error { border-color: var(--danger); }

/* Input with left icon */
.input-icon-wrap {
    position:  relative;
}
.input-icon-wrap .form-input {
    padding-left: 40px;
}
.input-icon-wrap .input-icon {
    position:  absolute;
    left:      13px;
    top:       50%;
    transform: translateY(-50%);
    color:     var(--text-muted);
    font-size: .95rem;
    pointer-events: none;
}

/* Toggle switch */
.toggle-switch {
    position:  relative;
    display:   inline-block;
    width:     44px;
    height:    24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position:  absolute;
    cursor:    pointer;
    inset:     0;
    background: var(--border);
    border-radius: 24px;
    transition: .2s;
}
.toggle-slider::before {
    content:   '';
    position:  absolute;
    width:     18px;
    height:    18px;
    left:      3px;
    bottom:    3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--brand);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}
.toggle-switch input:disabled + .toggle-slider {
    opacity: .5;
    cursor:  not-allowed;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════════════════════ */

.card {
    background:    var(--bg-surface);
    border-radius: var(--radius-lg);
    border:        1px solid var(--border);
    overflow:      hidden;
    box-shadow:    var(--shadow-card);
}

.card-header {
    padding:       14px 18px;
    border-bottom: 1px solid var(--border);
    font-size:     .85rem;
    font-weight:   700;
    color:         var(--text);
    display:       flex;
    align-items:   center;
    gap:           8px;
}

.card-body { padding: 18px; }

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════════════════════════ */

.sb-toast-container {
    position:   fixed;
    bottom:     calc(var(--bottom-nav-h) + 12px);
    right:      16px;
    left:       16px;
    z-index:    var(--z-toast);
    display:    flex;
    flex-direction: column-reverse;
    gap:        8px;
    pointer-events: none;
    max-width:  400px;
    margin:     0 auto;
}

@media (min-width: 640px) {
    .sb-toast-container {
        left:   auto;
        bottom: 24px;
        right:  24px;
    }
}

.sb-toast {
    display:       flex;
    align-items:   center;
    gap:           10px;
    padding:       12px 16px;
    border-radius: var(--radius);
    background:    var(--bg-surface);
    border:        1px solid var(--border);
    box-shadow:    var(--shadow-lg);
    font-size:     .875rem;
    font-weight:   500;
    color:         var(--text);
    pointer-events: all;
    animation:     toast-in .25s cubic-bezier(0.34,1.56,0.64,1);
    max-width:     100%;
}

.sb-toast.success { border-left: 4px solid var(--success); }
.sb-toast.error   { border-left: 4px solid var(--danger);  }
.sb-toast.warning { border-left: 4px solid var(--warning); }
.sb-toast.info    { border-left: 4px solid var(--info);    }

.sb-toast.removing {
    animation: toast-out .2s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateY(0)    scale(1);   }
    to   { opacity: 0; transform: translateY(8px)  scale(.96); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MODAL / OVERLAY
══════════════════════════════════════════════════════════════════════════════ */

.sb-overlay {
    position:   fixed;
    inset:      0;
    background: var(--bg-overlay);
    z-index:    var(--z-modal);
    display:    flex;
    align-items: center;
    justify-content: center;
    padding:    16px;
    animation:  overlay-in .15s ease;
}

@keyframes overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sb-modal {
    background:    var(--bg-surface);
    border-radius: var(--radius-lg);
    max-width:     480px;
    width:         100%;
    max-height:    90vh;
    overflow-y:    auto;
    box-shadow:    var(--shadow-lg);
    animation:     modal-in .2s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.sb-modal-header {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    padding:       16px 20px;
    border-bottom: 1px solid var(--border);
}

.sb-modal-title {
    font-size:   1rem;
    font-weight: 700;
    color:       var(--text);
}

.sb-modal-close {
    width:        32px;
    height:       32px;
    border-radius: var(--radius-sm);
    background:   transparent;
    border:       none;
    color:        var(--text-muted);
    cursor:       pointer;
    display:      flex;
    align-items:  center;
    justify-content: center;
    font-size:    1rem;
    transition:   background .15s;
}
.sb-modal-close:hover { background: var(--bg-elevated); color: var(--text); }

.sb-modal-body    { padding: 20px; }
.sb-modal-footer  { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* Bottom sheet (mobile modal) */
.sb-sheet {
    position:      fixed;
    bottom:        0;
    left:          0;
    right:         0;
    background:    var(--bg-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height:    90vh;
    overflow-y:    auto;
    z-index:       var(--z-modal);
    box-shadow:    0 -8px 40px rgba(0,0,0,.15);
    animation:     sheet-in .25s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes sheet-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0);    }
}

.sb-sheet-handle {
    width:        40px;
    height:       4px;
    border-radius: 2px;
    background:   var(--border);
    margin:       10px auto 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   VOUCHER CARD
══════════════════════════════════════════════════════════════════════════════ */

.voucher-card {
    background:    var(--bg-surface);
    border-radius: var(--radius-lg);
    border:        2px solid var(--border);
    overflow:      hidden;
    transition:    border-color .15s, box-shadow .15s;
}

.voucher-card.active-voucher {
    border-color: var(--brand);
    box-shadow:   0 0 0 4px rgba(16,185,129,.08);
}

.voucher-card.used-voucher   { border-color: var(--border); opacity: .7; }
.voucher-card.expired-voucher { border-color: #fca5a5; }

.voucher-code {
    font-family:   'Courier New', monospace;
    font-size:     1.3rem;
    font-weight:   800;
    letter-spacing: .15em;
    color:         var(--text);
    background:    var(--bg-elevated);
    padding:       10px 14px;
    border-radius: var(--radius);
    text-align:    center;
    user-select:   all;
    cursor:        pointer;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FILTERS SIDEBAR / BOTTOM SHEET
══════════════════════════════════════════════════════════════════════════════ */

.filter-chip {
    display:       inline-flex;
    align-items:   center;
    gap:           5px;
    padding:       5px 12px;
    border-radius: var(--radius-xl);
    background:    var(--bg-elevated);
    border:        1px solid var(--border);
    font-size:     .78rem;
    font-weight:   600;
    color:         var(--text-secondary);
    cursor:        pointer;
    transition:    all .15s;
    user-select:   none;
}

.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip.active {
    background:   rgba(16,185,129,.1);
    border-color: var(--brand);
    color:        var(--brand-dark);
}

/* Active filter pill (dismissible) */
.active-filter-pill {
    display:       inline-flex;
    align-items:   center;
    gap:           5px;
    padding:       4px 10px;
    border-radius: var(--radius-xl);
    background:    rgba(16,185,129,.1);
    border:        1px solid rgba(16,185,129,.3);
    font-size:     .75rem;
    font-weight:   600;
    color:         var(--brand-dark);
}

.active-filter-pill button {
    background: none;
    border:     none;
    padding:    0;
    cursor:     pointer;
    color:      inherit;
    line-height: 1;
    font-size:  .8rem;
    opacity:    .7;
    transition: opacity .15s;
}

.active-filter-pill button:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════════════
   MAPBOX OVERRIDES
══════════════════════════════════════════════════════════════════════════════ */

.mapboxgl-map {
    border-radius: var(--radius-lg);
    font-family:  var(--font-body) !important;
}

.mapboxgl-popup-content {
    background:    var(--bg-surface) !important;
    border:        1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow:    var(--shadow-lg) !important;
    padding:       0 !important;
    min-width:     200px;
    overflow:      hidden;
    font-family:   var(--font-body) !important;
}

.mapboxgl-popup-close-button {
    font-size: 1.1rem;
    right:     8px;
    top:       6px;
    color:     var(--text-muted);
}

.mapboxgl-popup-tip { display: none; }

/* Deal pin popup content */
.map-popup {
    padding: 12px;
}

.map-popup__img {
    width:        100%;
    height:       110px;
    object-fit:   cover;
    margin:       -0px;
    border-radius: 0;
    margin-bottom: 10px;
}

.map-popup__title {
    font-size:   .85rem;
    font-weight: 600;
    color:       var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.map-popup__price {
    font-size:   1rem;
    font-weight: 800;
    color:       var(--brand-dark);
}

/* ══════════════════════════════════════════════════════════════════════════════
   SKELETON LOADING
══════════════════════════════════════════════════════════════════════════════ */

.skeleton {
    background:             linear-gradient(90deg, var(--bg-elevated) 25%, var(--border) 50%, var(--bg-elevated) 75%);
    background-size:        200% 100%;
    animation:              skeleton-shimmer 1.4s infinite;
    border-radius:          var(--radius);
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════════════════════ */

.empty-state {
    padding:    60px 24px;
    text-align: center;
}

.empty-state__icon {
    width:         64px;
    height:        64px;
    border-radius: 50%;
    background:    var(--bg-elevated);
    display:       flex;
    align-items:   center;
    justify-content: center;
    font-size:     1.8rem;
    color:         var(--text-muted);
    margin:        0 auto 16px;
}

.empty-state__title {
    font-size:   1.05rem;
    font-weight: 700;
    color:       var(--text);
    margin-bottom: 6px;
}

.empty-state__text {
    font-size: .875rem;
    color:     var(--text-muted);
    max-width: 320px;
    margin:    0 auto 20px;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════════
   COUNTDOWN TIMER
══════════════════════════════════════════════════════════════════════════════ */

/* Inline countdown — "2h 14m 33s" style */
.countdown-segments {
    display:     inline-flex;
    align-items: center;
    gap:         3px;
    font-family: var(--font-display);
    font-size:   .62rem;
    font-weight: 800;
    color:       #fff;
    letter-spacing: .02em;
}

.countdown-seg {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.countdown-seg__value {
    display:    inline;
    font-size:  .62rem;
    font-weight: 800;
    color:      #fff;
}

.countdown-seg__label {
    display:    inline;
    font-size:  .62rem;
    font-weight: 600;
    color:      rgba(255,255,255,.8);
    margin-right: 3px;
}
/* ══════════════════════════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════════════════════════ */

.auth-page {
    min-height:      100vh;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         24px 16px;
    background:      var(--bg-body);
}

.auth-card {
    background:    var(--bg-surface);
    border-radius: var(--radius-xl);
    border:        1px solid var(--border);
    box-shadow:    var(--shadow-lg);
    padding:       32px 28px;
    width:         100%;
    max-width:     420px;
}

.auth-logo {
    font-family: var(--font-display);
    font-size:   1.6rem;
    font-weight: 800;
    color:       var(--brand);
    text-align:  center;
    margin-bottom: 6px;
}

.auth-tagline {
    font-size:   .875rem;
    color:       var(--text-muted);
    text-align:  center;
    margin-bottom: 28px;
}

.auth-divider {
    display:       flex;
    align-items:   center;
    gap:           12px;
    margin:        20px 0;
    font-size:     .78rem;
    color:         var(--text-muted);
}
.auth-divider::before,
.auth-divider::after {
    content:  '';
    flex:     1;
    height:   1px;
    background: var(--border);
}

/* ══════════════════════════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════════════════════════ */

.text-brand   { color: var(--brand); }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.bg-brand-muted { background: var(--brand-muted); }
.bg-surface     { background: var(--bg-surface); }
.bg-elevated    { background: var(--bg-elevated); }

.border-brand { border-color: var(--brand) !important; }

.truncate-2 {
    display:             -webkit-box;
    -webkit-line-clamp:  2;
    -webkit-box-orient:  vertical;
    overflow:            hidden;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Visually hide but keep accessible */
.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;
}
/* ══ CAROUSEL ══════════════════════════════════════════════════════════════ */

.carousel-wrap {
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scroll-behavior: smooth;
}

.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track { -ms-overflow-style: none; scrollbar-width: none; }

.carousel-item {
    flex-shrink: 0;
    width: 180px;
    scroll-snap-align: start;
}

@media(min-width: 640px)  { .carousel-item { width: 200px; } }
@media(min-width: 1024px) { .carousel-item { width: 220px; } }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    color: var(--text);
    font-size: .85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background .15s, border-color .15s;
}

.carousel-btn:hover {
    background: var(--brand-muted);
    border-color: var(--brand);
    color: var(--brand);
}

.carousel-btn--prev { left: -14px; }
.carousel-btn--next { right: -14px; }

/* Hide arrows on mobile (touch scroll is enough) */
@media(max-width: 639px) {
    .carousel-btn { display: none; }
    .carousel-wrap { margin: 0; }
}