/* ============================================================
   THEMELY STORE — Main Stylesheet
   Version: 1.0.0 | RTL | Mobile-First | Light Theme
   ============================================================ */

/* ===========================================================
   SECTION 1: CSS VARIABLES (Design Tokens)
   =========================================================== */
:root {
    /* ── الألوان الأساسية ── */
    --tmly-color-primary:        #4F46E5;
    --tmly-color-primary-dark:   #3730A3;
    --tmly-color-primary-light:  #EEF2FF;
    --tmly-color-primary-mid:    #C7D2FE;

    /* ── النجاح والتحذير والخطأ ── */
    --tmly-color-success:        #10B981;
    --tmly-color-success-light:  #D1FAE5;
    --tmly-color-warning:        #F59E0B;
    --tmly-color-warning-light:  #FEF3C7;
    --tmly-color-error:          #EF4444;
    --tmly-color-error-light:    #FEE2E2;

    /* ── النصوص ── */
    --tmly-text-heading:         #111827;
    --tmly-text-body:            #1F2937;
    --tmly-text-secondary:       #4B5563;
    --tmly-text-muted:           #9CA3AF;
    --tmly-text-inverse:         #FFFFFF;

    /* ── الخلفيات ── */
    --tmly-bg-page:              #F9FAFB;
    --tmly-bg-white:             #FFFFFF;
    --tmly-bg-subtle:            #F3F4F6;
    --tmly-bg-primary:           #4F46E5;

    /* ── الحدود ── */
    --tmly-border-color:         #E5E7EB;
    --tmly-border-color-strong:  #D1D5DB;
    --tmly-border-color-primary: #C7D2FE;

    /* ── المسافات (8px base) ── */
    --tmly-space-1:   4px;
    --tmly-space-2:   8px;
    --tmly-space-3:  12px;
    --tmly-space-4:  16px;
    --tmly-space-5:  20px;
    --tmly-space-6:  24px;
    --tmly-space-8:  32px;
    --tmly-space-10: 40px;
    --tmly-space-12: 48px;
    --tmly-space-16: 64px;
    --tmly-space-20: 80px;
    --tmly-space-24: 96px;

    /* ── الخطوط ── */
    --tmly-font:              'Cairo', -apple-system, system-ui, sans-serif;
    --tmly-text-xs:           0.75rem;
    --tmly-text-sm:           0.875rem;
    --tmly-text-base:         1rem;
    --tmly-text-lg:           1.125rem;
    --tmly-text-xl:           1.25rem;
    --tmly-text-2xl:          1.5rem;
    --tmly-text-3xl:          1.875rem;
    --tmly-text-4xl:          2.25rem;
    --tmly-text-5xl:          3rem;

    --tmly-weight-normal:     400;
    --tmly-weight-medium:     500;
    --tmly-weight-semibold:   600;
    --tmly-weight-bold:       700;
    --tmly-weight-extrabold:  800;

    --tmly-leading-tight:     1.25;
    --tmly-leading-normal:    1.6;
    --tmly-leading-relaxed:   1.8;

    /* ── الـ Layout ── */
    --tmly-header-height:     68px;
    --tmly-container-max:     100%;
    --tmly-container-pad:     clamp(20px, 5vw, 80px);

    /* ── الـ Radius ── */
    --tmly-radius-sm:   6px;
    --tmly-radius-md:   10px;
    --tmly-radius-lg:   14px;
    --tmly-radius-xl:   20px;
    --tmly-radius-full: 9999px;

    /* ── الظلال ── */
    --tmly-shadow-xs:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --tmly-shadow-sm:  0 2px 8px rgba(0,0,0,.08);
    --tmly-shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --tmly-shadow-lg:  0 8px 32px rgba(0,0,0,.12);
    --tmly-shadow-primary: 0 4px 14px rgba(79,70,229,.35);

    /* ── الـ Transitions ── */
    --tmly-ease:            cubic-bezier(.25,.46,.45,.94);
    --tmly-transition-fast: .15s var(--tmly-ease);
    --tmly-transition-base: .25s var(--tmly-ease);
    --tmly-transition-slow: .4s  var(--tmly-ease);

    /* ── Z-Index ── */
    --tmly-z-dropdown: 100;
    --tmly-z-header:   200;
    --tmly-z-overlay:  300;
    --tmly-z-modal:    400;
}

/* ===========================================================
   SECTION 2: GLOBAL RESET & BASE
   =========================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/*
 * Fix حاسم: [hidden] يجب أن يخفي العنصر دائماً
 * بغض النظر عن أي display تضعه CSS أخرى
 */
[hidden] { display: none !important; }

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

body {
    font-family: var(--tmly-font);
    font-size: var(--tmly-text-base);
    font-weight: var(--tmly-weight-normal);
    line-height: var(--tmly-leading-normal);
    color: var(--tmly-text-body);
    background-color: var(--tmly-bg-page);
    padding-block-start: var(--tmly-header-height);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

img, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: none; background: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--tmly-weight-bold);
    line-height: var(--tmly-leading-tight);
    color: var(--tmly-text-heading);
    letter-spacing: -.01em;
}

/* ===========================================================
   SECTION 3: ACCESSIBILITY
   =========================================================== */
.tmly-skip-link {
    position: absolute;
    top: -100%;
    inset-inline-start: var(--tmly-space-4);
    z-index: 9999;
    padding: var(--tmly-space-3) var(--tmly-space-6);
    background: var(--tmly-color-primary);
    color: var(--tmly-text-inverse);
    font-weight: var(--tmly-weight-semibold);
    border-radius: var(--tmly-radius-md);
    transition: top var(--tmly-transition-fast);
}
.tmly-skip-link:focus { top: var(--tmly-space-2); }

/* ===========================================================
   SECTION 4: TYPOGRAPHY
   =========================================================== */
.tmly-heading-1 { font-size: var(--tmly-text-4xl); font-weight: var(--tmly-weight-extrabold); }
.tmly-heading-2 { font-size: var(--tmly-text-3xl); font-weight: var(--tmly-weight-bold); }
.tmly-heading-3 { font-size: var(--tmly-text-2xl); font-weight: var(--tmly-weight-bold); }

/* ===========================================================
   SECTION 5: LAYOUT UTILITIES
   =========================================================== */
.tmly-container {
    width: 100%;
    max-width: var(--tmly-container-max);
    margin-inline: auto;
    padding-inline: var(--tmly-container-pad);
}

.tmly-section {
    padding-block: var(--tmly-space-16);
}

.tmly-section-header {
    margin-block-end: var(--tmly-space-10);
}

