/* ==========================================================================
   Expert Partners — Morphism Design System
   Brand gold (#FFCC00) sampled directly from assets/logo.jpg
   ========================================================================== */

:root {
    --ep-primary: #FFCC00;
    --ep-primary-light: #FFE066;
    --ep-primary-dark: #C79A00;

    /* deep steel-blue secondary accent, for variety beyond black/white/gold */
    --ep-accent: #2B4A63;
    --ep-accent-light: #EAF0F4;
    --ep-accent-dark: #1B3648;

    --ep-black: #000000;
    --ep-dark: #111111;
    --ep-charcoal: #1B1B1B;

    --ep-white: #FFFFFF;
    --ep-background: #F6F6F4;
    --ep-surface: #FFFFFF;

    --ep-glass: rgba(255, 255, 255, 0.78);
    --ep-glass-border: rgba(0, 0, 0, 0.06);

    --ep-text: #1B1B1B;
    --ep-text-muted: #5B5F66;

    --ep-success: #1E8E5A;
    --ep-warning: #B8860B;
    --ep-error: #C0392B;

    --ep-radius-sm: 10px;
    --ep-radius-md: 16px;
    --ep-radius-lg: 24px;

    /* neumorphic shadow pair, tuned to --ep-background (cards sit one shade brighter) */
    --ep-shadow-raised: 8px 8px 18px rgba(163, 166, 173, 0.28), -8px -8px 18px rgba(255, 255, 255, 0.9);
    --ep-shadow-raised-sm: 4px 4px 10px rgba(163, 166, 173, 0.25), -4px -4px 10px rgba(255, 255, 255, 0.9);
    --ep-shadow-inset: inset 4px 4px 10px rgba(163, 166, 173, 0.3), inset -4px -4px 10px rgba(255, 255, 255, 0.85);
    --ep-shadow-float: 0 16px 40px rgba(20, 20, 20, 0.1);

    color-scheme: light;
}

/* This storefront intentionally always renders in its light brand theme --
   it does not follow the visitor's OS dark-mode preference. */

* { box-sizing: border-box; }

/* Global safety net: many components (.ep-btn, .ep-modal-overlay, etc.) set
   `display` directly on their own class, which has equal specificity to the
   browser's default `[hidden] { display: none }` rule -- author rules win
   ties, so without this, toggling `hidden` via JS silently does nothing on
   any element that also carries one of those classes. `!important` here
   guarantees `hidden` always wins, everywhere, regardless of what else is
   applied to the element. Toggle visibility with `el.hidden`, never
   `style.display`, and this keeps working correctly. */
[hidden] { display: none !important; }

