/**
 * @file public-layout.css
 * @brief الستايلات العامة (Tokens / Reset / Header / Nav / Footer / Buttons).
 * @namespace pub-*
 */

/* ============ Design Tokens ============ */
:root {
    /* Core palette mapped to the approved 5 colors */
    --pub-bg: var(--main-bg-beige);
    /* Soft Cream Beige */
    --pub-bg-soft: var(--main-bg-beige);
    --pub-bg-cream: var(--main-bg-beige);
    --pub-surface: var(--main-bg-beige);
    /* borders use olive-charcoal with low opacity */
    --pub-border: rgba(43, 45, 41, 0.08);
    --pub-border-strong: rgba(43, 45, 41, 0.16);

    --pub-ink: #2B2D29;
    /* Olive-Charcoal Dark for all text */
    --pub-ink-2: #2B2D29;
    --pub-ink-soft: rgba(43, 45, 41, 0.72);
    --pub-ink-mute: rgba(43, 45, 41, 0.48);

    /* Primary / Accent mapping */
    --pub-primary: #CBB577;
    /* Warm Accent Gold */
    --pub-primary-dark: #3A4B29;
    /* use Dark Olive as darker tone */
    --pub-primary-soft: rgba(203, 181, 119, 0.12);

    --pub-accent: #2B2D29;
    --pub-success: #60734D;
    /* map success to Medium Olive Green */
    --pub-danger: #2B2D29;
    /* no red allowed, use charcoal for emphasis */
    --pub-info: #3A4B29;

    --pub-r-sm: 6px;
    --pub-r-md: 10px;
    --pub-r-lg: 14px;
    --pub-r-xl: 20px;
    --pub-r-full: 999px;

    --pub-space-1: 4px;
    --pub-space-2: 8px;
    --pub-space-3: 12px;
    --pub-space-4: 16px;
    --pub-space-6: 24px;
    --pub-space-8: 32px;

    --pub-shadow-sm: 0 1px 3px rgba(43, 45, 41, 0.04), 0 1px 2px rgba(43, 45, 41, 0.03);
    --pub-shadow-md: 0 6px 18px rgba(43, 45, 41, 0.07), 0 2px 5px rgba(43, 45, 41, 0.04);
    --pub-shadow-lg: 0 16px 40px rgba(43, 45, 41, 0.10), 0 4px 12px rgba(43, 45, 41, 0.05);
    --pub-shadow-focus: 0 0 0 3px rgba(203, 181, 119, 0.24);
    --pub-focus-outline: 2px solid rgba(203, 181, 119, 0.52);
    --pub-transition-fast: 150ms ease;
    --pub-transition-base: 200ms ease;
    --pub-icon-size: 16px;

    --pub-primary-rgb: 203, 181, 119;
    --pub-container: 1320px;
    --pub-font: 'Tajawal', 'Cairo', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --pub-font-heading: 'Cairo', 'Tajawal', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* ---- Notification System ---- */
    --ntf-radius: 16px;
    --ntf-blur: 16px;
    --ntf-pad-x: 22px;
    --ntf-pad-y: 18px;
    --ntf-gap: 14px;
    --ntf-icon-size: 44px;
    --ntf-bar-w: 5px;
    --ntf-close-size: 30px;

    --ntf-success: #16a34a;
    --ntf-success-bg: rgba(240, 253, 244, 0.92);
    --ntf-success-text: #166534;
    --ntf-success-border: rgba(22, 163, 74, 0.18);
    --ntf-success-glow: rgba(22, 163, 74, 0.15);

    --ntf-error: var(--text-dark-charcoal);
    --ntf-error-bg: rgba(43, 45, 41, 0.08);
    --ntf-error-text: var(--text-dark-charcoal);
    --ntf-error-border: rgba(43, 45, 41, 0.12);
    --ntf-error-glow: rgba(43, 45, 41, 0.08);

    --ntf-warning: #f59e0b;
    --ntf-warning-bg: rgba(255, 251, 235, 0.92);
    --ntf-warning-text: #92400e;
    --ntf-warning-border: rgba(245, 158, 11, 0.18);
    --ntf-warning-glow: rgba(245, 158, 11, 0.15);

    --ntf-info: var(--primary-dark-olive);
    --ntf-info-bg: rgba(58, 75, 41, 0.08);
    --ntf-info-text: var(--primary-dark-olive);
    --ntf-info-border: rgba(58, 75, 41, 0.12);
    --ntf-info-glow: rgba(14, 165, 233, 0.12);
}

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

html,
body {
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--pub-font);
    color: var(--pub-ink);
    background: var(--pub-bg);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--pub-font-heading);
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ============ Container ============ */
.pub-container {
    width: 100%;
    max-width: var(--pub-container);
    margin: 0 auto;
    padding: 0 22px;
}

/* ============================================================
 * Global Notification System (Frontend)
 * ============================================================
 * بطاقة Floating حديثة — Premium Order Toast.
 * تدعم: success, error, warning, info.
 * محاذاة RTL كاملة.
 * ============================================================ */

/* ---- Container ---- */
.al-portal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 20px;
    pointer-events: none;
}

.al-portal .al-toast--flash {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
}

.al-toast--flash {
    max-width: 560px;
    width: min(560px, calc(100vw - 40px));
    pointer-events: none;
}

.al-toast--flash .al-glass {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 26px 22px;
    border-radius: 24px;
    border: 1px solid rgba(13, 27, 47, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)),
        radial-gradient(circle at top right, rgba(245, 183, 62, 0.10), transparent 48%);
    box-shadow:
        0 12px 30px rgba(13, 27, 47, 0.10),
        0 24px 60px rgba(13, 27, 47, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform .28s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow .35s ease;
    animation: ntfFloat 3s ease-in-out infinite;
}

.al-toast--flash .al-glass:hover {
    animation: none;
    transform: translateY(-2px);
    box-shadow:
        0 16px 36px rgba(13, 27, 47, 0.12),
        0 30px 74px rgba(13, 27, 47, 0.18),
        0 0 0 1px rgba(245, 183, 62, 0.08) inset;
}

/* ---- Type borders ---- */
.al-toast--flash.al-success .al-glass {
    border-color: rgba(245, 183, 62, 0.24);
}

.al-toast--flash.al-error .al-glass {
    border-color: rgba(239, 68, 68, 0.24);
}

.al-toast--flash.al-warning .al-glass {
    border-color: rgba(245, 183, 62, 0.24);
}