.tmly-section-title {
    font-size: var(--tmly-text-3xl);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-heading);
    margin-block-end: var(--tmly-space-3);
}

.tmly-section-subtitle {
    font-size: var(--tmly-text-lg);
    color: var(--tmly-text-secondary);
    line-height: var(--tmly-leading-relaxed);
}

.tmly-divider {
    height: 1px;
    background: var(--tmly-border-color);
    margin-block: var(--tmly-space-12);
}

/* ===========================================================
   SECTION 6: BUTTONS
   =========================================================== */
.tmly-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--tmly-space-2);
    padding: 10px var(--tmly-space-5);
    font-family: var(--tmly-font);
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    line-height: 1.4;
    border-radius: var(--tmly-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all var(--tmly-transition-fast);
    position: relative;
}
.tmly-btn:focus-visible {
    outline: 2px solid var(--tmly-color-primary);
    outline-offset: 3px;
}
.tmly-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary */
.tmly-btn--primary {
    background: var(--tmly-color-primary);
    color: var(--tmly-text-inverse);
    border-color: var(--tmly-color-primary);
    box-shadow: var(--tmly-shadow-primary);
}
.tmly-btn--primary:hover {
    background: var(--tmly-color-primary-dark);
    border-color: var(--tmly-color-primary-dark);
    color: var(--tmly-text-inverse);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,.45);
}
.tmly-btn--primary:active { transform: translateY(0); }

/* Outline */
.tmly-btn--outline {
    background: transparent;
    color: var(--tmly-color-primary);
    border-color: var(--tmly-color-primary);
}
.tmly-btn--outline:hover {
    background: var(--tmly-color-primary-light);
    color: var(--tmly-color-primary-dark);
}

/* Ghost */
.tmly-btn--ghost {
    background: transparent;
    color: var(--tmly-text-secondary);
    border-color: var(--tmly-border-color);
}
.tmly-btn--ghost:hover {
    background: var(--tmly-bg-subtle);
    color: var(--tmly-text-body);
    border-color: var(--tmly-border-color-strong);
}

/* Sizes */
.tmly-btn--sm  { padding: 7px var(--tmly-space-4);  font-size: var(--tmly-text-xs); }
.tmly-btn--lg  { padding: var(--tmly-space-4) var(--tmly-space-8); font-size: var(--tmly-text-base); border-radius: var(--tmly-radius-lg); }
.tmly-btn--full { width: 100%; }

/* ===========================================================
   SECTION 7: BADGES
   =========================================================== */
.tmly-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--tmly-space-1);
    padding: 3px var(--tmly-space-3);
    font-size: var(--tmly-text-xs);
    font-weight: var(--tmly-weight-semibold);
    border-radius: var(--tmly-radius-full);
    border: 1px solid transparent;
}

.tmly-badge--primary {
    background: var(--tmly-color-primary-light);
    color: var(--tmly-color-primary);
    border-color: var(--tmly-color-primary-mid);
}
.tmly-badge--success {
    background: var(--tmly-color-success-light);
    color: var(--tmly-color-success);
    border-color: #A7F3D0;
}
.tmly-badge--warning {
    background: var(--tmly-color-warning-light);
    color: #B45309;
    border-color: #FDE68A;
}
.tmly-badge--error {
    background: var(--tmly-color-error-light);
    color: var(--tmly-color-error);
    border-color: #FECACA;
}
.tmly-badge--muted {
    background: var(--tmly-bg-subtle);
    color: var(--tmly-text-muted);
    border-color: var(--tmly-border-color);
}

/* ===========================================================
   SECTION 8: FORMS
   =========================================================== */
.tmly-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--tmly-space-2);
    margin-block-end: var(--tmly-space-5);
}

.tmly-form-label {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-body);
}

.tmly-form-input,
.tmly-form-select,
.tmly-form-textarea {
    width: 100%;
    padding: 11px var(--tmly-space-4);
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-md);
    color: var(--tmly-text-body);
    font-family: var(--tmly-font);
    font-size: var(--tmly-text-base);
    line-height: var(--tmly-leading-normal);
    outline: none;
    direction: rtl;
    transition: border-color var(--tmly-transition-fast), box-shadow var(--tmly-transition-fast);
    box-shadow: var(--tmly-shadow-xs);
}

.tmly-form-input:focus,
.tmly-form-select:focus,
.tmly-form-textarea:focus {
    border-color: var(--tmly-color-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

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

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

.tmly-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239CA3AF' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left var(--tmly-space-4) center;
    padding-inline-start: var(--tmly-space-10);
}

.tmly-form-error {
    font-size: var(--tmly-text-xs);
    color: var(--tmly-color-error);
    display: none;
}
.tmly-form-group.has-error .tmly-form-error { display: block; }
.tmly-form-group.has-error .tmly-form-input,
.tmly-form-group.has-error .tmly-form-select,
.tmly-form-group.has-error .tmly-form-textarea {
    border-color: var(--tmly-color-error);
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.tmly-form-note {
    font-size: var(--tmly-text-xs);
    color: var(--tmly-text-muted);
    line-height: var(--tmly-leading-relaxed);
}

.tmly-form-error-msg {
    padding: var(--tmly-space-4);
    background: var(--tmly-color-error-light);
    border: 1px solid #FECACA;
    border-radius: var(--tmly-radius-md);
    color: #991B1B;
    font-size: var(--tmly-text-sm);
    margin-block-end: var(--tmly-space-5);
    line-height: var(--tmly-leading-relaxed);
}

/* Honeypot */
.tmly-honeypot-field {
    position: absolute;
    inset-inline-start: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ===========================================================
   SECTION 9: HEADER
   =========================================================== */
.tmly-header {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: var(--tmly-z-header);
    height: var(--tmly-header-height);
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-block-end: 1px solid var(--tmly-border-color);
    box-shadow: var(--tmly-shadow-xs);
    transition: box-shadow var(--tmly-transition-base);
}

.tmly-header.is-scrolled {
    box-shadow: var(--tmly-shadow-sm);
}

.tmly-header-inner {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-6);
    height: 100%;
    max-width: var(--tmly-container-max);
    margin-inline: auto;
    padding-inline: var(--tmly-container-pad);
}

/* Logo */
.tmly-header-logo {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-2);
    text-decoration: none;
    flex-shrink: 0;
}

.tmly-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--tmly-color-primary);
    border-radius: var(--tmly-radius-md);
    flex-shrink: 0;
}