html, body {
    height: 100%;
    margin: 0;
    background: var(--ep-background);
    color: var(--ep-text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

.ep-container {
    width: 100%;
    margin: 0 auto;
    padding-inline: 24px;
}

/* ---------------------------------------------------------------- header */
.ep-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background: var(--ep-white);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 2px 20px rgba(20, 20, 20, 0.08);
    border-bottom: 3px solid var(--ep-primary);
}

/* Spacer so fixed header doesn't overlap page content; height is set by
   main.js to match the header's actual (variable, e.g. wrapped-mobile) height. */
body {
    padding-top: var(--ep-header-height, 72px);
    /* Sticky footer: on short pages (e.g. the admin login form), <main>'s
       intrinsic content is shorter than the viewport, and a block-flow body
       only paints its background for its own content height -- not the
       leftover viewport below it. Stretching body to the viewport and
       letting <main> absorb the slack keeps the footer flush at the bottom
       either way. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main {
    flex: 1 0 auto;
}
.ep-footer {
    flex-shrink: 0;
}

.ep-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-block: 12px;
}

.ep-logo img { display: block; }

.ep-nav { display: flex; gap: 20px; font-weight: 600; font-size: 0.92rem; }
.ep-nav a { color: var(--ep-text); opacity: 0.85; }
.ep-nav a:hover { opacity: 1; color: var(--ep-primary-dark); }

.ep-search {
    flex: 1;
    display: flex;
    max-width: 640px;
    background: var(--ep-surface);
    border-radius: var(--ep-radius-md);
    box-shadow: var(--ep-shadow-inset);
    padding: 4px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ep-search:focus-within {
    border-color: var(--ep-primary);
    box-shadow: var(--ep-shadow-inset), 0 0 0 3px rgba(255, 204, 0, 0.25);
}

.ep-search__input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: var(--ep-text);
    outline: none;
}

.ep-search__button {
    border: none;
    border-radius: var(--ep-radius-sm);
    background: var(--ep-primary);
    color: var(--ep-black);
    font-weight: 700;
    padding-inline: 18px;
    cursor: pointer;
    box-shadow: var(--ep-shadow-raised-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ep-search__button:hover { transform: translateY(-1px); }
.ep-search__button:active { box-shadow: var(--ep-shadow-inset); transform: translateY(0); }

.ep-header__actions { display: flex; align-items: center; gap: 16px; margin-inline-start: auto; }

.ep-lang-switch { font-size: 0.85rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.ep-lang-switch a { opacity: 0.6; }
.ep-lang-switch a.is-active { opacity: 1; color: var(--ep-primary-dark); }

.ep-icon-link {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ep-surface);
    box-shadow: var(--ep-shadow-raised-sm);
    font-size: 1.1rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ep-icon-link:hover { transform: translateY(-2px); }

/* ------------------------------------------------------------- flash msgs */
.ep-flash-stack { padding-block: 12px; display: flex; flex-direction: column; gap: 8px; }
.ep-flash {
    padding: 12px 16px;
    border-radius: var(--ep-radius-sm);
    font-weight: 600;
    background: var(--ep-surface);
    box-shadow: var(--ep-shadow-raised-sm);
}
.ep-flash--error { color: var(--ep-error); border-inline-start: 4px solid var(--ep-error); }
.ep-flash--info { color: var(--ep-text); border-inline-start: 4px solid var(--ep-primary); }
.ep-flash--success { color: var(--ep-success); border-inline-start: 4px solid var(--ep-success); }

/* ------------------------------------------------------------------ hero */
.ep-hero {
    background: linear-gradient(135deg, var(--ep-charcoal), #2b2b2b 60%, var(--ep-charcoal));
    color: var(--ep-white);
    padding-block: 72px;
    text-align: center;
}

.ep-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0 0 12px;
}

.ep-hero h1 .accent { color: var(--ep-primary); }

.ep-hero p { color: rgba(255,255,255,0.75); max-width: 620px; margin: 0 auto 32px; }

.ep-hero-search {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(10px);
    border-radius: var(--ep-radius-lg);
    padding: 6px;
}

.ep-hero-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--ep-white);
    padding: 14px 18px;
    font-size: 1rem;
    outline: none;
}
.ep-hero-search input::placeholder { color: rgba(255,255,255,0.5); }

.ep-hero-search button {
    border: none;
    border-radius: var(--ep-radius-md);
    background: var(--ep-primary);
    color: var(--ep-black);
    font-weight: 700;
    padding-inline: 26px;
    cursor: pointer;
}

/* --------------------------------------------------------------- section */
.ep-section { padding-block: 48px; }
.ep-section__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.ep-section__head h2 { font-size: 1.4rem; margin: 0; }
.ep-section__head a { font-weight: 600; color: var(--ep-primary-dark); font-size: 0.9rem; }

/* --------------------------------------------------------------- grids */
.ep-grid {
    display: grid;
    /* auto-fill (not auto-fit): keeps card width consistent with the normal
       multi-result grid even when there's only one/few results (e.g. an
       exact part-number search) -- auto-fit collapses the empty tracks and
       stretches the remaining card(s) to fill the whole row. */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.ep-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.ep-scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
}
.ep-scroller > * { scroll-snap-align: start; flex: 0 0 220px; }

/* ---------------------------------------------------------- morphic card */
.ep-card {
    background: var(--ep-surface);
    border-radius: var(--ep-radius-md);
    box-shadow: var(--ep-shadow-raised);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ep-card:hover { transform: translateY(-4px); box-shadow: var(--ep-shadow-float); }

.ep-category-card {
    padding: 20px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ep-text);
}
.ep-category-card .ep-category-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    font-size: 1.4rem;
    border-radius: 50%;
    background: var(--ep-accent-light);
    color: var(--ep-accent);
}