.al-toast--flash.al-info .al-glass {
    border-color: rgba(59, 130, 246, 0.24);
}

/* ---- Icon Circle ---- */
.al-toast--flash .al-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-top: 2px;
}

.al-toast--flash .al-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.al-toast--flash.al-success .al-icon {
    background: linear-gradient(135deg, var(--pub-primary), var(--pub-primary-dark));
    color: var(--pub-ink);
    box-shadow: 0 8px 20px rgba(245, 183, 62, 0.32);
}

.al-toast--flash.al-error .al-icon {
    background: linear-gradient(135deg, var(--text-dark-charcoal), var(--primary-dark-olive));
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

.al-toast--flash.al-warning .al-icon {
    background: linear-gradient(135deg, var(--accent-gold), rgba(203, 181, 119, 0.85));
    color: var(--pub-ink);
    box-shadow: 0 8px 20px rgba(203, 181, 119, 0.28);
}

.al-toast--flash.al-info .al-icon {
    background: linear-gradient(135deg, var(--primary-dark-olive), var(--secondary-olive));
    color: #fff;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.24);
}

/* ---- Glow Bubble ---- */
.al-toast--flash .al-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    top: -60px;
    inset-inline-end: -50px;
    filter: blur(60px);
    pointer-events: none;
    opacity: 0;
    transition: opacity .5s ease;
}

.al-toast--flash.al-enter .al-glow {
    opacity: 0.45;
}

.al-toast--flash.al-success .al-glow {
    background: rgba(245, 183, 62, 0.20);
}

.al-toast--flash.al-error .al-glow {
    background: rgba(239, 68, 68, 0.12);
}

.al-toast--flash.al-warning .al-glow {
    background: rgba(245, 183, 62, 0.18);
}

.al-toast--flash.al-info .al-glow {
    background: rgba(14, 165, 233, 0.12);
}

/* ---- Accent Bar ---- */
.al-toast--flash .al-bar {
    position: absolute;
    top: 16px;
    inset-inline-start: 0;
    width: 6px;
    height: calc(100% - 32px);
    border-radius: 0 8px 8px 0;
}

.al-toast--flash.al-success .al-bar {
    background: var(--pub-primary);
}

.al-toast--flash.al-error .al-bar {
    background: var(--text-dark-charcoal);
}

.al-toast--flash.al-warning .al-bar {
    background: #f5b73e;
}

.al-toast--flash.al-info .al-bar {
    background: var(--primary-dark-olive);
}

/* ---- Body / Typography ---- */
.al-toast--flash .al-body {
    flex: 1;
    min-width: 0;
    padding-top: 5px;
}

.al-toast--flash .al-title {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.4;
    margin-bottom: 6px;
    letter-spacing: 0;
}

.al-toast--flash .al-msg {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
    opacity: 0.92;
}

.al-toast--flash.al-success .al-body {
    color: var(--secondary-olive);
}

.al-toast--flash.al-error .al-body {
    color: var(--text-dark-charcoal);
}

.al-toast--flash.al-warning .al-body {
    color: #92400e;
}

.al-toast--flash.al-info .al-body {
    color: var(--primary-dark-olive);
}

/* ---- Close Button ---- */
.al-toast--flash .al-close {
    flex-shrink: 0;
    align-self: flex-start;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 0;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    margin-top: -4px;
    margin-inline-end: -6px;
    margin-inline-start: auto;
    transition: background .2s, color .2s, transform .2s;
}

.al-toast--flash .al-close svg {
    width: 16px;
    height: 16px;
    display: block;
}

.al-toast--flash .al-close:hover {
    transform: scale(1.12);
}

.al-toast--flash.al-success .al-close {
    color: rgba(245, 183, 62, 0.55);
}

.al-toast--flash.al-success .al-close:hover {
    background: rgba(245, 183, 62, 0.12);
    color: var(--pub-primary);
}

.al-toast--flash.al-error .al-close {
    color: rgba(252, 165, 165, 0.55);
}

.al-toast--flash.al-error .al-close:hover {
    background: rgba(239, 68, 68, 0.10);
    color: #fca5a5;
}

.al-toast--flash.al-warning .al-close {
    color: rgba(253, 230, 138, 0.55);
}

.al-toast--flash.al-warning .al-close:hover {
    background: rgba(245, 183, 62, 0.10);
    color: #fde68a;
}

.al-toast--flash.al-info .al-close {
    color: rgba(125, 211, 252, 0.55);
}

.al-toast--flash.al-info .al-close:hover {
    background: rgba(14, 165, 233, 0.10);
    color: #7dd3fc;
}

/* ---- Progress Bar ---- */
.al-toast--flash .al-progress {
    position: absolute;
    inset-inline: 18px;
    bottom: 10px;
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(13, 27, 47, 0.08);
}

.al-toast--flash .al-progress-inner {
    height: 100%;
    width: 100%;
    transform-origin: right center;
    animation: ntfProgress 5s linear forwards;
    opacity: 0.85;
}

.al-toast--flash.al-success .al-progress-inner {
    background: var(--pub-primary);
}

.al-toast--flash.al-error .al-progress-inner {
    background: var(--text-dark-charcoal);
}

.al-toast--flash.al-warning .al-progress-inner {
    background: #f5b73e;
}

.al-toast--flash.al-info .al-progress-inner {
    background: var(--primary-dark-olive);
}

/* ---- Animations ---- */
.al-toast--flash.al-enter {
    animation: ntfEnter .5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.al-toast--flash.al-exit {
    animation: ntfExit .32s ease forwards;
}

@keyframes ntfEnter {
    0% {
        opacity: 0;
        transform: translateY(-24px) scale(0.92);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ntfExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-16px) scale(0.92);
    }
}

@keyframes ntfProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@keyframes ntfFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* ---- Responsive: Tablet & Mobile ---- */
@media (max-width: 640px) {
    .al-toast--flash {
        width: calc(100vw - 24px);
        max-width: none;
    }

    .al-toast--flash .al-glass {
        gap: 12px;
        padding: 18px 18px 18px;
        border-radius: 18px;
    }

    .al-toast--flash .al-icon {
        width: 42px;
        height: 42px;
    }

    .al-toast--flash .al-icon svg {
        width: 19px;
        height: 19px;
    }

    .al-toast--flash .al-title {
        font-size: 15px;
    }

    .al-toast--flash .al-msg {
        font-size: 13px;
    }

    .al-toast--flash .al-bar {
        width: 4px;
        top: 12px;
        height: calc(100% - 24px);
    }

    .al-toast--flash .al-close {
        width: 28px;
        height: 28px;
        margin-top: -3px;
        margin-inline-end: -4px;
    }

    .al-toast--flash .al-close svg {
        width: 14px;
        height: 14px;
    }

    .al-toast--flash .al-glow {
        width: 140px;
        height: 140px;
        top: -50px;
        inset-inline-end: -40px;
        filter: blur(50px);
    }

    .al-toast--flash .al-progress {
        inset-inline: 14px;
        bottom: 10px;
    }
}