.tmly-logo-text {
    font-size: var(--tmly-text-xl);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-heading);
    letter-spacing: -.02em;
    line-height: 1;
}
.tmly-logo-text span { color: var(--tmly-color-primary); }

/* Desktop Nav */
.tmly-header-nav {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-1);
    flex: 1;
}

.tmly-header-nav-link {
    padding: var(--tmly-space-2) var(--tmly-space-4);
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-secondary);
    border-radius: var(--tmly-radius-md);
    text-decoration: none;
    transition: color var(--tmly-transition-fast), background var(--tmly-transition-fast);
}
.tmly-header-nav-link:hover { color: var(--tmly-color-primary); background: var(--tmly-color-primary-light); }
.tmly-header-nav-link.is-active { color: var(--tmly-color-primary); }

/* Actions */
.tmly-header-actions {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    margin-inline-start: auto;
    flex-shrink: 0;
}

/* Burger */
.tmly-header-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: var(--tmly-radius-md);
    border: 1px solid var(--tmly-border-color);
    background: transparent;
    transition: background var(--tmly-transition-fast);
}
.tmly-header-burger:hover { background: var(--tmly-bg-subtle); }

.tmly-burger-line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--tmly-text-body);
    border-radius: 2px;
    transition: transform var(--tmly-transition-base), opacity var(--tmly-transition-base);
}

/* ===========================================================
   SECTION 10: MOBILE NAV
   =========================================================== */
.tmly-mobile-nav {
    display: none;
    position: fixed;
    top: var(--tmly-header-height);
    inset-inline: 0;
    bottom: 0;
    z-index: var(--tmly-z-overlay);
    background: var(--tmly-bg-white);
    flex-direction: column;
    padding: var(--tmly-space-6);
    gap: var(--tmly-space-2);
    overflow-y: auto;
    border-block-start: 1px solid var(--tmly-border-color);
    transform: translateX(-100%);
    transition: transform var(--tmly-transition-base);
    box-shadow: var(--tmly-shadow-lg);
}
.tmly-mobile-nav.is-open { transform: translateX(0); }

.tmly-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    padding: var(--tmly-space-4);
    font-size: var(--tmly-text-base);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-secondary);
    border-radius: var(--tmly-radius-lg);
    text-decoration: none;
    transition: all var(--tmly-transition-fast);
    border: 1px solid transparent;
}
.tmly-mobile-nav-link:hover {
    color: var(--tmly-color-primary);
    background: var(--tmly-color-primary-light);
    border-color: var(--tmly-color-primary-mid);
}

.tmly-mobile-nav-divider {
    height: 1px;
    background: var(--tmly-border-color);
    margin-block: var(--tmly-space-3);
}

/* ===========================================================
   SECTION 11: HERO + SEARCH
   =========================================================== */
.tmly-hero {
    background: linear-gradient(180deg, var(--tmly-color-primary-light) 0%, var(--tmly-bg-page) 100%);
    padding-block: var(--tmly-space-24) var(--tmly-space-20);
    text-align: center;
    border-block-end: 1px solid var(--tmly-border-color);
}

.tmly-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--tmly-space-2);
    padding: 5px var(--tmly-space-4);
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color-primary);
    border-radius: var(--tmly-radius-full);
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-color-primary);
    margin-block-end: var(--tmly-space-6);
    box-shadow: var(--tmly-shadow-xs);
}

.tmly-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-heading);
    line-height: 1.15;
    margin-block-end: var(--tmly-space-5);
    letter-spacing: -.02em;
}

.tmly-hero-title span { color: var(--tmly-color-primary); }

.tmly-hero-subtitle {
    font-size: var(--tmly-text-lg);
    color: var(--tmly-text-secondary);
    line-height: var(--tmly-leading-relaxed);
    max-width: 540px;
    margin-inline: auto;
    margin-block-end: var(--tmly-space-10);
}

/* Search Bar */
.tmly-search-wrap {
    position: relative;
    max-width: 560px;
    margin-inline: auto;
}

.tmly-search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-full);
    box-shadow: var(--tmly-shadow-md);
    overflow: hidden;
    transition: border-color var(--tmly-transition-fast), box-shadow var(--tmly-transition-fast);
}
.tmly-search-input-wrap:focus-within {
    border-color: var(--tmly-color-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12), var(--tmly-shadow-md);
}

.tmly-search-icon {
    padding-inline: var(--tmly-space-5);
    color: var(--tmly-text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.tmly-search-input {
    flex: 1;
    padding: var(--tmly-space-4) 0;
    border: none;
    background: transparent;
    font-family: var(--tmly-font);
    font-size: var(--tmly-text-base);
    color: var(--tmly-text-body);
    direction: rtl;
    outline: none;
    box-shadow: none;
}
.tmly-search-input::placeholder { color: var(--tmly-text-muted); }

.tmly-search-btn {
    margin: 5px;
    padding: 10px var(--tmly-space-6);
    background: var(--tmly-color-primary);
    color: var(--tmly-text-inverse);
    border: none;
    border-radius: var(--tmly-radius-full);
    font-family: var(--tmly-font);
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    cursor: pointer;
    transition: background var(--tmly-transition-fast);
    flex-shrink: 0;
}
.tmly-search-btn:hover { background: var(--tmly-color-primary-dark); }

/* Search Results Dropdown */
.tmly-search-results {
    position: absolute;
    top: calc(100% + var(--tmly-space-2));
    inset-inline: 0;
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-lg);
    box-shadow: var(--tmly-shadow-lg);
    overflow: hidden;
    z-index: var(--tmly-z-dropdown);
}

.tmly-search-result-item {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-4);
    padding: var(--tmly-space-4) var(--tmly-space-5);
    text-decoration: none;
    transition: background var(--tmly-transition-fast);
    border-block-end: 1px solid var(--tmly-border-color);
}
.tmly-search-result-item:last-child { border-block-end: none; }
.tmly-search-result-item:hover { background: var(--tmly-bg-subtle); }

.tmly-search-result-thumb {
    width: 56px;
    height: 36px;
    object-fit: cover;
    border-radius: var(--tmly-radius-sm);
    background: var(--tmly-bg-subtle);
    flex-shrink: 0;
}

.tmly-search-result-name {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-heading);
}

.tmly-search-result-price {
    font-size: var(--tmly-text-xs);
    color: var(--tmly-color-primary);
    font-weight: var(--tmly-weight-bold);
    margin-inline-start: auto;
    flex-shrink: 0;
}

.tmly-search-no-results {
    padding: var(--tmly-space-6);
    text-align: center;
    color: var(--tmly-text-muted);
    font-size: var(--tmly-text-sm);
}

