/*
Theme Name: Referral Starter
Theme URI: https://example.com/referral-starter
Author: Your Name
Author URI: https://example.com
Description: A clean, trust-first referral code directory theme. Mobile-first, fast, and designed to work with referral rotation plugins. Inspired by ShareMyLink.co.uk.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: referral-starter
Tags: referral, affiliate, directory, mobile-first, minimal

Referral Starter is a clean WordPress theme for referral code directories.
It is designed to work with separate referral rotation plugins via REST API.
*/

/* ==========================================================================
   CSS Architecture: Minimal Utility System
   
   Why not Tailwind?
   - Keeps theme dependency-free (no build step required)
   - Smaller footprint for simple sites
   - Easy to customize without tooling
   
   Why not Bootstrap?
   - Too heavy for this use case
   - Encourages over-styling
   
   This approach:
   - Small set of utility classes for common patterns
   - BEM-style component classes for specific UI
   - CSS custom properties for theming
   - Mobile-first media queries
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Colors - Neutral, trustworthy palette */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #dbeafe;
    
    --color-success: #059669;
    --color-success-light: #d1fae5;
    
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;
    
    --color-bg: #ffffff;
    --color-bg-alt: #f9fafb;
    --color-bg-muted: #f3f4f6;
    
    --color-border: #e5e7eb;
    --color-border-dark: #d1d5db;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    
    /* Container */
    --container-max: 1610px;
    --container-narrow: 800px;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

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

* {
    margin: 0;
}

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

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

a:hover {
    color: var(--color-primary-hover);
}

/* ==========================================================================
   3. Utility Classes
   ========================================================================== */

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.container--narrow {
    max-width: var(--container-narrow);
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Spacing */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* Typography */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }

/* Visibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden { display: none; }

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
}

/* ==========================================================================
   4. Component Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   4.1 Header
   -------------------------------------------------------------------------- */

.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
}

.site-logo:hover {
    color: var(--color-text);
}

.site-logo__icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Primary Navigation */
.nav-primary {
    display: none;
}

@media (min-width: 768px) {
    .nav-primary {
        display: flex;
        align-items: center;
        gap: var(--space-6);
    }
}

.nav-primary__link {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) 0;
    transition: color var(--transition-fast);
}

.nav-primary__link:hover,
.nav-primary__link--active {
    color: var(--color-text);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text);
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

/* Mobile Navigation */
.nav-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
}

.nav-mobile.is-active {
    display: block;
}

@media (min-width: 768px) {
    .nav-mobile {
        display: none !important;
    }
}

.nav-mobile__link {
    display: block;
    padding: var(--space-3) 0;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.nav-mobile__link:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   4.2 Country Selector
   -------------------------------------------------------------------------- */

.country-selector {
    position: relative;
}

.country-selector__trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--color-text);
    transition: border-color var(--transition-fast);
}

.country-selector__trigger:hover {
    border-color: var(--color-border-dark);
}

.country-selector__flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.country-selector__dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 200px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 50;
}

.country-selector__dropdown.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.country-selector__option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--color-text);
    text-align: left;
    transition: background var(--transition-fast);
}

.country-selector__option:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.country-selector__option:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.country-selector__option:hover {
    background: var(--color-bg-muted);
}