/* ============ Buttons ============ */
.pub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 26px;
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--pub-r-sm);
    border: 1px solid transparent;
    transition: transform var(--pub-transition-fast), box-shadow var(--pub-transition-base), background-color var(--pub-transition-base), color var(--pub-transition-base), border-color var(--pub-transition-base);
    user-select: none;
    white-space: nowrap;
}

.pub-btn i,
.pub-btn svg {
    flex-shrink: 0;
    font-size: var(--pub-icon-size);
    height: var(--pub-icon-size);
    width: var(--pub-icon-size);
}

.pub-btn:hover {
    transform: translateY(-1px);
}

.pub-btn:focus-visible {
    outline: var(--pub-focus-outline);
    outline-offset: 2px;
}

.pub-btn--primary {
    background: var(--pub-primary);
    color: var(--pub-ink);
    box-shadow: 0 6px 16px rgba(203, 181, 119, 0.26);
}

.pub-btn--primary:hover {
    background: var(--pub-primary-dark);
    color: #fff;
}

.pub-btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.pub-btn--ghost:hover {
    background: rgba(255, 255, 255, .1);
    border-color: #fff;
}

.pub-btn--danger {
    background: #dc2626;
    color: #fff;
}

.pub-btn--danger:hover {
    background: #b91c1c;
    color: #fff;
}

.pub-btn--block {
    width: 100%;
}

/* ============ Sections ============ */
.pub-section {
    padding: 56px 0;
}

.pub-section-title {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: 0;
}

/* ============ Row 1: الشريط العلوي الداكن (ترحيب + شارات ثقة) ============ */
.pub-topbar {
    background: #2D3A1E;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    padding: 9px 0;
}

.pub-topbar__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.pub-topbar__welcome {
    font-weight: 600;
    white-space: nowrap;
}

.pub-topbar__badges {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pub-topbar__badges li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 600;
    white-space: nowrap;
}

.pub-topbar__badges li:first-child {
    border-inline-start: 0;
}

.pub-topbar__badges i {
    color: var(--pub-primary);
    font-size: 14px;
}

/* ============ Row 2: الهيدر الموحّد (شعار + تنقّل + أدوات) ============ */
.pub-header {
    background: #fff;
    padding: 0;
    border-bottom: 1px solid var(--pub-border);
    box-shadow: 0 1px 0 rgba(45, 58, 30, 0.04);
}

.pub-header__row {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 84px;
}

/* الشعار المركّب — أكبر من الهيدر ويمتد لأسفل بقصاصة بيضاء (مطابق للتصميم) */
.pub-logo {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 30;
}

.pub-logo__mark {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff, #f4f4f4);
    border-radius: 50%;
    margin-bottom: -38px;
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.12),
        0 6px 12px rgba(0, 0, 0, 0.08),
        inset 0 3px 6px rgba(255, 255, 255, 1),
        inset 0 -3px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.pub-logo:hover .pub-logo__mark {
    transform: translateY(-4px);
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        inset 0 3px 6px rgba(255, 255, 255, 1),
        inset 0 -3px 8px rgba(0, 0, 0, 0.04);
}

.pub-logo__mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 6px;
    border-radius: 50%;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.06));
}

.pub-logo__text {
    letter-spacing: 0;
    font-family: var(--pub-font-heading);
}

/* التنقّل داخل الهيدر — خط ذهبي سفلي للنشط */
.pub-header__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.pub-header__nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 30px 13px 26px;
    color: var(--pub-ink);
    font-weight: 700;
    font-size: 15px;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s, text-shadow 0.2s, transform 0.2s;
    touch-action: manipulation;
}

.pub-header__nav a:hover {
    color: var(--pub-primary-dark);
    text-shadow: 0 0 8px rgba(203, 181, 119, 0.4);
    transform: translateY(-1px);
}

.pub-header__nav a:active {
    transform: translateY(1px);
    text-shadow: 0 0 12px rgba(203, 181, 119, 0.6);
}

.pub-header__nav a.is-active {
    color: var(--pub-primary-dark);
    border-bottom-color: var(--pub-primary);
}

.pub-header__nav .pub-nav-bar__admin {
    border-bottom: 0;
    background: var(--pub-primary-soft);
    color: var(--pub-primary-dark);
    border-radius: var(--pub-r-full);
    padding: 8px 16px;
    font-size: 13px;
    margin-inline-start: 6px;
    transition: all 0.2s ease;
}

.pub-header__nav .pub-nav-bar__admin:hover {
    background: var(--pub-primary);
    color: #fff;
    box-shadow: 0 0 12px rgba(203, 181, 119, 0.5);
    transform: translateY(-1px);
}

.pub-header__nav .pub-nav-bar__admin:active {
    transform: translateY(1px);
    box-shadow: 0 0 8px rgba(203, 181, 119, 0.4);
}

.pub-header__nav-caret {
    font-size: 10px;
    opacity: .75;
    margin-inline-start: 2px;
}

/* ── Nav dropdown (الأقسام تحت الرئيسية) ── */
.pub-nav-has-drop {
    position: relative;
}

.pub-nav-drop {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    background: #fff;
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-r-lg);
    box-shadow: var(--pub-shadow-lg);
    min-width: 220px;
    z-index: 60;
    padding: 8px;
}

.pub-nav-has-drop:hover .pub-nav-drop,
.pub-nav-has-drop.is-open .pub-nav-drop {
    display: block;
    animation: pubNavDropFade .18s ease;
}

@keyframes pubNavDropFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.pub-nav-drop__inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pub-nav-drop__link {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 14px !important;
    border-bottom: 0 !important;
    border-radius: var(--pub-r-sm);
    font-weight: 600;
    font-size: 14px;
    color: var(--pub-ink);
    transition: background .15s;
}

.pub-nav-drop__link:hover {
    background: var(--pub-bg-soft);
    color: var(--pub-primary-dark) !important;
}