/* ===========================================================
   SECTION 12: THEME CARDS GRID
   =========================================================== */
.tmly-themes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--tmly-space-4);
}

.tmly-theme-card {
    display: flex;
    flex-direction: column;
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-lg);
    overflow: hidden;
    box-shadow: var(--tmly-shadow-xs);
    transition: transform var(--tmly-transition-base), box-shadow var(--tmly-transition-base);
}
.tmly-theme-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--tmly-shadow-md);
}

.tmly-theme-card-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--tmly-bg-subtle);
}
.tmly-theme-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.tmly-theme-card:hover .tmly-theme-card-thumb img { transform: scale(1.06); }

/* Price badge على الصورة مباشرة */
.tmly-theme-card-price-badge {
    position: absolute;
    bottom: var(--tmly-space-2);
    inset-inline-start: var(--tmly-space-2);
    background: rgba(15,15,35,.85);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: var(--tmly-text-xs);
    font-weight: var(--tmly-weight-bold);
    padding: 3px 8px;
    border-radius: var(--tmly-radius-sm);
    line-height: 1.5;
}

.tmly-theme-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15,15,35,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tmly-space-2);
    opacity: 0;
    transition: opacity var(--tmly-transition-base);
}
.tmly-theme-card:hover .tmly-theme-card-overlay { opacity: 1; }

.tmly-theme-card-body {
    padding: var(--tmly-space-3) var(--tmly-space-3) var(--tmly-space-2);
    flex: 1;
}

.tmly-theme-card-cat { margin-block-end: 4px; }

.tmly-theme-card-title {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-bold);
    color: var(--tmly-text-heading);
    line-height: var(--tmly-leading-tight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmly-theme-card-excerpt {
    font-size: var(--tmly-text-xs);
    color: var(--tmly-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-block-start: 4px;
}

.tmly-theme-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--tmly-space-2) var(--tmly-space-3) var(--tmly-space-3);
    gap: var(--tmly-space-2);
}

.tmly-theme-card-price {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.tmly-theme-card-price-egp {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-color-primary);
    line-height: 1;
}
.tmly-theme-card-price-usd {
    font-size: 10px;
    color: var(--tmly-text-muted);
    line-height: 1;
}
/* Legacy support */
.tmly-theme-card-price small {
    font-size: var(--tmly-text-xs);
    font-weight: var(--tmly-weight-normal);
    color: var(--tmly-text-secondary);
}

/* Filters */
.tmly-filters {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    flex-wrap: wrap;
    padding: var(--tmly-space-5) var(--tmly-space-6);
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-xl);
    margin-block-end: var(--tmly-space-8);
    box-shadow: var(--tmly-shadow-xs);
}

.tmly-filters-label {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-bold);
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.25,.46,.45,.94);
}
.tmly-theme-card:hover .tmly-theme-card-thumb img { transform: scale(1.05); }

.tmly-theme-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(79,70,229,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tmly-space-3);
    opacity: 0;
    transition: opacity var(--tmly-transition-base);
    backdrop-filter: blur(2px);
}
.tmly-theme-card:hover .tmly-theme-card-overlay { opacity: 1; }

.tmly-theme-card-body {
    padding: var(--tmly-space-5);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--tmly-space-2);
}

.tmly-theme-card-cat { margin-block-end: var(--tmly-space-1); }

.tmly-theme-card-title {
    font-size: var(--tmly-text-base);
    font-weight: var(--tmly-weight-bold);
    color: var(--tmly-text-heading);
    line-height: var(--tmly-leading-tight);
}

.tmly-theme-card-excerpt {
    font-size: var(--tmly-text-sm);
    color: var(--tmly-text-secondary);
    line-height: var(--tmly-leading-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.tmly-theme-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--tmly-space-4) var(--tmly-space-5);
    border-block-start: 1px solid var(--tmly-border-color);
    background: var(--tmly-bg-subtle);
}

.tmly-theme-card-price {
    font-size: var(--tmly-text-xl);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-color-primary);
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.tmly-theme-card-price small {
    font-size: var(--tmly-text-xs);
    font-weight: var(--tmly-weight-normal);
    color: var(--tmly-text-secondary);
}

/* Filters */
.tmly-filters {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    flex-wrap: wrap;
    padding: var(--tmly-space-5) var(--tmly-space-6);
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-xl);
    margin-block-end: var(--tmly-space-8);
    box-shadow: var(--tmly-shadow-xs);
}

.tmly-filters-label {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-bold);
    color: var(--tmly-text-muted);
    margin-inline-end: var(--tmly-space-2);
}

/* ===========================================================
   SECTION 13: SINGLE THEME PAGE
   =========================================================== */
.tmly-single-hero {
    background: var(--tmly-bg-white);
    border-block-end: 1px solid var(--tmly-border-color);
    padding-block: var(--tmly-space-10);
}

.tmly-single-hero-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--tmly-space-8);
    align-items: start;
    max-width: 1100px;
}

.tmly-single-preview {
    border-radius: var(--tmly-radius-lg);
    overflow: hidden;
    border: 1px solid var(--tmly-border-color);
    box-shadow: var(--tmly-shadow-md);
}
.tmly-single-preview img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* Sticky Sidebar */
.tmly-single-sidebar {
    position: sticky;
    top: calc(var(--tmly-header-height) + var(--tmly-space-4));
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-lg);
    overflow: hidden;
    box-shadow: var(--tmly-shadow-sm);
}

.tmly-sidebar-header {
    padding: var(--tmly-space-5) var(--tmly-space-5) var(--tmly-space-4);
    border-block-end: 1px solid var(--tmly-border-color);
    background: var(--tmly-bg-subtle);
}

/* Price block - EGP primary + USD secondary */
.tmly-sidebar-prices {
    display: flex;
    align-items: baseline;
    gap: var(--tmly-space-3);
    flex-wrap: wrap;
    margin-block-end: 4px;
}

.tmly-sidebar-price-egp {
    font-size: 2rem;
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-color-primary);
    line-height: 1;
}

.tmly-sidebar-price-usd {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-muted);
    background: var(--tmly-bg-subtle);
    border: 1px solid var(--tmly-border-color);
    padding: 2px 8px;
    border-radius: var(--tmly-radius-full);
}

/* Legacy */
.tmly-sidebar-price {
    font-size: 2rem;
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-color-primary);
    line-height: 1;
    margin-block-end: 4px;
    display: flex;
    align-items: baseline;
    gap: var(--tmly-space-2);
}
.tmly-sidebar-price span {
    font-size: var(--tmly-text-base);
    font-weight: var(--tmly-weight-normal);
    color: var(--tmly-text-muted);
}

