/* ═══════════════════════════════════════════════════════════════════
   TISHTARI - Customer Marketplace Theme
   Royal Purple + Gold + Pearl White
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Brand Colors */
    --tsh-primary: #5B21B6;
    --tsh-primary-hover: #4C1D95;
    --tsh-primary-light: #EDE9FE;
    --tsh-primary-dark: #3B0F7E;
    
    --tsh-gold: #D4AF37;
    --tsh-gold-hover: #B8941F;
    --tsh-gold-light: #FEF3C7;
    --tsh-gold-dark: #92760D;
    
    --tsh-accent: #EC4899;
    --tsh-accent-light: #FCE7F3;
    
    /* Status */
    --tsh-success: #10B981;
    --tsh-success-light: #D1FAE5;
    --tsh-danger: #EF4444;
    --tsh-danger-light: #FEE2E2;
    --tsh-warning: #F59E0B;
    --tsh-warning-light: #FEF3C7;
    --tsh-info: #3B82F6;
    --tsh-info-light: #DBEAFE;
    
    /* Backgrounds */
    --tsh-bg-main: #FAFAFA;
    --tsh-bg-card: #FFFFFF;
    --tsh-bg-section: #F8F7FB;
    --tsh-bg-overlay: rgba(91, 33, 182, 0.06);
    
    /* Text */
    --tsh-text-primary: #1F2937;
    --tsh-text-secondary: #4B5563;
    --tsh-text-muted: #9CA3AF;
    --tsh-text-inverse: #FFFFFF;
    --tsh-text-on-primary: #FFFFFF;
    
    /* Borders */
    --tsh-border: #E5E7EB;
    --tsh-border-light: #F3F4F6;
    --tsh-border-strong: #D1D5DB;
    
    /* Shadows */
    --tsh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --tsh-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --tsh-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --tsh-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --tsh-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --tsh-shadow-royal: 0 8px 32px rgba(91, 33, 182, 0.15);
    --tsh-shadow-gold: 0 4px 14px rgba(212, 175, 55, 0.25);
    
    /* Radius */
    --tsh-radius-sm: 6px;
    --tsh-radius: 10px;
    --tsh-radius-md: 12px;
    --tsh-radius-lg: 16px;
    --tsh-radius-xl: 24px;
    --tsh-radius-full: 9999px;
    
    /* Spacing */
    --tsh-container-max: 1280px;
    
    /* Transitions */
    --tsh-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --tsh-transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-Index layers */
    --tsh-z-dropdown: 1000;
    --tsh-z-sticky: 1020;
    --tsh-z-modal: 1050;
    --tsh-z-popover: 1060;
    --tsh-z-toast: 1080;
}

/* ─────────────────────────────────────────────────────────
   Base Typography
   ───────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--tsh-bg-main);
    color: var(--tsh-text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body[dir="rtl"] {
    font-family: 'Tajawal', 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', 'Tajawal', serif;
    font-weight: 700;
    color: var(--tsh-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

body[dir="rtl"] h1, body[dir="rtl"] h2, body[dir="rtl"] h3,
body[dir="rtl"] h4, body[dir="rtl"] h5, body[dir="rtl"] h6 {
    font-family: 'Tajawal', sans-serif;
}

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

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

/* ─────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────── */
.btn {
    font-weight: 600;
    border-radius: var(--tsh-radius);
    padding: 0.625rem 1.5rem;
    transition: var(--tsh-transition);
    border: none;
    letter-spacing: 0.01em;
}

.btn-primary, .btn-tishtari {
    background: linear-gradient(135deg, var(--tsh-primary) 0%, var(--tsh-primary-hover) 100%);
    color: white;
    box-shadow: 0 1px 2px rgba(91, 33, 182, 0.15);
}

.btn-primary:hover, .btn-tishtari:hover {
    background: linear-gradient(135deg, var(--tsh-primary-hover) 0%, var(--tsh-primary-dark) 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--tsh-shadow-royal);
}