.pub-nav-drop__link small {
    color: var(--pub-ink-soft);
    font-size: 12px;
    font-weight: 400;
}

.pub-nav-drop__empty {
    padding: 14px;
    color: var(--pub-ink-soft);
    font-size: 14px;
}

/* بحث أيقوني (مطابق للتصميم) — يتمدد إلى حقل عند التركيز/الكتابة */
.pub-search {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: var(--pub-r-full);
    height: 44px;
    width: 44px;
    padding: 0;
    flex-direction: row-reverse;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.pub-search:hover,
.pub-search:focus-within,
.pub-search.is-open {
    width: 280px;
    background: #fff;
    border-color: var(--pub-primary);
    box-shadow: 0 4px 16px rgba(203, 181, 119, 0.15), 0 0 0 4px rgba(203, 181, 119, 0.1);
    /* عند الفتح نسمح بتجاوز الحدود حتى تظهر قائمة البحث المباشر (.pub-ls) */
    overflow: visible;
}

.pub-search__btn {
    width: 36px;
    height: 36px;
    background: transparent;
    color: var(--pub-ink-soft);
    border: 0;
    border-radius: 50%;
    margin: 3px;
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    touch-action: manipulation;
}

.pub-search__btn:active {
    transform: scale(0.92);
    opacity: 0.85;
}

.pub-search__btn.is-active {
    transform: scale(0.94);
    opacity: 0.85;
}

@media (hover: hover) {
    .pub-search__btn:hover {
        background: var(--pub-bg-soft);
        transform: translateY(-1px);
        box-shadow: var(--pub-shadow-md);
    }
}

/* في الوضع المطوي: الحقل شفاف فوق الأيقونة بالكامل، فالنقر يركّز الحقل ويفتح البحث */
.pub-search__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0 16px;
    height: 100%;
    font: inherit;
    font-size: 14.5px;
    color: var(--pub-ink);
    min-width: 0;
    flex: 1;
}

.pub-search:hover .pub-search__input,
.pub-search:focus-within .pub-search__input,
.pub-search.is-open .pub-search__input {
    position: static;
    opacity: 1;
    cursor: text;
}

.pub-search__input:focus,
.pub-search__input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.pub-search__btn:focus-visible,
.pub-search__cat:focus-visible {
    outline: var(--pub-focus-outline);
    outline-offset: 2px;
}

.pub-header__tools {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    margin-inline-start: auto;
}

/* ── Account dropdown ── */
.pub-tool--account {
    position: relative;
}

.pub-tool__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: var(--pub-r-md);
    background: transparent;
    border: 0;
    color: var(--pub-ink);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.15s, box-shadow 0.2s;
    cursor: pointer;
    font: inherit;
    touch-action: manipulation;
}

.pub-tool__btn:hover {
    background: var(--pub-bg-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.pub-tool__btn:active {
    transform: scale(0.94);
    background: var(--pub-bg-soft);
}

.pub-acc-drop {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    background: #fff;
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-r-lg);
    box-shadow: var(--pub-shadow-lg);
    width: 300px;
    z-index: 60;
    padding: 14px;
    animation: pubAccFade .18s ease;
}

@keyframes pubAccFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.pub-acc-drop__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 4px 14px;
    border-bottom: 1px solid var(--pub-border);
    margin-bottom: 10px;
}

.pub-acc-drop__avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pub-primary), var(--pub-primary-dark));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.pub-acc-drop__head strong {
    display: block;
    font-size: 14px;
    color: var(--pub-ink);
}

.pub-acc-drop__head small {
    color: var(--pub-ink-soft);
    font-size: 12px;
}

.pub-acc-drop__menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pub-acc-drop__menu li hr {
    border: 0;
    border-top: 1px solid var(--pub-border);
    margin: 6px 0;
}

.pub-acc-drop__menu a,
.pub-acc-drop__logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--pub-r-sm);
    color: var(--pub-ink);
    font-size: 14px;
    font-weight: 600;
    transition: background .15s, color .15s;
    width: 100%;
    text-align: right;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.pub-acc-drop__menu a:hover {
    background: var(--pub-bg-soft);
    color: var(--pub-primary-dark);
}

.pub-acc-drop__menu a i {
    color: var(--pub-ink-soft);
    width: 18px;
    text-align: center;
}

.pub-acc-drop__menu a:hover i {
    color: var(--pub-primary-dark);
}

.pub-acc-drop__logout {
    color: var(--pub-danger);
}

.pub-acc-drop__logout:hover {
    background: #fee2e2;
}

/* Status dot next to مشترياتي */
.acc-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-inline-start: 6px;
    vertical-align: middle;
}

/* Unread ticket indicator */
.acc-unread-dot {
    font-size: 7px;
    color: var(--accent-gold);
    margin-inline-start: 4px;
    vertical-align: middle;
}

/* Login form */
.pub-acc-drop__title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 800;
    color: var(--pub-ink);
}

.pub-acc-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pub-acc-form[hidden] {
    display: none !important;
}

.pub-acc-form__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pub-acc-form__field label {
    font-size: 12px;
    color: var(--pub-ink-soft);
    font-weight: 600;
}

.pub-acc-form__field input {
    padding: 10px 12px;
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-r-sm);
    font: inherit;
    background: var(--pub-bg-soft);
    color: var(--pub-ink);
    min-height: 42px;
    transition: border-color var(--pub-transition-fast), background-color var(--pub-transition-fast), box-shadow var(--pub-transition-fast);
}

.pub-acc-form__field input:focus {
    outline: none;
    border-color: var(--pub-primary);
    background: #fff;
    box-shadow: var(--pub-shadow-focus);
}

.pub-acc-form__check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--pub-ink-soft);
    cursor: pointer;
}

.pub-acc-form__check input {
    accent-color: var(--pub-primary);
}

.pub-acc-form__btn {
    background: var(--pub-primary);
    color: var(--pub-ink);
    padding: 10px 16px;
    border: 0;
    border-radius: var(--pub-r-sm);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s, color .2s;
    text-decoration: none;
}

.pub-acc-form__btn:hover {
    background: var(--pub-primary-dark);
    color: #fff;
}

.pub-acc-form__btn--ghost {
    background: transparent;
    color: var(--pub-ink);
    border: 1px solid var(--pub-border-strong);
}

.pub-acc-form__btn--ghost:hover {
    background: var(--pub-bg-soft);
    color: var(--pub-primary-dark);
}