.tmly-sidebar-price-note {
    font-size: var(--tmly-text-xs);
    color: var(--tmly-text-muted);
}

.tmly-sidebar-body { padding: var(--tmly-space-5); }

.tmly-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--tmly-space-2);
    margin-block-end: var(--tmly-space-5);
}

/* ThemeForest-style structured meta */
.tmly-sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-md);
    overflow: hidden;
    margin-block-end: var(--tmly-space-5);
}

.tmly-sidebar-meta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--tmly-text-xs);
    padding: var(--tmly-space-3) var(--tmly-space-4);
    border-block-end: 1px solid var(--tmly-border-color);
}
.tmly-sidebar-meta-item:last-child { border-block-end: none; }
.tmly-sidebar-meta-item:nth-child(even) { background: var(--tmly-bg-subtle); }
.tmly-sidebar-meta-item dt { color: var(--tmly-text-muted); }
.tmly-sidebar-meta-item dd {
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-body);
    text-align: end;
}

.tmly-sidebar-features {
    display: flex;
    flex-direction: column;
    gap: var(--tmly-space-2);
    margin-block-end: var(--tmly-space-4);
}

.tmly-sidebar-feature {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    font-size: var(--tmly-text-xs);
    color: var(--tmly-text-secondary);
}
.tmly-sidebar-feature-icon {
    width: 18px;
    height: 18px;
    border-radius: var(--tmly-radius-full);
    background: var(--tmly-color-success-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--tmly-color-success);
    font-size: 9px;
}

/* Single Content - ThemeForest style */
.tmly-single-content {
    padding-block: var(--tmly-space-12);
    max-width: 1100px;
}
.tmly-single-content-inner {
    max-width: 720px;
}
.tmly-single-content h2 {
    font-size: var(--tmly-text-xl);
    margin-block-end: var(--tmly-space-6);
    padding-block-end: var(--tmly-space-4);
    border-block-end: 1px solid var(--tmly-border-color);
}
.tmly-single-content p {
    color: var(--tmly-text-secondary);
    line-height: var(--tmly-leading-relaxed);
    margin-block-end: var(--tmly-space-5);
    font-size: var(--tmly-text-sm);
}

/* ThemeForest-style theme spec table */
.tmly-theme-specs {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--tmly-text-sm);
    margin-block: var(--tmly-space-6);
}
.tmly-theme-specs td {
    padding: var(--tmly-space-3) var(--tmly-space-4);
    border: 1px solid var(--tmly-border-color);
    vertical-align: top;
}
.tmly-theme-specs tr:nth-child(even) td { background: var(--tmly-bg-subtle); }
.tmly-theme-specs td:first-child {
    width: 35%;
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-secondary);
    background: var(--tmly-bg-subtle);
}

/* ===========================================================
   SECTION 14: LIVE DEMO PAGE
   =========================================================== */
.tmly-demo-bar {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: var(--tmly-z-header);
    height: var(--tmly-header-height);
    background: var(--tmly-text-heading);
    display: flex;
    align-items: center;
    padding-inline: var(--tmly-space-6);
    gap: var(--tmly-space-5);
    border-block-end: 1px solid rgba(255,255,255,.1);
}

.tmly-demo-bar-logo {
    font-size: var(--tmly-text-base);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-inverse);
    text-decoration: none;
    letter-spacing: -.01em;
    flex-shrink: 0;
}
.tmly-demo-bar-logo span { color: #818CF8; }

.tmly-demo-bar-title {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: rgba(255,255,255,.6);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmly-demo-devices {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-2);
    flex-shrink: 0;
}

.tmly-demo-device-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--tmly-radius-md);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.6);
    border: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--tmly-text-sm);
    transition: all var(--tmly-transition-fast);
}
.tmly-demo-device-btn:hover,
.tmly-demo-device-btn.is-active {
    background: var(--tmly-color-primary);
    color: var(--tmly-text-inverse);
    border-color: var(--tmly-color-primary);
}

.tmly-demo-frame-wrap {
    position: fixed;
    top: var(--tmly-header-height);
    inset-inline: 0;
    bottom: 0;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: padding var(--tmly-transition-base);
}

.tmly-demo-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--tmly-bg-white);
    transition: width var(--tmly-transition-base), height var(--tmly-transition-base),
                border-radius var(--tmly-transition-base), box-shadow var(--tmly-transition-base);
}

/* Mobile preview */
.tmly-demo-frame-wrap.is-mobile {
    padding: var(--tmly-space-8);
}
.tmly-demo-frame-wrap.is-mobile .tmly-demo-iframe {
    width: 390px;
    max-width: 100%;
    height: 100%;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ===========================================================
   SECTION 15: CHECKOUT PAGE
   =========================================================== */
.tmly-checkout-wrap {
    max-width: var(--tmly-container-max);
    margin-inline: auto;
    padding-inline: var(--tmly-container-pad);
    padding-block: var(--tmly-space-12);
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--tmly-space-10);
    align-items: start;
}

.tmly-checkout-title {
    font-size: var(--tmly-text-3xl);
    font-weight: var(--tmly-weight-extrabold);
    margin-block-end: var(--tmly-space-8);
}

.tmly-checkout-card {
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-xl);
    padding: var(--tmly-space-8);
    box-shadow: var(--tmly-shadow-xs);
    margin-block-end: var(--tmly-space-6);
}
.tmly-checkout-card:last-child { margin-block-end: 0; }

.tmly-checkout-card-title {
    font-size: var(--tmly-text-lg);
    font-weight: var(--tmly-weight-bold);
    margin-block-end: var(--tmly-space-6);
    padding-block-end: var(--tmly-space-5);
    border-block-end: 1px solid var(--tmly-border-color);
    color: var(--tmly-text-heading);
}

/* Payment instructions alert */
.tmly-payment-instructions {
    background: var(--tmly-color-primary-light);
    border: 1px solid var(--tmly-color-primary-mid);
    border-radius: var(--tmly-radius-lg);
    padding: var(--tmly-space-5);
    margin-block-end: var(--tmly-space-6);
}

.tmly-payment-instructions-title {
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-bold);
    color: var(--tmly-color-primary);
    margin-block-end: var(--tmly-space-3);
}