.ep-brand-card {
    padding: 24px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 3px solid var(--ep-primary);
}

.ep-value-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ep-value-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--ep-accent-light);
    font-size: 1.2rem;
}

.ep-product-card { display: flex; flex-direction: column; overflow: hidden; }
.ep-product-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--ep-white);
    overflow: hidden;
}
.ep-carousel-link { position: absolute; inset: 0; display: grid; place-items: center; }
.ep-carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.ep-carousel-slide.is-active { opacity: 1; }

.ep-wishlist-btn {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ep-text-muted);
    box-shadow: var(--ep-shadow-raised-sm);
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}
.ep-wishlist-btn .ep-icon { width: 18px; height: 18px; }
.ep-wishlist-btn:hover { transform: scale(1.08); }
.ep-wishlist-btn.is-active { color: var(--ep-error); }
.ep-wishlist-btn.is-active .ep-icon { fill: currentColor; }

.ep-carousel-next {
    position: absolute;
    top: 50%;
    inset-inline-end: 10px;
    z-index: 2;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.85);
    color: var(--ep-text);
    box-shadow: var(--ep-shadow-raised-sm);
    cursor: pointer;
}
.ep-carousel-next .ep-icon { width: 16px; height: 16px; }
[dir="rtl"] .ep-carousel-next .ep-icon { transform: scaleX(-1); }

.ep-carousel-dots {
    position: absolute;
    bottom: 8px;
    inset-inline: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 4px;
}
.ep-carousel-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease, transform 0.2s ease;
}
.ep-carousel-dot.is-active { background: var(--ep-primary); transform: scale(1.3); }
.ep-product-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.ep-product-card__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ep-product-card__actions-row { display: flex; gap: 8px; }
.ep-btn--half { flex: 1 1 50%; min-width: 0; height: 44px; padding: 0 4px; font-size: 0.62rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-brand-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ep-text-muted); text-transform: uppercase; }
.ep-part-number { font-size: 1.05rem; font-weight: 800; color: var(--ep-text); font-variant-numeric: tabular-nums; }
.ep-product-name { font-size: 0.88rem; color: var(--ep-text-muted); line-height: 1.3; min-height: 2.4em; }
.ep-product-name--ar { min-height: 0; font-family: "Tahoma", "Segoe UI", sans-serif; text-align: right; }
/* Card: full-width box, text sits at the card's right edge. */
.ep-product-card__body .ep-product-name--ar { display: block; width: 100%; }
/* Product detail page: box shrinks to its content and stays anchored on the
   left (same column as the brand/part number above it) -- only the text
   inside reads right-to-left. */
.ep-product-title-block .ep-product-name--ar { display: inline-block; width: fit-content; max-width: 100%; }
.ep-price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.ep-price { font-weight: 800; font-size: 1.05rem; }
.ep-price--hidden { font-weight: 700; font-size: 0.9rem; font-style: italic; color: var(--ep-text-muted); }

.ep-stock-badge { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ep-stock-badge--in { background: rgba(30,142,90,0.12); color: var(--ep-success); }
.ep-stock-badge--low { background: rgba(184,134,11,0.12); color: var(--ep-warning); }
.ep-stock-badge--out { background: rgba(192,57,43,0.12); color: var(--ep-error); }

/* -------------------------------------------------------------- buttons */
.ep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--ep-radius-sm);
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    background: var(--ep-surface);
    box-shadow: var(--ep-shadow-raised-sm);
    color: var(--ep-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ep-btn:hover { transform: translateY(-2px); }
.ep-btn:active { box-shadow: var(--ep-shadow-inset); transform: translateY(0); }
.ep-btn--primary { background: var(--ep-primary); color: var(--ep-black); }
.ep-btn--block { width: 100%; }
.ep-btn--ghost { background: transparent; box-shadow: none; border: 1px solid rgba(0,0,0,0.12); }
.ep-btn--whatsapp { background: #25D366; color: #fff; padding: 0; height: 44px; min-width: 48px; }
.ep-btn--whatsapp .ep-icon { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- forms */
.ep-form-group { margin-bottom: 18px; }
.ep-form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; }
.ep-form-group input, .ep-form-group select, .ep-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--ep-radius-sm);
    border: 1px solid rgba(0,0,0,0.08);
    background: var(--ep-surface);
    box-shadow: var(--ep-shadow-inset);
    font-size: 0.92rem;
    color: var(--ep-text);
    outline: none;
}
.ep-form-group input:focus, .ep-form-group select:focus, .ep-form-group textarea:focus {
    border-color: var(--ep-primary);
    box-shadow: var(--ep-shadow-inset), 0 0 0 3px rgba(255,204,0,0.25);
}

