/* ============================================================
   BarberHub - Mobile-First Stylesheet
   Built for 99% mobile usage
   Breakpoints: mobile < 480px | tablet 480-768px | desktop > 768px
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary:       #1a1a1a;
    --primary-dark:  #151515;
    --secondary:     #2d2d2d;
    --accent:        #d4af37;
    --success:       #4CAF50;
    --warning:       #FF9800;
    --danger:        #f44336;
    --bg:            #F5F5F5;
    --card-bg:       #FFFFFF;
    --text:          #2D3436;
    --text-light:    #636E72;
    --border:        #E0E0E0;
    --shadow:        0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg:     0 8px 24px rgba(0,0,0,0.12);
    --radius:        12px;
    --radius-lg:     20px;
    --header-height: 60px;
    --nav-height:    60px;
    --safe-bottom:   env(safe-area-inset-bottom, 0px);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ── HEADER / NAV ─────────────────────────────────────────── */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    gap: 1rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon { font-size: 24px; }

/* Desktop nav */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(233, 30, 99, 0.08);
    text-decoration: none;
}

/* Hamburger button (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Mobile drawer */
.nav-drawer {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 99;
    padding: 1.5rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-drawer a,
.nav-drawer button {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-drawer a:hover,
.nav-drawer button:hover {
    background: var(--bg);
    text-decoration: none;
}

.nav-drawer a.active {
    color: var(--primary);
    background: rgba(233, 30, 99, 0.08);
}

/* Logout button */
.btn-logout {
    background: var(--danger) !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1 { font-size: clamp(22px, 5vw, 32px); margin-bottom: 0.75rem; }
h2 { font-size: clamp(18px, 4vw, 24px); margin-bottom: 0.75rem; }
h3 { font-size: clamp(16px, 3.5vw, 20px); margin-bottom: 0.5rem; }
h4 { font-size: 16px; margin-bottom: 0.4rem; }

p { margin-bottom: 0.75rem; }
small { font-size: 13px; }

.tagline {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 15px;
}

/* ── AUTH PAGES ───────────────────────────────────────────── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px; /* prevents iOS zoom */
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(26, 26, 26, 0.03);
}

/* Checkboxes - restore native appearance so they show the tick */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    accent-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
    color: #b0b0b0;
}

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

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636E72' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    min-height: 48px; /* Apple HIG minimum tap target */
    -webkit-appearance: none;
    user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 18px rgba(233, 30, 99, 0.4);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(233, 30, 99, 0.05);
    text-decoration: none;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

/* ── MESSAGES / ALERTS ────────────────────────────────────── */
.message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 14px;
    line-height: 1.5;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ── USER TYPE SELECTOR (Register) ───────────────────────── */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.type-option { cursor: pointer; }

.type-option input[type="radio"] { display: none; }

.type-content {
    padding: 1.5rem 0.75rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.25s;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Selected state - black card with gold accents */
.type-option input:checked + .type-content {
    border-color: var(--primary);
    background: var(--primary);
}

.type-option input:checked + .type-content .type-wordmark {
    color: var(--accent);
}

.type-option input:checked + .type-content .type-rule {
    background: var(--accent);
    opacity: 0.5;
}

.type-option input:checked + .type-content .type-sub {
    color: #666;
}

.type-option input:checked + .type-content .type-label {
    color: #888;
}

/* Typography elements */
.type-wordmark {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
}

.type-rule {
    display: block;
    width: 32px;
    height: 1px;
    background: var(--border);
    margin: 0 auto 8px;
}

.type-sub {
    display: block;
    font-size: 8px;
    letter-spacing: 2px;
    color: #bbb;
    font-weight: 500;
    margin-bottom: 8px;
}

.type-label {
    display: block;
    font-weight: 500;
    color: var(--text-light);
    font-size: 11px;
}

/* Keep old .type-icon hidden in case it appears elsewhere */
.type-icon { display: none; }


/* ── PHOTO UPLOAD ─────────────────────────────────────────── */
.photo-upload {
    text-align: center;
    margin-bottom: 1.25rem;
}

.photo-preview {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder { font-size: 50px; }

/* ── PORTFOLIO PHOTOS ─────────────────────────────────────────── */
.portfolio-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
}
.portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.portfolio-thumb .pf-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    pointer-events: none; /* let clicks pass through to the image beneath */
    color: white;
    font-size: 10px;
    padding: 12px 6px 5px;
    line-height: 1.2;
    pointer-events: none;
}
.portfolio-thumb .pf-delete {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.portfolio-thumb .pf-delete:hover { background: #dc3545; }

.portfolio-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f4ff;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    margin-top: 4px;
}

/* Portfolio photo lightbox animations */
@keyframes pfFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfSpin   { to { transform: rotate(360deg); } }

/* ── BARBER CARDS ─────────────────────────────────────────── */
.barber-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.barber-card:active {
    transform: scale(0.98);
}

.barber-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.barber-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barber-image-placeholder { font-size: 80px; color: white; }

.barber-info { padding: 1rem; }

.barber-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.barber-location {
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 14px;
    margin-bottom: 0.5rem;
}

.barber-bio {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── AVAILABILITY TOGGLE ──────────────────────────────────── */
.availability-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.toggle-option { cursor: pointer; }
.toggle-option input[type="radio"] { display: none; }

.toggle-content {
    padding: 0.85rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 14px;
    transition: all 0.2s;
}

.toggle-option input:checked + .toggle-content {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.available  { background: var(--success); }
.status-dot.unavailable { background: #999; }

/* ── SPECIALTY TAGS ───────────────────────────────────────── */
.barber-specialties {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.specialty-tag {
    padding: 5px 10px;
    background: rgba(233, 30, 99, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ── LOADING / SPINNER ────────────────────────────────────── */
.loading {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-icon { font-size: 64px; margin-bottom: 1rem; }

/* ── MODALS ───────────────────────────────────────────────── */
.modal,
.detail-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 200;
    padding: 0;
    overflow-y: auto;
}

.modal.show,
.modal.active,
.detail-modal.show {
    display: flex;
    align-items: flex-end; /* Bottom sheet on mobile */
    justify-content: center;
}

.modal-content,
.detail-content {
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem 1rem;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1.5rem + var(--safe-bottom));
}

/* Drag indicator */
.modal-content::before,
.detail-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 1.25rem;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
    font-size: 14px;
    padding-bottom: 1rem;
}

.footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ── ADMIN NAV ────────────────────────────────────────────── */
.admin-nav {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.admin-nav::-webkit-scrollbar { display: none; }

.admin-nav button {
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    min-height: 40px;
    flex-shrink: 0;
}

.admin-nav button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ── TABLE WRAPPER ────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    font-size: 14px;
}

th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

tr:hover { background: #fafafa; }

/* ── SECTION HEADER ───────────────────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── STAT CARDS ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.stat-card:active { transform: scale(0.97); }

.stat-icon { font-size: 28px; margin-bottom: 4px; }

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ── BACK LINK ────────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1.25rem;
    font-size: 15px;
    padding: 8px 0;
    min-height: 44px;
}

/* ── OFFERS GRID ──────────────────────────────────────────── */
.offers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

/* ── MESSAGES ─────────────────────────────────────────────── */
.messages-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
}

.message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
}

/* ── LEGAL PAGES ──────────────────────────────────────────── */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    box-shadow: var(--shadow);
}

/* ── UTILITY CLASSES ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-light); }
.text-small  { font-size: 13px; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }

/* ── MOBILE STYLES (< 480px) ──────────────────────────────── */
@media (max-width: 480px) {
    :root { --header-height: 56px; }

    .container { padding: 0.75rem; }

    .logo { font-size: 18px; }
    .logo-icon { font-size: 22px; }

    /* Show hamburger, hide desktop nav links */
    .nav-toggle { display: flex; }
    .nav-links a:not(.btn-logout) { display: none; }
    .nav-links { gap: 0.25rem; }
    .btn-logout {
        font-size: 13px !important;
        padding: 7px 10px !important;
    }

    /* Show mobile drawer */
    .nav-drawer { display: flex; }

    .auth-card { padding: 1.5rem 1.25rem; }

    h1 { font-size: 22px; }
    h2 { font-size: 18px; }

    .type-icon { font-size: 30px; }

    .card { padding: 1rem; }

    .modal-content,
    .detail-content {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .stat-number { font-size: 24px; }
    .stat-icon { font-size: 24px; }

    .btn { min-height: 46px; font-size: 15px; }

    .photo-preview { width: 100px; height: 100px; }

    /* Admin nav scrolls horizontally */
    .admin-nav button { font-size: 12px; padding: 7px 12px; }
}

/* ── TABLET STYLES (480px - 768px) ───────────────────────── */
@media (min-width: 480px) and (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links a:not(.btn-logout) { display: none; }
    .nav-drawer { display: flex; }

    .offers-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid  { grid-template-columns: repeat(2, 1fr); }

    .modal-content,
    .detail-content {
        border-radius: 20px 20px 0 0;
    }
}

/* ── DESKTOP STYLES (> 768px) ─────────────────────────────── */
@media (min-width: 768px) {
    .container { padding: 2rem 1.5rem; }

    .nav-toggle { display: none !important; }
    .nav-drawer { display: none !important; }
    .nav-links a { display: flex !important; }
    .nav-links { gap: 0.75rem; }

    .auth-card { padding: 2.5rem; }

    .offers-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
    .stats-grid  { grid-template-columns: repeat(4, 1fr); }

    .modal.show,
    .modal.active,
    .detail-modal.show {
        align-items: center;
        padding: 2rem;
    }

    .modal-content,
    .detail-content {
        border-radius: var(--radius-lg);
        max-width: 600px;
        max-height: 90vh;
    }

    .modal-content::before,
    .detail-content::before {
        display: none;
    }

    h1 { font-size: 32px; }
    h2 { font-size: 24px; }

    .legal-content { padding: 3rem; }
}

/* ── LARGE DESKTOP (> 1024px) ─────────────────────────────── */
@media (min-width: 1024px) {
    .offers-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── SAFE AREA (iPhone notch/home bar) ────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .modal-content,
    .detail-content {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }

    .header {
        padding-top: env(safe-area-inset-top);
    }
}

/* ── PWA STANDALONE MODE ──────────────────────────────────── */
@media (display-mode: standalone) {
    .header {
        padding-top: env(safe-area-inset-top, 20px);
    }
}

/* ── SMOOTH SCROLLING ON IOS ──────────────────────────────── */
.modal-content,
.detail-content,
.admin-nav,
.gallery-scroll {
    -webkit-overflow-scrolling: touch;
}

/* ── PREVENT DOUBLE-TAP ZOOM ON BUTTONS ───────────────────── */
button, a, input, select, textarea {
    touch-action: manipulation;
}