.tmly-payment-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--tmly-text-sm);
    padding: var(--tmly-space-2) 0;
    border-block-end: 1px solid var(--tmly-color-primary-mid);
}
.tmly-payment-info-row:last-child { border-block-end: none; }
.tmly-payment-info-row dt { color: var(--tmly-text-secondary); }
.tmly-payment-info-row dd { font-weight: var(--tmly-weight-bold); color: var(--tmly-text-heading); font-size: var(--tmly-text-base); }

/* Payment methods */
.tmly-payment-methods { display: flex; flex-direction: column; gap: var(--tmly-space-3); margin-block-end: var(--tmly-space-6); }

.tmly-payment-option {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-4);
    padding: var(--tmly-space-4) var(--tmly-space-5);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-lg);
    cursor: pointer;
    transition: all var(--tmly-transition-fast);
    background: var(--tmly-bg-white);
}
.tmly-payment-option:has(input:checked) {
    border-color: var(--tmly-color-primary);
    background: var(--tmly-color-primary-light);
}
.tmly-payment-option input[type="radio"] { accent-color: var(--tmly-color-primary); width: 18px; height: 18px; flex-shrink: 0; }
.tmly-payment-option-label { font-size: var(--tmly-text-sm); font-weight: var(--tmly-weight-bold); color: var(--tmly-text-heading); }
.tmly-payment-option-sub { font-size: var(--tmly-text-xs); color: var(--tmly-text-muted); }

/* Order Summary */
.tmly-order-summary {
    position: sticky;
    top: calc(var(--tmly-header-height) + var(--tmly-space-6));
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-xl);
    overflow: hidden;
    box-shadow: var(--tmly-shadow-sm);
}

.tmly-order-summary-header {
    background: var(--tmly-bg-subtle);
    padding: var(--tmly-space-5) var(--tmly-space-6);
    border-block-end: 1px solid var(--tmly-border-color);
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-bold);
    color: var(--tmly-text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.tmly-order-summary-body { padding: var(--tmly-space-6); }

.tmly-order-theme-row {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-4);
    margin-block-end: var(--tmly-space-6);
    padding-block-end: var(--tmly-space-5);
    border-block-end: 1px solid var(--tmly-border-color);
}

.tmly-order-theme-thumb {
    width: 72px;
    height: 46px;
    object-fit: cover;
    border-radius: var(--tmly-radius-sm);
    background: var(--tmly-bg-subtle);
    flex-shrink: 0;
    border: 1px solid var(--tmly-border-color);
}

.tmly-order-theme-name { font-size: var(--tmly-text-sm); font-weight: var(--tmly-weight-bold); color: var(--tmly-text-heading); }
.tmly-order-theme-cat  { font-size: var(--tmly-text-xs); color: var(--tmly-text-muted); margin-block-start: 2px; }

.tmly-order-price-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--tmly-text-sm);
    color: var(--tmly-text-secondary);
    margin-block-end: var(--tmly-space-3);
}

.tmly-order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: var(--tmly-weight-bold);
    font-size: var(--tmly-text-base);
    color: var(--tmly-text-heading);
    border-block-start: 1px solid var(--tmly-border-color);
    padding-block-start: var(--tmly-space-5);
    margin-block-start: var(--tmly-space-5);
}

.tmly-order-total-amount {
    font-size: var(--tmly-text-2xl);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-color-primary);
}

.tmly-order-guarantees {
    margin-block-start: var(--tmly-space-5);
    display: flex;
    flex-direction: column;
    gap: var(--tmly-space-3);
}
.tmly-order-guarantee-item {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    font-size: var(--tmly-text-xs);
    color: var(--tmly-text-muted);
}

/* ===========================================================
   SECTION 16: USER DASHBOARD
   =========================================================== */
.tmly-dash-page {
    max-width: var(--tmly-container-max);
    margin-inline: auto;
    padding-inline: var(--tmly-container-pad);
    padding-block: var(--tmly-space-10);
}

.tmly-dash-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--tmly-space-8);
    align-items: start;
}

/* Sidebar */
.tmly-dash-sidebar {
    position: sticky;
    top: calc(var(--tmly-header-height) + var(--tmly-space-4));
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-xl);
    overflow: hidden;
    box-shadow: var(--tmly-shadow-xs);
}

.tmly-dash-user {
    padding: var(--tmly-space-5) var(--tmly-space-5) var(--tmly-space-4);
    border-block-end: 1px solid var(--tmly-border-color);
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    background: var(--tmly-bg-subtle);
}

.tmly-dash-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--tmly-radius-full);
    background: var(--tmly-color-primary);
    color: var(--tmly-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--tmly-weight-extrabold);
    font-size: var(--tmly-text-base);
    flex-shrink: 0;
}

.tmly-dash-user-name  { font-size: var(--tmly-text-sm); font-weight: var(--tmly-weight-bold); color: var(--tmly-text-heading); line-height: 1.3; }
.tmly-dash-user-email { font-size: var(--tmly-text-xs); color: var(--tmly-text-muted); margin-block-start: 2px; }

.tmly-dash-nav {
    padding: var(--tmly-space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tmly-dash-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-3);
    padding: 10px var(--tmly-space-4);
    font-family: var(--tmly-font);
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-secondary);
    border-radius: var(--tmly-radius-md);
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: start;
    text-decoration: none;
    transition: all var(--tmly-transition-fast);
}
.tmly-dash-nav-btn i { width: 16px; text-align: center; flex-shrink: 0; opacity: .6; }
.tmly-dash-nav-btn:hover { color: var(--tmly-color-primary); background: var(--tmly-color-primary-light); }
.tmly-dash-nav-btn.is-active {
    color: var(--tmly-color-primary);
    background: var(--tmly-color-primary-light);
    border-color: var(--tmly-color-primary-mid);
}
.tmly-dash-nav-btn.is-active i { opacity: 1; }
.tmly-dash-nav-btn--danger:hover { color: var(--tmly-color-error); background: var(--tmly-color-error-light); }

.tmly-dash-nav-sep {
    height: 1px;
    background: var(--tmly-border-color);
    margin-block: var(--tmly-space-2);
}

/* Main */
.tmly-dash-tab-content[hidden] { display: none; }

.tmly-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--tmly-space-8);
    padding-block-end: var(--tmly-space-5);
    border-block-end: 1px solid var(--tmly-border-color);
}

.tmly-dash-title {
    font-size: var(--tmly-text-2xl);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-heading);
}

/* Stats */
.tmly-dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--tmly-space-4);
    margin-block-end: var(--tmly-space-8);
}

.tmly-stat-card {
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-lg);
    padding: var(--tmly-space-5) var(--tmly-space-6);
    box-shadow: var(--tmly-shadow-xs);
}