.pub-acc-form__sep {
    text-align: center;
    font-size: 12px;
    color: var(--pub-ink-soft);
    margin: 4px 0;
}

.pub-acc-form__msg {
    padding: 8px 10px;
    border-radius: var(--pub-r-sm);
    font-size: 13px;
    font-weight: 600;
}

/* ── Guest login dropdown (professional design) ───────────────────── */
.pub-acc-drop--guest {
    width: 340px;
    padding: 16px;
}

.pub-acc-drop__hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: -6px -6px 12px;
    background: linear-gradient(135deg, rgba(245, 183, 62, 0.12), rgba(245, 183, 62, 0.04));
    border: 1px solid rgba(245, 183, 62, 0.18);
    border-radius: var(--pub-r-md);
}

.pub-acc-drop__hero-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--pub-primary);
    color: var(--pub-ink);
    font-size: 18px;
    box-shadow: 0 6px 14px rgba(245, 183, 62, 0.35);
}

.pub-acc-drop__hero strong {
    display: block;
    font-size: 13.5px;
    color: var(--pub-ink);
    font-weight: 800;
}

.pub-acc-drop__hero small {
    color: var(--pub-ink-soft);
    font-size: 11.5px;
}

.pub-acc-form__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.pub-acc-form__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pub-acc-form__input-wrap>i {
    position: absolute;
    inset-inline-start: 12px;
    color: var(--pub-ink-soft);
    font-size: 13px;
    pointer-events: none;
}

.pub-acc-form__input-wrap input {
    width: 100%;
    padding: 11px 14px;
    padding-inline-start: 38px;
    padding-inline-end: 14px;
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-r-sm);
    font: inherit;
    background: #fff;
    color: var(--pub-ink);
    min-height: 42px;
    transition: border-color var(--pub-transition-fast), box-shadow var(--pub-transition-fast);
}

.pub-acc-form__input-wrap input:focus {
    outline: none;
    border-color: var(--pub-primary);
    box-shadow: var(--pub-shadow-focus);
}

.pub-acc-form__input-wrap input[type="password"] {
    padding-inline-end: 40px;
}

.pub-acc-form__toggle-pw {
    position: absolute;
    inset-inline-end: 6px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    color: var(--pub-ink-soft);
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s, color .15s;
}

.pub-acc-form__toggle-pw:hover {
    background: var(--pub-bg-soft);
    color: var(--pub-primary-dark);
}

.pub-acc-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 2px 0;
}

.pub-acc-form__link {
    font-size: 12px;
    color: var(--pub-primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.pub-acc-form__link:hover {
    text-decoration: underline;
}

.pub-acc-form__btn {
    width: 100%;
}

.pub-acc-form__btn.is-loading {
    opacity: .8;
    pointer-events: none;
}

.pub-acc-form__sep {
    position: relative;
    text-align: center;
    color: var(--pub-ink-soft);
    font-size: 11px;
    margin: 8px 0 4px;
}

.pub-acc-form__sep::before,
.pub-acc-form__sep::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 22px);
    height: 1px;
    background: var(--pub-border);
}

.pub-acc-form__sep::before {
    inset-inline-start: 0;
}

.pub-acc-form__sep::after {
    inset-inline-end: 0;
}

.pub-acc-form__sep span {
    background: #fff;
    padding: 0 8px;
    position: relative;
}

.pub-acc-form__note {
    margin: 4px 0 0;
    text-align: center;
    font-size: 11px;
    color: var(--pub-ink-soft);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

.pub-acc-form__note i {
    color: #16a34a;
}

/* Forgot password sub-form */
.pub-acc-form--forgot {
    margin-top: 4px;
}

.pub-acc-form__title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
    color: var(--pub-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pub-acc-form__title i {
    color: var(--pub-primary-dark);
}

.pub-acc-form__help {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--pub-ink-soft);
    line-height: 1.6;
}

.pub-acc-form__back {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--pub-ink-soft);
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: center;
}

.pub-acc-form__back:hover {
    color: var(--pub-primary-dark);
}

button.pub-acc-form__link {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.pub-acc-form__link--center[hidden] {
    display: none !important;
}

.pub-acc-form__link--center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    font-size: 12px;
    color: var(--pub-primary-dark);
    font-weight: 600;
}

.pub-acc-form__link--center i {
    font-size: 11px;
}

.pub-acc-form__link.is-pulse {
    animation: ppLinkPulse 1.2s ease-in-out 2;
}

@keyframes ppLinkPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
        color: #b45309;
    }
}

@media (max-width: 480px) {

    .pub-acc-drop,
    .pub-acc-drop--guest {
        position: fixed;
        top: 98px;
        left: 14px;
        right: 14px;
        width: auto;
        max-width: none;
    }

    .pub-acc-drop--guest {
        width: min(92vw, 320px);
    }
}

/* end guest login */
.pub-tool {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 6px;
    border-radius: var(--pub-r-md);
    transition: background .15s;
    color: var(--pub-ink);
}

/* أدوات الهيدر أيقونية فقط (مطابق للتصميم) */
.pub-header .pub-tool__text {
    display: none;
}

.pub-tool:hover {
    background: var(--pub-bg-soft);
}

.pub-tool__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--pub-ink);
    display: grid;
    place-items: center;
    font-size: 18px;
    position: relative;
    flex-shrink: 0;
    transition: background .15s;
}

.pub-tool:hover .pub-tool__icon {
    background: var(--pub-bg-soft);
}

.pub-tool--cart .pub-tool__icon {
    background: transparent;
    color: var(--pub-ink);
}

.pub-tool__badge-ntf {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #fff;
    box-sizing: content-box;
    z-index: 2;
}

.pub-tool__badge-ntf--muted {
    background: var(--pub-primary);
}

.acc-ntf-shake {
    font-size: 13px;
    color: var(--accent-gold);
    animation: acc-ntf-shake .6s ease-in-out infinite;
    flex-shrink: 0;
}

.acc-ntf-muted {
    font-size: 13px;
    color: #94a3b8;
    flex-shrink: 0;
}

@keyframes acc-ntf-shake {

    0%,
    100% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(-14deg);
    }

    30% {
        transform: rotate(10deg);
    }

    45% {
        transform: rotate(-8deg);
    }

    60% {
        transform: rotate(6deg);
    }

    75% {
        transform: rotate(-4deg);
    }
}