.btn-gold {
    background: linear-gradient(135deg, var(--tsh-gold) 0%, var(--tsh-gold-hover) 100%);
    color: white;
    box-shadow: var(--tsh-shadow-gold);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--tsh-gold-hover) 0%, var(--tsh-gold-dark) 100%);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: white;
    color: var(--tsh-primary);
    border: 2px solid var(--tsh-primary);
}

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

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-pill {
    border-radius: var(--tsh-radius-full);
}

/* ─────────────────────────────────────────────────────────
   Cards
   ───────────────────────────────────────────────────────── */
.card {
    background: var(--tsh-bg-card);
    border: 1px solid var(--tsh-border-light);
    border-radius: var(--tsh-radius-md);
    box-shadow: var(--tsh-shadow);
    overflow: hidden;
    transition: var(--tsh-transition);
}

.card:hover {
    box-shadow: var(--tsh-shadow-md);
}

.product-card {
    border: 1px solid var(--tsh-border-light);
    border-radius: var(--tsh-radius-lg);
    overflow: hidden;
    background: white;
    transition: var(--tsh-transition);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tsh-shadow-lg);
    border-color: var(--tsh-primary-light);
}

.product-card .product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--tsh-bg-section);
    position: relative;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-body {
    padding: 1rem;
}

.product-card .product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tsh-text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-merchant {
    font-size: 0.8rem;
    color: var(--tsh-text-muted);
    margin-bottom: 0.5rem;
}

.product-card .product-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--tsh-primary);
}

.product-card .product-price-old {
    font-size: 0.85rem;
    color: var(--tsh-text-muted);
    text-decoration: line-through;
    margin-inline-end: 0.5rem;
}

.product-card .badge-discount {
    position: absolute;
    top: 0.75rem;
    inset-inline-start: 0.75rem;
    background: var(--tsh-danger);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--tsh-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.product-card .btn-add-cart {
    width: 100%;
    background: var(--tsh-primary-light);
    color: var(--tsh-primary);
    border: none;
    padding: 0.5rem;
    border-radius: var(--tsh-radius-sm);
    font-weight: 600;
    transition: var(--tsh-transition);
    margin-top: 0.75rem;
}

.product-card .btn-add-cart:hover {
    background: var(--tsh-primary);
    color: white;
}

/* ─────────────────────────────────────────────────────────
   Store / Merchant Cards
   ───────────────────────────────────────────────────────── */
.store-card {
    border-radius: var(--tsh-radius-lg);
    overflow: hidden;
    background: white;
    border: 1px solid var(--tsh-border-light);
    transition: var(--tsh-transition);
    height: 100%;
}

.store-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tsh-shadow-lg);
}

.store-card .store-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--tsh-primary) 0%, var(--tsh-accent) 100%);
    position: relative;
    overflow: hidden;
}

.store-card .store-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-card .store-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--tsh-radius-full);
    border: 4px solid white;
    background: white;
    overflow: hidden;
    margin: -32px auto 0;
    box-shadow: var(--tsh-shadow);
    position: relative;
    z-index: 2;
}

.store-card .store-body {
    padding: 1rem;
    text-align: center;
}

.store-card .store-name {
    font-weight: 700;
    color: var(--tsh-text-primary);
    margin-bottom: 0.25rem;
}

.store-card .store-meta {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--tsh-text-muted);
}

/* ─────────────────────────────────────────────────────────
   Category Tiles
   ───────────────────────────────────────────────────────── */
.category-tile {
    background: white;
    border-radius: var(--tsh-radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--tsh-text-primary);
    transition: var(--tsh-transition);
    border: 2px solid transparent;
    height: 100%;
    display: block;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: var(--tsh-primary-light);
    box-shadow: var(--tsh-shadow-lg);
    color: var(--tsh-primary);
}

.category-tile .category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
    border-radius: var(--tsh-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--tsh-primary-light);
    color: var(--tsh-primary);
    transition: var(--tsh-transition);
}

.category-tile:hover .category-icon {
    background: var(--tsh-primary);
    color: white;
}

.category-tile .category-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────────────────
   Hero Section
   ───────────────────────────────────────────────────────── */