.tmly-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--tmly-radius-md);
    background: var(--tmly-color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tmly-color-primary);
    font-size: var(--tmly-text-base);
    margin-block-end: var(--tmly-space-4);
}

.tmly-stat-label {
    font-size: var(--tmly-text-xs);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-block-end: var(--tmly-space-2);
}

.tmly-stat-value {
    font-size: var(--tmly-text-3xl);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-heading);
    line-height: 1;
}

/* Theme Items in Dashboard */
.tmly-dash-theme-list { display: flex; flex-direction: column; gap: var(--tmly-space-4); }

.tmly-dash-theme-item {
    display: flex;
    align-items: center;
    gap: var(--tmly-space-4);
    padding: var(--tmly-space-4) var(--tmly-space-5);
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-lg);
    box-shadow: var(--tmly-shadow-xs);
    transition: border-color var(--tmly-transition-fast);
}
.tmly-dash-theme-item:hover { border-color: var(--tmly-border-color-primary); }

.tmly-dash-theme-thumb {
    width: 80px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--tmly-radius-sm);
    background: var(--tmly-bg-subtle);
    flex-shrink: 0;
    border: 1px solid var(--tmly-border-color);
}

.tmly-dash-theme-info { flex: 1; min-width: 0; }
.tmly-dash-theme-name { font-size: var(--tmly-text-sm); font-weight: var(--tmly-weight-bold); color: var(--tmly-text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-block-end: 4px; }
.tmly-dash-theme-meta { font-size: var(--tmly-text-xs); color: var(--tmly-text-muted); }

.tmly-dash-theme-actions { display: flex; gap: var(--tmly-space-2); flex-shrink: 0; align-items: center; }

/* Status badges في الطلبات */
.tmly-order-status-pending   { background: var(--tmly-color-warning-light); color: #92400E; border-color: #FDE68A; }
.tmly-order-status-completed { background: var(--tmly-color-success-light); color: #065F46; border-color: #A7F3D0; }
.tmly-order-status-cancelled { background: var(--tmly-color-error-light);   color: #991B1B; border-color: #FECACA; }

/* Empty State */
.tmly-empty-state {
    text-align: center;
    padding: var(--tmly-space-20) var(--tmly-space-8);
    background: var(--tmly-bg-white);
    border: 1px dashed var(--tmly-border-color-strong);
    border-radius: var(--tmly-radius-xl);
}
.tmly-empty-state-icon  { font-size: 3rem; color: var(--tmly-text-muted); opacity: .4; margin-block-end: var(--tmly-space-5); }
.tmly-empty-state-title { font-size: var(--tmly-text-xl); font-weight: var(--tmly-weight-bold); color: var(--tmly-text-secondary); margin-block-end: var(--tmly-space-2); }
.tmly-empty-state-sub   { font-size: var(--tmly-text-sm); color: var(--tmly-text-muted); margin-block-end: var(--tmly-space-6); line-height: var(--tmly-leading-relaxed); }

/* ===========================================================
   SECTION 17: AUTH PAGES
   =========================================================== */
.tmly-auth-page {
    min-height: calc(100vh - var(--tmly-header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--tmly-space-8) var(--tmly-space-4);
    background: var(--tmly-bg-page);
}

.tmly-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--tmly-bg-white);
    border: 1px solid var(--tmly-border-color);
    border-radius: var(--tmly-radius-xl);
    padding: var(--tmly-space-10);
    box-shadow: var(--tmly-shadow-md);
}

.tmly-auth-logo {
    text-align: center;
    margin-block-end: var(--tmly-space-8);
}

.tmly-auth-logo-link {
    display: inline-flex;
    align-items: center;
    gap: var(--tmly-space-2);
    text-decoration: none;
}

.tmly-auth-title {
    font-size: var(--tmly-text-2xl);
    font-weight: var(--tmly-weight-extrabold);
    text-align: center;
    color: var(--tmly-text-heading);
    margin-block-end: var(--tmly-space-2);
}

.tmly-auth-sub {
    font-size: var(--tmly-text-sm);
    color: var(--tmly-text-muted);
    text-align: center;
    margin-block-end: var(--tmly-space-8);
    line-height: var(--tmly-leading-relaxed);
}

.tmly-auth-footer {
    text-align: center;
    margin-block-start: var(--tmly-space-6);
    font-size: var(--tmly-text-sm);
    color: var(--tmly-text-secondary);
}

/* ===========================================================
   SECTION 18: FOOTER
   =========================================================== */
.tmly-footer {
    background: var(--tmly-text-heading);
    color: rgba(255,255,255,.7);
    padding-block: var(--tmly-space-16) var(--tmly-space-8);
    margin-block-start: var(--tmly-space-24);
}

.tmly-footer-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1fr;
    gap: var(--tmly-space-10);
    margin-block-end: var(--tmly-space-12);
}

.tmly-footer-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--tmly-space-2);
    font-size: var(--tmly-text-xl);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-inverse);
    text-decoration: none;
    margin-block-end: var(--tmly-space-4);
    letter-spacing: -.02em;
}
.tmly-footer-brand-logo span { color: #818CF8; }

.tmly-footer-brand-desc {
    font-size: var(--tmly-text-sm);
    color: rgba(255,255,255,.5);
    line-height: var(--tmly-leading-relaxed);
    max-width: 260px;
    margin-block-end: var(--tmly-space-5);
}

.tmly-footer-col-title {
    font-size: var(--tmly-text-xs);
    font-weight: var(--tmly-weight-extrabold);
    color: var(--tmly-text-inverse);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-block-end: var(--tmly-space-5);
}

.tmly-footer-link {
    display: block;
    font-size: var(--tmly-text-sm);
    color: rgba(255,255,255,.5);
    margin-block-end: var(--tmly-space-3);
    text-decoration: none;
    transition: color var(--tmly-transition-fast);
}
.tmly-footer-link:hover { color: #818CF8; }

.tmly-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block-start: var(--tmly-space-6);
    border-block-start: 1px solid rgba(255,255,255,.08);
    font-size: var(--tmly-text-sm);
    color: rgba(255,255,255,.4);
    flex-wrap: wrap;
    gap: var(--tmly-space-4);
}
.tmly-footer-bottom a { color: #818CF8; }

/* ===========================================================
   SECTION 19: ALERTS & SUPPORT
   =========================================================== */
.tmly-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--tmly-space-3);
    padding: var(--tmly-space-4) var(--tmly-space-5);
    border-radius: var(--tmly-radius-md);
    font-size: var(--tmly-text-sm);
    line-height: var(--tmly-leading-relaxed);
    border: 1px solid transparent;
}
.tmly-alert--success { background: var(--tmly-color-success-light); border-color: #A7F3D0; color: #065F46; }
.tmly-alert--warning { background: var(--tmly-color-warning-light); border-color: #FDE68A; color: #92400E; }
.tmly-alert--error   { background: var(--tmly-color-error-light);   border-color: #FECACA; color: #991B1B; }
.tmly-alert--info    { background: var(--tmly-color-primary-light);  border-color: var(--tmly-color-primary-mid); color: #3730A3; }

/* Support / FAQ */
.tmly-support-wrap {
    max-width: 660px;
    margin-inline: auto;
}

.tmly-faq-item {
    border-block-end: 1px solid var(--tmly-border-color);
}
.tmly-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: var(--tmly-space-5);
    font-weight: var(--tmly-weight-bold);
    font-size: var(--tmly-text-base);
    cursor: pointer;
    list-style: none;
    color: var(--tmly-text-heading);
    transition: color var(--tmly-transition-fast);
    user-select: none;
}
.tmly-faq-item summary:hover { color: var(--tmly-color-primary); }
.tmly-faq-item summary::-webkit-details-marker { display: none; }
.tmly-faq-icon { transition: transform var(--tmly-transition-base); color: var(--tmly-text-muted); flex-shrink: 0; }
.tmly-faq-item[open] .tmly-faq-icon { transform: rotate(180deg); }
.tmly-faq-body {
    padding-block-end: var(--tmly-space-5);
    font-size: var(--tmly-text-sm);
    color: var(--tmly-text-secondary);
    line-height: var(--tmly-leading-relaxed);
}

/* Pagination */
.tmly-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tmly-space-2);
    margin-block-start: var(--tmly-space-12);
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--tmly-radius-md);
    font-size: var(--tmly-text-sm);
    font-weight: var(--tmly-weight-semibold);
    color: var(--tmly-text-secondary);
    border: 1px solid var(--tmly-border-color);
    background: var(--tmly-bg-white);
    text-decoration: none;
    transition: all var(--tmly-transition-fast);
}
.page-numbers:hover { color: var(--tmly-color-primary); border-color: var(--tmly-color-primary); background: var(--tmly-color-primary-light); }
.page-numbers.current { background: var(--tmly-color-primary); border-color: var(--tmly-color-primary); color: var(--tmly-text-inverse); }