.ep-form-card {
    max-width: 440px;
    margin: 48px auto;
    padding: 32px;
    background: var(--ep-surface);
    border-radius: var(--ep-radius-lg);
    box-shadow: var(--ep-shadow-float);
}
.ep-form-card h1 { margin-top: 0; font-size: 1.4rem; }

/* --------------------------------------------------------------- filters */
.ep-filters-panel {
    background: var(--ep-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ep-glass-border);
    border-radius: var(--ep-radius-lg);
    box-shadow: var(--ep-shadow-raised);
    padding: 20px;
    position: sticky;
    top: calc(var(--ep-header-height, 72px) + 24px);
}
.ep-filters-panel h4 { margin: 0 0 10px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ep-text-muted); }
.ep-filters-panel ul { list-style: none; padding: 0; margin: 0 0 20px; }
.ep-filters-panel li { margin-bottom: 6px; }
.ep-filters-panel a { font-size: 0.88rem; opacity: 0.85; }
.ep-filters-panel a.is-active, .ep-filters-panel a:hover { opacity: 1; color: var(--ep-primary-dark); font-weight: 700; }
.ep-filters-panel .ep-brand-more { margin: -12px 0 20px; }
.ep-filters-panel .ep-brand-more ul { margin: 8px 0 0; }
.ep-filters-panel .ep-brand-more summary {
    cursor: pointer; list-style: none; font-size: 0.82rem; font-weight: 700;
    color: var(--ep-primary-dark); user-select: none;
}
.ep-filters-panel .ep-brand-more summary::-webkit-details-marker { display: none; }
.ep-filters-panel .ep-brand-more summary::after { content: "▾"; margin-inline-start: 4px; display: inline-block; transition: transform 0.15s ease; }
.ep-filters-panel .ep-brand-more[open] summary::after { transform: rotate(180deg); }
.ep-filters-panel .ep-brand-more summary:hover { opacity: 0.75; }
.ep-filters-panel .ep-filters-toggle { display: none; }

.ep-catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }

/* ----------------------------------------------------------- pagination */
.ep-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.ep-pagination a, .ep-pagination span {
    display: grid; place-items: center; width: 36px; height: 36px;
    border-radius: 10px; background: var(--ep-surface); box-shadow: var(--ep-shadow-raised-sm);
    font-weight: 600; font-size: 0.85rem;
}
.ep-pagination .is-current { background: var(--ep-primary); color: var(--ep-black); }

/* ---------------------------------------------------- admin pagination bar */
.ep-admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 14px 20px;
    background: var(--ep-surface);
    border-radius: var(--ep-radius-md);
    box-shadow: var(--ep-shadow-raised-sm);
}
.ep-admin-pagination__info { font-weight: 600; font-size: 0.88rem; color: var(--ep-text-muted); }
.ep-admin-pagination__nav { display: flex; align-items: center; gap: 14px; }
.ep-admin-pagination .ep-btn[aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
    box-shadow: none;
}
.ep-admin-pagination__jump { display: flex; gap: 8px; align-items: center; }
.ep-admin-pagination__jump input[type="number"] {
    width: 72px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--ep-radius-sm);
    background: var(--ep-background);
    box-shadow: var(--ep-shadow-inset);
    text-align: center;
    font-size: 0.85rem;
    color: var(--ep-text);
}
.ep-admin-pagination__jump input[type="number"]:focus {
    outline: none;
    box-shadow: var(--ep-shadow-inset), 0 0 0 3px rgba(255, 204, 0, 0.25);
}