.country-selector__option.is-selected {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.country-selector__option-check {
    margin-left: auto;
    opacity: 0;
}

.country-selector__option.is-selected .country-selector__option-check {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   4.3 Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

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

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

.btn--secondary:hover {
    background: var(--color-bg-muted);
    border-color: var(--color-border-dark);
    color: var(--color-text);
}

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

.btn--success:hover {
    background: #047857;
    color: white;
}

.btn--sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn--lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

.btn--full {
    width: 100%;
}

/* --------------------------------------------------------------------------
   4.4 Cards
   -------------------------------------------------------------------------- */

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

.card:hover {
    border-color: var(--color-border-dark);
    box-shadow: var(--shadow-md);
}

.card__body {
    padding: var(--space-5);
}

.card__footer {
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   4.5 Offer Card (ShareMyLink Style)
   -------------------------------------------------------------------------- */

.offer-card {
    background-color: #1e2530 !important;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.offer-card__main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    padding-bottom: 12px;
}

.offer-card__logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background-color: #2a3441;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.offer-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.offer-card__logo-placeholder {
    font-size: 1.5rem;
    font-weight: 700;
    color: #6b7280;
}

.offer-card__content {
    flex: 1;
    min-width: 0;
}

.offer-card__name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff !important;
    margin: 0 0 4px 0;
}

.offer-card__desc {
    font-size: 0.875rem;
    color: #9ca3af !important;
    margin: 0;
    line-height: 1.4;
}

.offer-card__rewards {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.offer-card__reward {
    font-size: 0.9rem;
    font-weight: 600;
}

.offer-card__reward--you,
.offer-card__reward--ref {
    color: #10b981 !important;
}

.offer-card__reward-divider {
    color: #4a5568;
    font-weight: 400;
}

.offer-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 16px;
    padding: 12px 16px;
    background-color: #10b981 !important;
    color: #ffffff !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.offer-card__btn:hover {
    background-color: #059669 !important;
    color: #ffffff !important;
    text-decoration: none;
}

.offer-card__btn svg {
    flex-shrink: 0;
}

/* Toggle wrapper */
.offer-card__toggle-wrap {
    border-top: 1px solid #2a3441;
}

/* Hidden checkbox for CSS-only toggle */
.offer-card__checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Footer toggle label */
.offer-card__footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.offer-card__footer:hover {
    background-color: rgba(255,255,255,0.05);
}

.offer-card__arrow {
    color: #6b7280;
    transition: transform 0.3s ease;
}

/* Expandable content - hidden by default */
.offer-card__expandable {
    max-height: 0;
    overflow: hidden;
    background-color: #161b22;
    transition: max-height 0.3s ease;
}

/* When checkbox is checked, expand and rotate arrow */
.offer-card__checkbox:checked ~ .offer-card__footer .offer-card__arrow {
    transform: rotate(180deg);
}

.offer-card__checkbox:checked ~ .offer-card__expandable {
    max-height: 100px;
}

.offer-card__meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 0.8rem;
}

.offer-card__links-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
}

.offer-card__links-info svg {
    color: #6b7280;
}

.offer-card__cta-text {
    color: #6b7280;
    font-size: 0.75rem;
}

/* Legacy retailer-card styles (keep for backwards compatibility) */
.retailer-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.retailer-card__header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
}