@keyframes ntf-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-2px) rotate(-4deg);
    }

    30% {
        transform: translateX(2px) rotate(4deg);
    }

    45% {
        transform: translateX(-1px) rotate(-2deg);
    }

    60% {
        transform: translateX(1px) rotate(2deg);
    }

    75% {
        transform: translateX(-.5px) rotate(-1deg);
    }
}

/* شارة العدّاد */
.pub-tool__badge {
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--pub-primary);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.pub-tool__badge[hidden] {
    display: none;
}

/* ===== Wishlist badge ===== */
.pub-tool__badge--fav {
    background: #e74c3c;
    color: #fff;
}

.pub-tool__badge--fav:hover {
    background: #c0392b;
}

.pub-tool__badge:hover {
    background: linear-gradient(135deg, rgba(245, 183, 62, 0.55) 0%, rgba(203, 181, 119, 0.92) 100%);
    transform: scale(1.15);
    box-shadow:
        0 0 0 3px rgba(203, 181, 119, 0.30),
        0 4px 14px rgba(203, 181, 119, 0.42),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.60),
        0 0 22px rgba(203, 181, 119, 0.80);
}

.pub-tool__badge--cart-pop {
    animation: cartBadgePulse .42s ease !important;
}

@keyframes cartBadgeGlow {

    0%,
    100% {
        box-shadow:
            0 0 0 2px rgba(203, 181, 119, 0.16),
            0 2px 8px rgba(203, 181, 119, 0.22),
            inset 0 1.5px 0 rgba(255, 255, 255, 0.50),
            0 0 8px rgba(203, 181, 119, 0.45);
    }

    50% {
        box-shadow:
            0 0 0 3px rgba(203, 181, 119, 0.30),
            0 2px 12px rgba(203, 181, 119, 0.34),
            inset 0 1.5px 0 rgba(255, 255, 255, 0.60),
            0 0 20px rgba(203, 181, 119, 0.78);
    }
}

@keyframes cartBadgePulse {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.45);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes favBadgePop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

.pub-cart-wrap {
    position: relative;
}

.mini-cart {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: min(360px, calc(100vw - 28px));
    z-index: 160;
    padding: 14px;
    border: 1px solid var(--pub-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(.98);
    transform-origin: top left;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    pointer-events: none;
}

.pub-cart-wrap[data-has-items="true"]:hover .mini-cart,
.pub-cart-wrap[data-has-items="true"]:focus-within .mini-cart {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pub-cart-wrap[data-has-items="false"] .mini-cart {
    display: none;
}

.mini-cart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--pub-ink);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pub-border);
}

.mini-cart__head span {
    color: var(--pub-primary);
    font-weight: 900;
    font-family: 'Inter', var(--pub-font);
}

.mini-cart__items {
    display: grid;
    gap: 10px;
    max-height: 252px;
    overflow-y: auto;
    padding: 12px 2px;
}

.mini-cart__items::-webkit-scrollbar {
    width: 6px;
}

.mini-cart__items::-webkit-scrollbar-thumb {
    background: var(--pub-border-strong);
    border-radius: 999px;
}

.mini-cart__item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    color: var(--pub-ink);
}

.mini-cart__thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--pub-bg-soft);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--pub-ink-soft);
}

.mini-cart__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cart__name {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-cart__meta {
    color: var(--pub-ink-soft);
    font-size: 11.5px;
    margin-top: 2px;
}

.mini-cart__price {
    color: var(--pub-primary-dark);
    font-size: 12.5px;
    font-weight: 900;
    font-family: 'Inter', var(--pub-font);
}

.mini-cart__empty {
    display: grid;
    gap: 6px;
    place-items: center;
    padding: 24px 18px;
    text-align: center;
    color: var(--pub-ink-soft);
}

.mini-cart__empty i {
    font-size: 20px;
    color: var(--pub-primary);
}

.mini-cart__empty strong {
    color: var(--pub-ink);
    font-size: 14px;
}

.mini-cart__empty span {
    font-size: 12px;
    color: var(--pub-ink-soft);
}

.mini-cart__actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--pub-border);
}

.mini-cart__btn {
    min-height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    transition: background-color var(--pub-transition-base), border-color var(--pub-transition-base), color var(--pub-transition-base), box-shadow var(--pub-transition-base), transform var(--pub-transition-base);
    cursor: pointer;
}

.mini-cart__btn--ghost {
    color: var(--pub-ink);
    border: 1px solid var(--pub-border-strong);
    background: transparent;
}

.mini-cart__btn--ghost:hover {
    background: var(--pub-bg-soft);
    border-color: var(--pub-primary);
}

.mini-cart__btn--ghost:active {
    transform: scale(0.97);
}

.mini-cart__btn--primary {
    color: var(--pub-ink);
    background: var(--pub-primary);
    box-shadow: 0 8px 22px rgba(203, 181, 119, 0.28);
}

.mini-cart__btn--primary:hover {
    background: var(--pub-primary-dark);
    color: #fff;
    box-shadow: 0 10px 28px rgba(58, 75, 41, 0.28);
}

.mini-cart__btn--primary:active {
    transform: scale(0.97);
}

.checkout-map {
    display: grid;
    gap: 10px;
}

.checkout-map__canvas {
    height: 260px;
    border: 1px solid var(--pub-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--pub-bg-soft);
    display: grid;
    place-items: center;
    color: var(--pub-ink-soft);
    text-align: center;
    padding: 18px;
}

.checkout-map__canvas--picked {
    border-color: var(--pub-primary);
}

@media(max-width:900px) {}

/* Toast إشعار المفضلة */
.pub-toast {
    position: fixed;
    bottom: 24px;
    inset-inline-start: 24px;
    z-index: 200;
    background: var(--pub-ink);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--pub-r-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    max-width: 360px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}

.pub-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pub-tool__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.pub-tool__text small {
    color: var(--pub-ink-soft);
    font-size: 11px;
}

.pub-tool__text strong {
    font-size: 13px;
    font-weight: 700;
}

.pub-burger {
    display: none;
    width: 48px;
    height: 48px;
    background: var(--pub-bg-soft);
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-r-sm);
    align-items: center;
    justify-content: center;
    color: var(--pub-ink);
}

.pub-burger svg {
    width: 22px;
    height: 22px;
}

/* ============ Row 3: Navbar ============ */
/* صف التنقّل المنفصل أُدمج في الهيدر الموحّد (.pub-header__nav) */
.pub-nav-bar {
    display: none;
}

.pub-nav-bar__admin:hover {
    color: var(--pub-primary-dark);
    border-color: var(--pub-primary);
}