/* ------------------------------------------------------------- filter bar */
.ep-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.ep-filter-pills { display: flex; gap: 8px; }
.ep-filter-pill {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--ep-surface);
    box-shadow: var(--ep-shadow-raised-sm);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ep-text-muted);
    transition: box-shadow 0.15s ease, color 0.15s ease;
}
.ep-filter-pill:hover { color: var(--ep-text); }
.ep-filter-pill.is-active { background: var(--ep-primary); color: var(--ep-black); box-shadow: none; }

.ep-filter-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ep-filter-spacer { margin-inline-start: auto; }

/* ------------------------------------------------------ checkbox filter dropdown */
.ep-dropdown-filter { position: relative; }
.ep-dropdown-filter__panel {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    z-index: 40;
    min-width: 260px;
    background: var(--ep-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ep-glass-border);
    border-radius: var(--ep-radius-md);
    box-shadow: var(--ep-shadow-float);
    padding: 12px;
}
.ep-dropdown-filter__list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ep-dropdown-filter__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--ep-radius-sm);
    font-size: 0.88rem;
    cursor: pointer;
}
.ep-dropdown-filter__option:hover { background: rgba(255, 204, 0, 0.14); }
.ep-dropdown-filter__option input { cursor: pointer; }
.ep-dropdown-filter__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------- toggle switch */
.ep-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.ep-toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.ep-toggle-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}
.ep-toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.16);
    border-radius: 999px;
    box-shadow: var(--ep-shadow-inset);
    transition: background 0.2s ease;
}
.ep-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ep-white);
    box-shadow: var(--ep-shadow-raised-sm);
    transition: transform 0.2s ease;
}
.ep-toggle-switch input:checked ~ .ep-toggle-track { background: var(--ep-primary); }
.ep-toggle-switch input:checked ~ .ep-toggle-track .ep-toggle-thumb { transform: translateX(20px); }
.ep-toggle-label { font-weight: 600; font-size: 0.85rem; }

/* ------------------------------------------------------------ empty state */
.ep-empty-state { text-align: center; padding: 64px 20px; color: var(--ep-text-muted); }
.ep-empty-state .ep-empty-icon { font-size: 2.4rem; margin-bottom: 12px; }

/* ------------------------------------------------------------- product pg */
.ep-product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.ep-gallery-main {
    position: relative;
    aspect-ratio: 1;
    max-width: 380px;
    margin-inline: auto;
    background: var(--ep-white);
    border-radius: var(--ep-radius-lg);
    box-shadow: var(--ep-shadow-raised);
    display: grid; place-items: center; overflow: hidden; margin-bottom: 12px;
}
.ep-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.ep-gallery-thumbs { display: flex; gap: 10px; max-width: 380px; margin-inline: auto; }
.ep-gallery-thumbs img {
    width: 64px; height: 64px; object-fit: contain; background: var(--ep-white);
    border-radius: var(--ep-radius-sm); box-shadow: var(--ep-shadow-raised-sm); padding: 4px; cursor: pointer;
}

.ep-product-title-block { padding: 24px; background: var(--ep-surface); border-radius: var(--ep-radius-lg); box-shadow: var(--ep-shadow-raised); }
.ep-product-title-block .ep-part-number { font-size: 1.6rem; }

.ep-product-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.ep-product-actions-row { display: flex; gap: 10px; }
.ep-product-actions-row .ep-btn--primary { flex: 1 1 auto; min-width: 0; }
.ep-product-actions-row .ep-btn--whatsapp { flex: 0 0 52px; }
.ep-product-title-block .ep-price { font-size: 1.8rem; color: var(--ep-primary-dark); }

.ep-info-tabs { margin-top: 40px; }
.ep-info-section { padding: 20px 0; border-top: 1px solid rgba(0,0,0,0.08); }
.ep-info-section h3 { margin: 0 0 12px; font-size: 1.05rem; }
.ep-spec-table { width: 100%; border-collapse: collapse; }
.ep-spec-table td { padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 0.9rem; }
.ep-spec-table td:first-child { color: var(--ep-text-muted); width: 40%; }

.ep-xref-tag { display: inline-block; margin: 4px 6px 4px 0; padding: 6px 12px; background: var(--ep-surface); box-shadow: var(--ep-shadow-raised-sm); border-radius: 999px; font-weight: 700; font-size: 0.85rem; }