.retailer-card__logo {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: var(--color-bg-muted);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.retailer-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.retailer-card__logo--placeholder {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   4.6 Leaderboard
   -------------------------------------------------------------------------- */

.leaderboard {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.leaderboard__header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.leaderboard__title {
    font-size: var(--text-base);
    font-weight: 600;
}

.leaderboard__list {
    list-style: none;
    padding: 0;
}

.leaderboard__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.leaderboard__item:last-child {
    border-bottom: none;
}

.leaderboard__rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
}

.leaderboard__rank--1 {
    background: #fef3c7;
    color: #b45309;
    border-radius: var(--radius-full);
}

.leaderboard__rank--2 {
    background: #e5e7eb;
    color: #4b5563;
    border-radius: var(--radius-full);
}

.leaderboard__rank--3 {
    background: #fed7aa;
    color: #c2410c;
    border-radius: var(--radius-full);
}

.leaderboard__user {
    flex: 1;
    min-width: 0;
}

.leaderboard__username {
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard__clicks {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   4.7 Forms
   -------------------------------------------------------------------------- */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.form-label--required::after {
    content: '*';
    color: var(--color-danger);
    margin-left: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-input::placeholder {
    color: var(--color-text-light);
}

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

.form-help {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-danger);
    margin-top: var(--space-2);
}

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

/* Autocomplete dropdown */
.form-autocomplete {
    position: relative;
}

.form-autocomplete__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.form-autocomplete__results.is-active {
    display: block;
}

.form-autocomplete__item {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-size: var(--text-sm);
}

.form-autocomplete__item:hover {
    background: var(--color-bg-muted);
}

.form-autocomplete__item--new {
    color: var(--color-primary);
    font-weight: 500;
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   4.8 Search
   -------------------------------------------------------------------------- */

.search-form {
    position: relative;
    max-width: 400px;
}

.search-form__input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: var(--space-10);
    font-size: var(--text-sm);
    background: var(--color-bg-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.search-form__input:focus {
    background: var(--color-bg);
    border-color: var(--color-border);
    outline: none;
}

.search-form__icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   4.9 Hero Section
   -------------------------------------------------------------------------- */

.hero {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-bg) 100%);
    padding: var(--space-12) 0;
    text-align: center;
}

@media (min-width: 768px) {
    .hero {
        padding: var(--space-16) 0;
    }
}

.hero__title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .hero__title {
        font-size: var(--text-3xl);
    }
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-6);
}

.hero__search {
    max-width: 500px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   4.10 Category Pills
   -------------------------------------------------------------------------- */

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: var(--space-4) 0;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.category-pill:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.category-pill--active,
.category-pill.is-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.category-pill--active:hover,
.category-pill.is-active:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    transform: translateY(-1px);
}

.category-pill__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50px;
}

.category-pill.is-active .category-pill__count {
    background: rgba(255, 255, 255, 0.25);
}

.category-pill__emoji {
    font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   4.11 Section
   -------------------------------------------------------------------------- */

.section {
    padding: var(--space-8) 0;
}

@media (min-width: 768px) {
    .section {
        padding: var(--space-12) 0;
    }
}

.section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.section__title {
    font-size: var(--text-xl);
    font-weight: 600;
}

.section__link {
    font-size: var(--text-sm);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   4.12 Trust Banner / Disclosure
   -------------------------------------------------------------------------- */

.trust-banner {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
}

.trust-banner__inner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.trust-banner__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-primary);
}

.trust-banner__content {
    flex: 1;
}

.trust-banner__title {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.trust-banner__text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}

/* --------------------------------------------------------------------------
   4.13 Footer
   -------------------------------------------------------------------------- */

.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: var(--space-12) 0 var(--space-6);
}

.footer-grid {
    display: grid;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-col__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

.footer-col__list {
    list-style: none;
    padding: 0;
}

.footer-col__link {
    display: block;
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.footer-col__link:hover {
    color: var(--color-text);
}

.footer-bottom {
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   4.14 Alerts / Notices
   -------------------------------------------------------------------------- */

.alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.alert--info {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.alert--success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.alert--warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.alert--error {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   4.15 Loading States
   -------------------------------------------------------------------------- */

.skeleton {
    background: linear-gradient(90deg, var(--color-bg-muted) 25%, var(--color-bg-alt) 50%, var(--color-bg-muted) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

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

.skeleton--text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton--title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton--avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   5. Page-Specific Styles
   ========================================================================== */

/* Single Retailer Page */
.retailer-single__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding: var(--space-8) 0;
}

@media (min-width: 768px) {
    .retailer-single__header {
        flex-direction: row;
        align-items: flex-start;
    }
}

.retailer-single__logo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: var(--color-bg-muted);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.retailer-single__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.retailer-single__info {
    flex: 1;
}

.retailer-single__title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.retailer-single__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.retailer-single__content {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 768px) {
    .retailer-single__content {
        grid-template-columns: 2fr 1fr;
    }
}

/* Submit Referral Page */
.submit-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-8) 0;
}

.submit-page__title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.submit-page__subtitle {
    color: var(--color-text-muted);
    margin-bottom: var(--space-8);
}

/* ==========================================================================
   6. Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .country-selector,
    .btn {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
}