/* ===========================================================
   SECTION 20: THIRD-PARTY OVERRIDES
   (!important مسموح هنا فقط)
   =========================================================== */
.wp-block { max-width: none !important; }

/* ===========================================================
   SECTION 21: MEDIA QUERIES
   ← كل الـ breakpoints هنا فقط — Desktop-First ←
   =========================================================== */

/* Default desktop: 5 columns (defined in base styles) */

@media (max-width: 1400px) {
    .tmly-themes-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1100px) {
    .tmly-themes-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1023px) {
    .tmly-header-nav,
    .tmly-header-actions .tmly-btn { display: none; }
    .tmly-header-burger { display: flex; }
    .tmly-mobile-nav { display: flex; }

    .tmly-themes-grid { grid-template-columns: repeat(3, 1fr); }

    .tmly-single-hero-grid { grid-template-columns: 1fr; }
    .tmly-single-sidebar { position: static; }

    .tmly-checkout-wrap { grid-template-columns: 1fr; }
    .tmly-order-summary { position: static; }

    .tmly-dash-layout { grid-template-columns: 1fr; }
    .tmly-dash-sidebar { position: static; }

    .tmly-footer-grid { grid-template-columns: 1fr 1fr; gap: var(--tmly-space-8); }
}

@media (min-width: 1024px) {
    .tmly-header-burger,
    .tmly-mobile-nav { display: none !important; }
    .tmly-header-nav { display: flex; }
    .tmly-header-actions .tmly-btn { display: inline-flex; }
    .tmly-single-hero-grid { grid-template-columns: 1fr 340px; }
    .tmly-checkout-wrap { grid-template-columns: 1fr 360px; }
    .tmly-footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (max-width: 767px) {
    .tmly-hero { padding-block: var(--tmly-space-16) var(--tmly-space-12); }
    .tmly-section { padding-block: var(--tmly-space-12); }
    .tmly-themes-grid { grid-template-columns: repeat(2, 1fr); gap: var(--tmly-space-3); }
    .tmly-dash-stats { grid-template-columns: repeat(2, 1fr); }
    .tmly-footer-grid { grid-template-columns: 1fr; }
    .tmly-footer-bottom { flex-direction: column; text-align: center; }
    .tmly-auth-card { padding: var(--tmly-space-6); }
    .tmly-checkout-wrap { padding-block: var(--tmly-space-8); }
    .tmly-demo-bar { padding-inline: var(--tmly-space-4); gap: var(--tmly-space-3); }
    .tmly-demo-bar-title { display: none; }
}

@media (max-width: 479px) {
    .tmly-themes-grid { grid-template-columns: 1fr; }
    .tmly-dash-stats { grid-template-columns: 1fr; }
    .tmly-hero-title { font-size: 2rem; }
    .tmly-section-title { font-size: var(--tmly-text-2xl); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ===========================================================
   CHECKOUT: Cash Sub-Options Styling
   =========================================================== */
.tmly-payment-option:has(input[value="cash"]:checked) {
    border-color: var(--tmly-color-primary);
    background:   var(--tmly-color-primary-light);
}

.tmly-payment-option:has(input[value="instapay"]:checked) {
    border-color: var(--tmly-color-primary);
    background:   var(--tmly-color-primary-light);
}

/* License Key Badge in Dashboard */
.tmly-license-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    background: var(--tmly-bg-subtle);
    border: 1px solid var(--tmly-border-color);
    padding: 2px 8px;
    border-radius: var(--tmly-radius-sm);
    color: var(--tmly-text-secondary);
    cursor: help;
    margin-block-start: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Browser Mockup Frame in Single Page */
.tmly-browser-frame {
    border-radius: var(--tmly-radius-lg);
    overflow: hidden;
    border: 1px solid var(--tmly-border-color);
    box-shadow: var(--tmly-shadow-lg);
}

.tmly-browser-bar {
    background: #F0F0F0;
    border-block-end: 1px solid #DDD;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tmly-browser-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.tmly-browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.tmly-browser-url {
    flex: 1;
    background: #FFF;
    border: 1px solid #DDD;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 11px;
    color: #999;
    text-align: center;
    direction: ltr;
    max-width: 300px;
    margin-inline: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