/* card-grid spec panel (alternative part numbers, additional information) --
   raised surface cards rather than a plain label/value table, to match the
   neumorphic language used across the rest of the storefront (buttons,
   badges) instead of looking like a bare data dump. */
.ep-spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ep-spec-grid__item {
    background: var(--ep-surface);
    border-radius: var(--ep-radius-sm);
    box-shadow: var(--ep-shadow-raised-sm);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ep-spec-grid__label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ep-text-muted); }
.ep-spec-grid__value { font-size: 1rem; font-weight: 700; color: var(--ep-text); word-break: break-word; }

/* ------------------------------------------------------------------ footer */
.ep-footer { background: var(--ep-charcoal); color: rgba(255,255,255,0.75); padding-block: 40px 20px; margin-top: 60px; }
.ep-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; padding-bottom: 24px; }
.ep-footer__logo { background: #fff; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; }
.ep-footer h4 { color: var(--ep-white); font-size: 0.9rem; margin: 0 0 10px; }
.ep-footer a { display: block; opacity: 0.75; font-size: 0.88rem; margin-bottom: 6px; }
.ep-footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; font-size: 0.8rem; text-align: center; }

/* --------------------------------------------------------- responsive */
@media (max-width: 900px) {
    .ep-header__inner { flex-wrap: wrap; }
    .ep-nav { order: 3; width: 100%; overflow-x: auto; }
    .ep-search { order: 2; max-width: none; }
    .ep-catalog-layout, .ep-product-layout { grid-template-columns: 1fr; }

    .ep-filters-panel { position: static; padding: 14px 18px; }
    .ep-filters-panel .ep-filters-toggle {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; background: none; border: none; padding: 0;
        font-size: 0.95rem; font-weight: 700; color: inherit;
        font-family: inherit; cursor: pointer;
    }
    .ep-filters-panel .ep-filters-toggle__icon { transition: transform 0.15s ease; }
    .ep-filters-panel.is-open .ep-filters-toggle__icon { transform: rotate(180deg); }
    .ep-filters-panel .ep-filters-body { display: none; padding-top: 16px; }
    .ep-filters-panel.is-open .ep-filters-body { display: block; }
}

