/* Shared Engiz web colors: Mint for actions, Night neutrals for surfaces and text. */

:root {
    --primary: #007C56;
    --on-primary: #FFFFFF;
    --glass-surface: #FFFFFF;
    --glass-border: #D4DBE7;
    --glass-glow: rgba(0, 124, 86, 0.2);
    --success: #007C56;
    --bg-start: #F1F3F6;
    --bg-end: #F2F7FF;
    --text: #0E1116;
    --text-muted: #555B65;
    --surface-solid: #FFFFFF;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #34E0A1;
        --on-primary: #0B1512;
        --glass-surface: #181E29;
        --glass-border: #282E39;
        --glass-glow: rgba(52, 224, 161, 0.2);
        --success: #34E0A1;
        --bg-start: #0E1116;
        --bg-end: #181E29;
        --text: #F2F7FF;
        --text-muted: #B7BECA;
        --surface-solid: #181E29;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Segoe UI", "Tajawal", "Cairo", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: linear-gradient(160deg, var(--bg-start), var(--bg-end));
    background-attachment: fixed;
    line-height: 1.6;
}

[dir="rtl"] body { font-family: "Tajawal", "Cairo", "Segoe UI", system-ui, sans-serif; }

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md) var(--space-xl);
}

/* --- Header --- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    background: #0B1512;
    border-radius: 12px;
}

.brand-icon img { width: 32px; height: 27px; }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-install, .header-coming-soon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.header-actions svg { width: 15px; height: 15px; flex: none; }

.header-install {
    color: var(--on-primary);
    background: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.header-coming-soon {
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    cursor: not-allowed;
}

.header-install:focus-visible, .lang-toggle:focus-visible, .brand:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.brand-mark {
    color: var(--primary);
}

.lang-toggle {
    border: 1px solid var(--glass-border);
    background: var(--glass-surface);
    backdrop-filter: none;
    color: var(--text);
    border-radius: 999px;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.85rem;
    cursor: pointer;
}

/* --- Glass surface --- */
.glass-card {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--glass-glow);
    transition: transform 120ms ease;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

/* --- Store header --- */
.store-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 5vw, 48px);
    background: var(--surface-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
}
.store-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: var(--primary);
}
.store-identity {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}
.store-identity > div { min-width: 0; }
.store-eyebrow {
    margin: 0 0 var(--space-xs);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}
.store-address, .store-description {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}
.store-address { margin: var(--space-xs) 0 0; }
.store-description { max-width: 60ch; margin: var(--space-lg) 0; white-space: pre-line; }
.store-hero .btn-primary { margin-top: var(--space-lg); }
.store-section-heading { margin-top: var(--space-xl); }
.store-section-heading h2 { margin: 0; font-size: 1.35rem; }
.store-empty {
    grid-column: 1 / -1;
    background: var(--surface-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
.store-state {
    min-height: 240px;
    display: grid;
    place-items: center;
    background: var(--surface-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.store-logo {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    object-fit: cover;
    border: 3px solid var(--surface-solid);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    flex: none;
    background: var(--surface-solid);
}
.store-logo-placeholder {
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 2rem;
}

.store-name { font-size: clamp(1.65rem, 4vw, 2.5rem); line-height: 1.2; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.store-meta { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 var(--space-md); }
.store-rating { color: var(--success); font-weight: 700; }

/* --- Product grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.product-card {
    background: var(--surface-solid);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 150ms ease;
    border: 1px solid var(--glass-border);
}
.product-card:hover { transform: translateY(-2px); }

.product-card-media {
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    background: var(--bg-start);
    color: var(--primary);
    font-size: 2rem;
}
.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-body { padding: var(--space-sm) var(--space-md) var(--space-md); }
.product-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-price { color: var(--success); font-weight: 700; font-size: 0.95rem; }
.product-card-ask-price { color: var(--text-muted); font-size: 0.85rem; }

/* --- Product detail page --- */
.product-detail > .btn-secondary { display: inline-flex; margin-bottom: var(--space-lg); }
.product-detail-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-xl); align-items: start; }
.product-detail-layout.without-gallery { grid-template-columns: 1fr; }
.product-detail-info h1 { margin: 0; overflow-wrap: anywhere; line-height: 1.25; }
.product-detail-info p { overflow-wrap: anywhere; }
.product-detail-info .btn-primary { display: inline-flex; margin-top: var(--space-md); }
.product-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.product-gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--surface-solid);
    border: 1px solid var(--glass-border);
}
.product-gallery img:first-child { grid-column: 1 / -1; border-radius: var(--radius-lg); }
.product-state { background: var(--surface-solid); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); margin-top: var(--space-lg); }

.price-line { font-size: 1.4rem; font-weight: 800; color: var(--success); margin: var(--space-md) 0; }

/* --- Static content pages (privacy/contact/etc) --- */
.content-page h1 { font-size: 1.6rem; margin-bottom: var(--space-lg); }
.content-page h2 { font-size: 1.2rem; margin-top: var(--space-xl); }
.content-page p, .content-page li { color: var(--text-muted); }

/* --- Empty / loading / error states --- */
.state-message {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--text-muted);
}

.skeleton {
    background: linear-gradient(90deg, var(--glass-surface) 25%, var(--glass-border) 50%, var(--glass-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-md);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

footer {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
}
footer a { text-decoration: underline; }

@media (max-width: 700px) {
    .product-detail-layout { grid-template-columns: 1fr; gap: var(--space-lg); }
    .product-detail-info .btn-primary { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .store-identity { align-items: flex-start; gap: var(--space-md); }
    .store-logo { width: 64px; height: 64px; border-radius: 16px; }
    .store-hero .btn-primary { width: 100%; }
    .site-header { flex-wrap: wrap; padding: var(--space-sm); }
    .header-actions { width: 100%; justify-content: space-between; gap: 4px; }
    .header-install, .header-coming-soon, .lang-toggle { font-size: 0.72rem; padding: 4px 8px; }
    .container { padding: var(--space-md) var(--space-sm) var(--space-xl); }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