/* ============ Mobile Drawer ============ */
.pub-drawer {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 47, 0.45);
    z-index: 95;
    display: none;
}

.pub-drawer.is-open {
    display: block;
}

.pub-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(86vw, 320px);
    height: 100%;
    background: #fff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, .15);
    overflow-y: auto;
}

.pub-drawer__close {
    align-self: flex-end;
    min-height: 48px;
    background: var(--pub-bg-soft);
    border: 0;
    padding: 8px 12px;
    border-radius: var(--pub-r-sm);
    margin-bottom: 12px;
}

.pub-drawer a {
    min-height: 48px;
    padding: 14px 12px;
    font-weight: 600;
    border-radius: var(--pub-r-sm);
    border-bottom: 1px solid var(--pub-border);
    color: var(--pub-ink);
    display: flex;
    align-items: center;
}

.pub-drawer a:hover {
    background: var(--pub-bg-soft);
}

.pub-drawer__group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
}

.pub-drawer__group-title {
    font-size: 12px;
    color: var(--pub-ink-soft);
    padding: 6px 12px;
    font-weight: 700;
    letter-spacing: .5px;
}

.pub-drawer__sub {
    min-height: 40px !important;
    padding: 8px 12px 8px 20px !important;
    font-weight: 500 !important;
    font-size: 14px;
}

/* ============ Page hero (subpages) ============ */
.pub-pagehero {
    position: relative;
    background: var(--pub-bg-soft);
    padding: 40px 0;
    border-bottom: 1px solid var(--pub-border);
    overflow: hidden;
}

.pub-pagehero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 420px 320px at 100% 0%, rgba(245, 183, 62, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 360px 280px at 0% 100%, rgba(45, 58, 30, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.pub-pagehero__crumbs {
    color: var(--pub-ink-soft);
    font-size: 14px;
    margin-bottom: 8px;
    position: relative;
}

.pub-pagehero__crumbs a {
    color: var(--pub-ink-soft);
    transition: color .15s;
}

.pub-pagehero__crumbs a:hover {
    color: var(--pub-primary-dark);
}

.pub-pagehero__crumbs span {
    color: var(--pub-primary-dark);
    font-weight: 600;
}

/* Breadcrumb as <ol> (semantic, schema.org) */
ol.pub-pagehero__crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
}

ol.pub-pagehero__crumbs li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

ol.pub-pagehero__crumbs li+li::before {
    content: '/';
    color: var(--pub-ink-mute);
    font-size: 12px;
    margin-inline: 2px;
}

ol.pub-pagehero__crumbs a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

ol.pub-pagehero__crumbs a i {
    font-size: 12px;
}

.pub-pagehero h1 {
    font-size: clamp(24px, 3vw, 32px);
    margin: 0;
    font-weight: 800;
}

.pub-pagehero__icon {
    color: var(--pub-primary-dark);
    margin-inline-end: 8px;
}

.pub-pagehero__desc {
    color: var(--pub-ink-soft);
    margin: 8px 0 0;
}

/* ============ Page hero — Premium variant (لصفحات منظّمة: الأكثر تقييماً ...) ============ */
.pub-pagehero--premium {
    padding: 56px 0 64px;
    background:
        linear-gradient(135deg, rgba(45, 58, 30, 0.04) 0%, rgba(245, 183, 62, 0.06) 100%),
        var(--pub-bg-soft);
    border-bottom: 1px solid var(--pub-border);
}

.pub-pagehero--premium::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pub-primary) 0%, var(--pub-primary-dark) 50%, var(--pub-primary) 100%);
    opacity: .85;
}

.pub-pagehero__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 32px;
    position: relative;
}

.pub-pagehero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(245, 183, 62, 0.14);
    color: var(--pub-primary-dark);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
    border: 1px solid rgba(245, 183, 62, 0.25);
}

.pub-pagehero__badge i {
    font-size: 12px;
}

.pub-pagehero__title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.pub-pagehero__title-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--pub-primary) 0%, var(--pub-primary-dark) 100%);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 8px 20px rgba(245, 183, 62, 0.25);
    flex-shrink: 0;
}

.pub-pagehero h1.pub-pagehero__title {
    font-size: clamp(26px, 3.4vw, 36px);
    margin: 0;
    line-height: 1.2;
    position: relative;
    padding-bottom: 14px;
}

.pub-pagehero h1.pub-pagehero__title::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--pub-primary), transparent);
}

.pub-pagehero__desc {
    color: var(--pub-ink-soft);
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    max-width: 60ch;
}

.pub-pagehero__stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.pub-pagehero__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-r-md);
    min-width: 130px;
    box-shadow: 0 2px 8px rgba(13, 27, 47, 0.04);
    transition: transform .25s ease, box-shadow .25s ease;
}

.pub-pagehero__stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 27, 47, 0.08);
}

.pub-pagehero__stat-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--pub-ink);
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pub-pagehero__stat-value i {
    color: var(--pub-primary);
    font-size: 16px;
}

.pub-pagehero__stat-label {
    font-size: 12px;
    color: var(--pub-ink-soft);
    font-weight: 600;
}

@media (max-width: 820px) {
    .pub-pagehero__inner {
        grid-template-columns: 1fr;
    }

    .pub-pagehero__stats {
        width: 100%;
    }
}

/* ============ Generic ============ */
.pub-card {
    background: #fff;
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-r-lg);
    overflow: hidden;
}

/* ============ FOOTER ============ */
.pub-footer {
    background: #2D3A1E;
    color: rgba(255, 255, 255, 0.78);
    padding: 60px 0 0;
    margin-top: 28px;
}

.pub-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1.3fr;
    gap: 40px;
    margin-bottom: 36px;
}

.pub-footer h4 {
    color: #fff;
    font-size: 16px;
    margin: 0 0 18px;
    font-weight: 700;
}

.pub-footer ul li {
    padding: 6px 0;
}

.pub-footer ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: color .15s;
    font-size: 14px;
}

.pub-footer ul li a:hover {
    color: var(--pub-primary);
}

.pub-footer__news p {
    font-size: 13.5px;
    line-height: 1.7;
    margin: 0 0 16px;
}

.pub-news-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
    position: relative;
    transition: box-shadow .3s;
    padding: 4px;
    border-radius: var(--pub-r-md);
}

@keyframes pubNewsPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 183, 62, 0.6);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(245, 183, 62, 0);
    }

    100% {
        box-shadow: 0 0 0 4px rgba(245, 183, 62, 0.25);
    }
}