/* --------------------------------------------------------- autocomplete */
.ep-autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 0;
    background: var(--ep-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--ep-glass-border);
    border-radius: var(--ep-radius-md);
    box-shadow: var(--ep-shadow-float);
    overflow: hidden;
    z-index: 60;
}
.ep-autocomplete a {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 10px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ep-autocomplete a:hover { background: rgba(255,204,0,0.12); }
.ep-autocomplete a span { margin-inline-start: auto; color: var(--ep-text-muted); font-size: 0.78rem; }

/* ------------------------------------------------------------------ modal */
.ep-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(20, 20, 20, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 20px;
    /* the global `[hidden] { display: none !important; }` rule (see top of
       file) takes care of hiding this correctly despite `display: grid` here */
}
.ep-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--ep-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--ep-glass-border);
    border-radius: var(--ep-radius-lg);
    box-shadow: var(--ep-shadow-float);
    padding: 24px;
}
.ep-modal__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ep-modal__header h3 { margin: 0; font-size: 1.2rem; }
.ep-modal__close {
    background: var(--ep-surface);
    box-shadow: var(--ep-shadow-raised-sm);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.ep-modal__footer { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* small centered notice/confirm modal (e.g. the publish price guard) --
   reuses .ep-modal's glass/neumorphic shell, just without the header row. */
.ep-price-guard { max-width: 420px; text-align: center; position: relative; padding-top: 36px; }
.ep-price-guard .ep-modal__close { position: absolute; top: 16px; inset-inline-end: 16px; }
.ep-price-guard__icon {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.8rem;
    background: linear-gradient(145deg, #ffe1c2, #ffb15e);
    box-shadow: var(--ep-shadow-raised-sm);
}
.ep-price-guard__icon--block { background: linear-gradient(145deg, #ffd0cc, #ff8a80); }
.ep-price-guard__title { margin: 0 0 10px; font-size: 1.15rem; }
.ep-price-guard__message { margin: 0; color: var(--ep-text-muted); font-size: 0.92rem; line-height: 1.55; }

/* "Request a Quotation" multi-step modal */
.ep-field-label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; }
.ep-field-input {
    width: 100%; padding: 12px 14px; border-radius: 12px; border: none;
    background: var(--ep-background); box-shadow: var(--ep-shadow-inset); font-size: 0.95rem;
}
.ep-field-input:focus { outline: 2px solid var(--ep-primary); outline-offset: 1px; }
.ep-phone-input { display: flex; gap: 8px; }
.ep-phone-input select {
    flex: 0 0 auto; border: none; border-radius: 12px; background: var(--ep-background);
    box-shadow: var(--ep-shadow-inset); padding: 12px 8px; font-size: 0.9rem; font-weight: 700;
}
.ep-phone-input input { flex: 1 1 auto; }
.ep-modal--wide {
    max-width: 1040px;
    max-height: 94vh;
    padding: 20px 24px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* old Edge/IE */
}
.ep-modal--wide::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.ep-modal--wide .ep-spec-table td { padding: 5px 0; font-size: 0.85rem; }
.ep-modal--wide h4 { margin: 12px 0 6px; }
.ep-modal--wide .ep-modal__header { margin-bottom: 10px; }

/* gallery beside the overview table instead of stacked above it -- with a
   wide modal there's horizontal room to spare, and this is what actually
   buys back the vertical space that stacking was spending. */
.ep-modal-top-row { display: flex; gap: 24px; align-items: flex-start; }
.ep-modal-top-row .ep-modal-gallery { margin-bottom: 0; flex: 0 0 auto; padding: 0 40px; }
.ep-modal-top-row .ep-modal-gallery img { max-width: 150px; max-height: 150px; }
.ep-modal-top-row .ep-spec-table { flex: 1 1 auto; }

.ep-alt-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 16px; }
.ep-alt-grid__item { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 0.88rem; }
.ep-alt-grid__label { color: var(--ep-text-muted); }
.ep-alt-grid__value { font-weight: 600; }
@media (max-width: 640px) {
    .ep-alt-grid { grid-template-columns: repeat(2, 1fr); }
}

.ep-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 24px; }
.ep-info-grid__item { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.ep-info-grid__label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ep-text-muted); }
.ep-info-grid__value { font-size: 0.9rem; font-weight: 600; word-break: break-word; }
@media (max-width: 900px) {
    .ep-modal-top-row { flex-direction: column; }
    .ep-alt-grid { grid-template-columns: repeat(3, 1fr); }
    .ep-info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .ep-alt-grid { grid-template-columns: repeat(2, 1fr); }
    .ep-info-grid { grid-template-columns: 1fr; }
}
.ep-clickable-row { cursor: pointer; }
.ep-clickable-row:hover { background: rgba(255, 204, 0, 0.08); }

/* ------------------------------------------------------------ modal gallery */
.ep-modal-gallery {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 12px 48px;
}
.ep-modal-gallery img {
    max-width: 220px;
    max-height: 220px;
    border-radius: 12px;
    background: var(--ep-white);
    box-shadow: var(--ep-shadow-raised-sm);
    object-fit: contain;
}
.ep-modal-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--ep-surface);
    box-shadow: var(--ep-shadow-raised-sm);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ep-modal-gallery__arrow:hover { transform: translateY(-50%) scale(1.08); }
.ep-modal-gallery__arrow--prev { inset-inline-start: 0; }
.ep-modal-gallery__arrow--next { inset-inline-end: 0; }
.ep-modal-gallery__count {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ep-text-muted);
}

/* logical-property note: margin-inline-start/padding-inline-end used
   throughout instead of left/right so RTL (Arabic) flips automatically */

/* Keep Arabic glyphs connected and technical identifiers readable in RTL. */
html[lang="ar"] body { font-family: "Noto Sans Arabic", Tahoma, Arial, sans-serif; }
html[lang="ar"] * { letter-spacing: normal; }
input[type="tel"], input[type="email"], .ep-part-number { direction: ltr; unicode-bidi: isolate; }