.tsh-hero {
    background: linear-gradient(135deg, var(--tsh-primary) 0%, var(--tsh-accent) 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.tsh-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    inset-inline-end: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.tsh-hero-content {
    position: relative;
    z-index: 1;
}

.tsh-hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tsh-hero .lead {
    color: rgba(255,255,255,0.9);
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

/* ─────────────────────────────────────────────────────────
   Search Bar (Hero)
   ───────────────────────────────────────────────────────── */
.tsh-search-box {
    background: white;
    border-radius: var(--tsh-radius-full);
    padding: 0.5rem;
    box-shadow: var(--tsh-shadow-xl);
    display: flex;
    align-items: center;
}

.tsh-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    color: var(--tsh-text-primary);
    outline: none;
}

.tsh-search-box button {
    background: var(--tsh-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: var(--tsh-radius-full);
    font-weight: 600;
    transition: var(--tsh-transition);
}

.tsh-search-box button:hover {
    background: var(--tsh-primary-hover);
}

/* ─────────────────────────────────────────────────────────
   Navbar
   ───────────────────────────────────────────────────────── */
.tsh-navbar {
    background: white;
    box-shadow: var(--tsh-shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: var(--tsh-z-sticky);
}

.tsh-navbar .navbar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--tsh-primary);
}

.tsh-navbar .nav-link {
    color: var(--tsh-text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--tsh-radius);
    transition: var(--tsh-transition);
}

.tsh-navbar .nav-link:hover {
    color: var(--tsh-primary);
    background: var(--tsh-primary-light);
}

.tsh-cart-badge {
    position: absolute;
    top: -4px;
    inset-inline-end: -4px;
    background: var(--tsh-gold);
    color: white;
    border-radius: var(--tsh-radius-full);
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ─────────────────────────────────────────────────────────
   Section Headers
   ───────────────────────────────────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--tsh-border-light);
}

.section-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--tsh-text-primary);
}

.section-header .section-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tsh-primary);
}

/* ─────────────────────────────────────────────────────────
   Badges
   ───────────────────────────────────────────────────────── */
.badge-success { background: var(--tsh-success-light); color: var(--tsh-success); padding: 0.25rem 0.75rem; border-radius: var(--tsh-radius-full); font-weight: 600; font-size: 0.75rem; }
.badge-danger { background: var(--tsh-danger-light); color: var(--tsh-danger); padding: 0.25rem 0.75rem; border-radius: var(--tsh-radius-full); font-weight: 600; font-size: 0.75rem; }
.badge-warning { background: var(--tsh-warning-light); color: var(--tsh-warning-dark, #92760D); padding: 0.25rem 0.75rem; border-radius: var(--tsh-radius-full); font-weight: 600; font-size: 0.75rem; }
.badge-gold { background: var(--tsh-gold-light); color: var(--tsh-gold-dark); padding: 0.25rem 0.75rem; border-radius: var(--tsh-radius-full); font-weight: 600; font-size: 0.75rem; }

/* ─────────────────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────────────────── */
.form-control, .form-select {
    border: 1.5px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
    padding: 0.625rem 1rem;
    transition: var(--tsh-transition);
    font-size: 0.95rem;
    background: white;
}

.form-control:focus, .form-select:focus {
    border-color: var(--tsh-primary);
    box-shadow: 0 0 0 4px var(--tsh-primary-light);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--tsh-text-primary);
    margin-bottom: 0.4rem;
}

/* ─────────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────────── */
.tsh-footer {
    background: var(--tsh-text-primary);
    color: rgba(255,255,255,0.85);
    padding: 4rem 0 2rem;
}

.tsh-footer h5 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 700;
}

.tsh-footer a {
    color: rgba(255,255,255,0.7);
    transition: var(--tsh-transition);
}

.tsh-footer a:hover {
    color: var(--tsh-gold);
}

/* ─────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tsh-hero { padding: 3rem 0; }
    .tsh-hero h1 { font-size: 2rem; }
    .section-header h2 { font-size: 1.25rem; }
}

/* ─────────────────────────────────────────────────────────
   RTL Adjustments
   ───────────────────────────────────────────────────────── */
body[dir="rtl"] .tsh-hero::before {
    inset-inline-end: auto;
    inset-inline-start: -10%;
}