.pub-news-row {
    display: flex;
    gap: 6px;
}

.pub-news-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* CAPTCHA حسابي — إخفاء بالقوة عند وجود hidden (لمنع تجاوز attribute hidden) */
.pub-news-captcha[hidden] {
    display: none !important;
}

.pub-news-captcha {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--pub-r-sm);
    padding: 6px 10px;
}

.pub-news-captcha__q {
    flex: 1;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
}

.pub-news-captcha input[type="number"] {
    width: 80px;
    padding: 6px 10px;
    border-radius: var(--pub-r-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 13px;
    text-align: center;
    -moz-appearance: textfield;
}

.pub-news-captcha input::-webkit-outer-spin-button,
.pub-news-captcha input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pub-news-captcha input:focus {
    outline: none;
    border-color: var(--pub-primary);
    box-shadow: var(--pub-shadow-focus);
}

.pub-news-captcha__refresh {
    width: 48px;
    height: 48px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    transition: color .15s, transform .3s, background .15s;
}

.pub-news-captcha__refresh:hover {
    color: var(--pub-primary);
    background: rgba(255, 255, 255, 0.05);
}

.pub-news-captcha__refresh.is-rotating {
    transform: rotate(360deg);
}

/* الرسالة */
.pub-news-msg {
    padding: 10px 14px;
    border-radius: var(--pub-r-sm);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pubNewsMsgIn .25s ease;
}

@keyframes pubNewsMsgIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* حالة Loading للزر */
.pub-news-form button[disabled] {
    opacity: .65;
    cursor: not-allowed;
}

.pub-news-form button.is-loading {
    position: relative;
    color: transparent;
}

.pub-news-form button.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pubSpin .7s linear infinite;
    color: var(--pub-ink);
}

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

.pub-news-form input {
    flex: 1;
    padding: 12px 14px;
    border-radius: var(--pub-r-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font: inherit;
    min-width: 0;
}

.pub-news-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.pub-news-form input:focus {
    outline: none;
    border-color: var(--pub-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--pub-shadow-focus);
}

.pub-news-form button {
    background: var(--pub-primary);
    color: var(--pub-ink);
    border: 0;
    min-height: 48px;
    padding: 0 18px;
    border-radius: var(--pub-r-sm);
    font-weight: 700;
    font-size: 13.5px;
    white-space: nowrap;
}

.pub-news-form button:hover {
    background: var(--pub-primary-dark);
    color: #fff;
}

.pub-footer__social {
    display: flex;
    gap: 8px;
}

.pub-footer__social a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 14px;
    transition: background .2s;
}

.pub-footer__social a:hover {
    background: var(--pub-primary);
    color: var(--pub-ink);
}

.pub-footer__brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13.5px;
    line-height: 1.8;
    margin: 0 0 18px;
}

.pub-footer__logo {
    color: #fff;
    margin-bottom: 14px;
}

.pub-footer__logo .pub-logo__mark {
    width: 80px;
    height: 56px;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pub-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    gap: 22px;
    flex-wrap: wrap;
}

.pub-footer__bottom-end {
    display: flex;
    align-items: center;
    gap: 28px;
}

.pub-footer__bottom-links {
    display: flex;
    gap: 22px;
    align-items: center;
}

.pub-footer__bottom-links li a {
    color: rgba(255, 255, 255, 0.55);
}

.pub-footer__bottom-links li a:hover {
    color: var(--pub-primary);
}

/* ============ Floating WhatsApp Support ============ */
.whatsapp-float {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 99999;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
    background: #1fb85a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.whatsapp-float:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.28);
    outline-offset: 4px;
}

.whatsapp-float i {
    display: block;
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
    .pub-footer__grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .pub-footer__news,
    .pub-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1080px) {
    .pub-header__nav a {
        padding: 28px 9px 24px;
        font-size: 14px;
    }

    .pub-search {
        max-width: 190px;
    }
}

@media (max-width: 900px) {
    .pub-topbar__welcome {
        display: none;
    }

    .pub-topbar__badges {
        width: 100%;
        justify-content: space-between;
    }

    .pub-topbar__badges li {
        padding: 0 8px;
        font-size: 11.5px;
    }

    .pub-header__tools .pub-tool__text {
        display: none;
    }

    .pub-header__row {
        gap: 14px;
        min-height: 68px;
    }

    .pub-header__nav {
        display: none;
    }

    .pub-burger {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .pub-section {
        padding: 40px 0;
    }

    .pub-footer {
        margin-top: 20px;
        padding-top: 40px;
    }

    .pub-footer__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .pub-footer__bottom {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    .pub-footer__bottom-end {
        flex-direction: column;
        gap: 12px;
    }

    .pub-search {
        display: none;
    }
}

@media (max-width: 480px) {
    .pub-header__tools {
        gap: 0;
    }

    .pub-tool {
        padding: 6px;
    }
}

/* ── عدّاد تحديثات تذاكر الدعم (زر حسابي + رابط القائمة) ── */
.pub-tool__badge-ntf--count{
    background: var(--gold, #CBB577);
    color: #2B2D29;
    font-size: 10px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    border-radius: 999px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(203,181,119,.25);
}
.acc-ntf-count{
    margin-inline-start: .5rem;
    background: #CBB577;
    color: #2B2D29;
    font-size: 11px;
    font-weight: 800;
    min-width: 19px;
    height: 19px;
    line-height: 19px;
    border-radius: 999px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── تثبيت عدّاد التذاكر فوق زاوية أيقونة المستخدم ── */
.pub-tool__icon {
    position: relative;
}

.pub-tool__badge-ntf--count {
    position: absolute;
    top: -4px;
    inset-inline-end: -6px;
    z-index: 2;
    box-shadow: 0 0 0 2px #fff;
}

/* ── نتائج البحث الحي ── */
.pub-search__results{
    position:absolute;top:100%;inset-inline-start:0;width:100%;min-width:280px;
    background:#fff;border:1px solid #e5e7eb;border-radius:12px;
    box-shadow:0 10px 30px rgba(0,0,0,.12);z-index:9999;overflow:hidden;
}
.pub-search__result{
    display:flex;align-items:center;gap:10px;padding:8px 12px;
    text-decoration:none;color:#1f2937;font-size:14px;transition:background .15s;
}
.pub-search__result:hover{background:#f9fafb}
.pub-search__price{margin-inline-start:auto;color:#CBB577;font-weight:700}
