/* Frentcher — premium furniture storefront + admin */

:root {
    --color-wood: #5c4033;
    --color-wood-light: #7d5a47;
    --color-beige: #e8dfd4;
    --color-beige-dark: #d4c9bb;
    --color-gray: #2d2a28;
    --color-gray-mid: #4a4540;
    --color-gold: #c9a227;
    --color-gold-soft: #e8d48a;
    --font-ar: "Cairo", system-ui, sans-serif;
    --font-en: "Manrope", "Segoe UI", sans-serif;
    --radius: 12px;
    --shadow: 0 12px 40px rgba(45, 42, 40, 0.12);
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --color-bg: #1a1816;
    --color-surface: #252220;
    --color-text: #f0ebe5;
    --color-muted: #a89f94;
    --color-border: #3d3834;
}

[data-theme="light"] {
    --color-bg: #f7f4ef;
    --color-surface: #ffffff;
    --color-text: #2d2a28;
    --color-muted: #6b6560;
    --color-border: #e0d8ce;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-en);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

.lang-ar body {
    font-family: var(--font-ar);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-wood);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-gold);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    top: -100px;
    background: var(--color-gold);
    color: var(--color-gray);
    padding: 0.5rem 1rem;
    z-index: 10000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 1rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.85rem;
    flex-wrap: wrap;
}

[dir="rtl"] .header-inner {
    flex-direction: row-reverse;
}

.logo {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--color-wood);
    letter-spacing: 0.02em;
}

.logo-img {
    object-fit: contain;
    max-height: 40px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-btn {
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    color: var(--color-muted);
}

.lang-btn.active {
    background: var(--color-beige);
    color: var(--color-wood);
}

.icon-btn {
    border: none;
    background: var(--color-beige);
    color: var(--color-wood);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform var(--transition), background var(--transition);
}

.icon-btn:hover {
    transform: scale(1.05);
    background: var(--color-gold-soft);
}

[data-theme="dark"] .icon-btn {
    background: var(--color-gray-mid);
    color: var(--color-beige);
}

.theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-icon-moon {
    display: inline;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
}

.main-nav {
    padding-bottom: 0.75rem;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
}

[dir="rtl"] .nav-list {
    flex-direction: row-reverse;
}

.nav-list a {
    font-weight: 600;
    color: var(--color-text);
}

.badge {
    background: var(--color-gold);
    color: var(--color-gray);
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    margin-inline-start: 0.25rem;
}

.main-content {
    min-height: 60vh;
    padding-bottom: 5rem;
}

/* Hero */
.hero-slider {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
}

.hero-slides {
    position: relative;
    min-height: 72vh;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s;
    background-image: var(--hero-img);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(45, 42, 40, 0.75) 0%, rgba(45, 42, 40, 0.35) 55%, transparent 100%);
}

[dir="rtl"] .hero-overlay {
    background: linear-gradient(-105deg, rgba(45, 42, 40, 0.75) 0%, rgba(45, 42, 40, 0.35) 55%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 36rem;
    color: #fff;
    padding-block: 3rem;
}

.hero-content h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin: 0 0 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero-sub {
    font-size: 1.05rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.hero-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.hero-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity var(--transition), transform var(--transition);
}

.hero-dots button.active {
    opacity: 1;
    background: var(--color-gold);
    border-color: var(--color-gold);
    transform: scale(1.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--color-gold) 0%, #a88620 100%);
    color: var(--color-gray);
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.35);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-wood);
    border: 2px solid var(--color-wood);
}

.btn-ghost {
    background: transparent;
    color: var(--color-wood);
    border: 2px solid var(--color-border);
}

.btn-block {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: #c44;
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
}

/* Sections */
.section {
    padding-block: 3.5rem;
}

.section-title {
    font-size: 1.75rem;
    margin: 0;
    color: var(--color-wood);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.link-all {
    font-weight: 600;
    color: var(--color-gold);
}

.trust-strip {
    background: var(--color-surface);
    border-block: 1px solid var(--color-border);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    text-align: center;
    padding-block: 0.5rem;
}

.trust-item h3 {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
}

.trust-ic {
    font-size: 1.5rem;
    color: var(--color-gold);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}

.product-card:hover {
    box-shadow: 0 20px 50px rgba(45, 42, 40, 0.15);
}

.product-card-link {
    color: inherit;
    display: block;
    padding: 0;
}

.product-img-wrap {
    aspect-ratio: 5/4;
    overflow: hidden;
    background: var(--color-beige);
    position: relative;
}

.img-zoom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card-hover:hover .img-zoom img,
.img-zoom:hover img {
    transform: scale(1.06);
}

.badge-offer {
    position: absolute;
    top: 0.75rem;
    inset-inline-end: 0.75rem;
    background: var(--color-gold);
    color: var(--color-gray);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.product-title {
    padding: 1rem 1rem 0;
    margin: 0;
    font-size: 1.05rem;
}

.product-price-row {
    padding: 0.35rem 1rem 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.price {
    font-weight: 700;
    color: var(--color-wood);
    font-size: 1.1rem;
}

.price-old {
    text-decoration: line-through;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.price-lg {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-wood);
}

.product-card .btn {
    margin: 0 1rem 1rem;
    width: calc(100% - 2rem);
}

/* Why / CTA */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.why-list {
    padding-inline-start: 1.25rem;
    color: var(--color-muted);
}

.why-visual img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cta-section {
    background: linear-gradient(135deg, var(--color-wood) 0%, var(--color-gray) 100%);
    color: #f5f0e8;
    text-align: center;
}

.cta-inner {
    max-width: 640px;
    margin-inline: auto;
}

.cta-inner .btn-gold {
    margin-top: 1rem;
}

/* Products page */
.page-head {
    padding-block: 2rem 1rem;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    color: var(--color-wood);
}

.products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
}

.filters-sidebar {
    align-self: start;
    position: sticky;
    top: 5.5rem;
}

.filters-form {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.filters-form label {
    display: block;
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.filters-form input,
.filters-form select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.empty-msg {
    color: var(--color-muted);
    padding: 2rem 0;
}

/* Product detail */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.breadcrumb a {
    color: var(--color-muted);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 3rem;
}

.gallery-main {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-beige);
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.gallery-thumbs .thumb {
    border: 2px solid transparent;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    opacity: 0.75;
    transition: opacity var(--transition), border-color var(--transition);
}

.gallery-thumbs .thumb.active,
.gallery-thumbs .thumb:hover {
    opacity: 1;
    border-color: var(--color-gold);
}

.gallery-thumbs img {
    width: 72px;
    height: 56px;
    object-fit: cover;
}

.product-meta {
    color: var(--color-muted);
}

.product-price-block {
    margin: 1rem 0;
}

.product-actions-row {
    margin-bottom: 1.5rem;
}

.rte {
    color: var(--color-muted);
    line-height: 1.75;
}

/* Cart */
.cart-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.cart-table th,
.cart-table td {
    padding: 0.85rem 1rem;
    text-align: start;
    border-bottom: 1px solid var(--color-border);
}

.qty-input {
    width: 4rem;
    padding: 0.35rem;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
}

.cart-summary {
    max-width: 320px;
    margin-inline-start: auto;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    padding-bottom: 3rem;
}

.checkout-form label {
    display: block;
    margin-top: 0.75rem;
    font-weight: 600;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

.checkout-summary {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    align-self: start;
    position: sticky;
    top: 5.5rem;
}

.mini-cart-list {
    margin: 0;
    padding-inline-start: 1.1rem;
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* Auth */
.auth-page {
    max-width: 420px;
    margin: 2rem auto 4rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    font-weight: 700;
    color: var(--color-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: var(--color-wood);
    border-bottom-color: var(--color-gold);
}

.auth-form label {
    display: block;
    margin-top: 0.75rem;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

.form-error {
    background: #fde8e8;
    color: #a21;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

[data-theme="dark"] .form-error {
    background: #3d2222;
    color: #f5a0a0;
}

.flash-success {
    background: #e8f5e9;
    color: #1b5e20;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Orders */
.orders-table-wrap {
    overflow-x: auto;
    margin-bottom: 3rem;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.orders-table th,
.orders-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: start;
}

/* Thank you */
.thank-you-page {
    padding: 4rem 1rem;
    text-align: center;
}

.thank-you-inner {
    max-width: 480px;
    margin-inline: auto;
}

.thank-you-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Footer */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding-bottom: 4.5rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding-block: 2rem;
}

.footer-copy {
    padding-block: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-muted);
}

.footer-bar-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    z-index: 900;
    justify-content: space-around;
    align-items: center;
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
}

.footer-bar-mobile a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.65rem;
    color: var(--color-muted);
    padding: 0.25rem;
    flex: 1;
    text-align: center;
}

.footer-bar-mobile a:hover {
    color: var(--color-wood);
}

.fb-icon {
    font-size: 1.1rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.9s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.slide-up {
    animation: slideUp 0.7s ease forwards;
    opacity: 0;
}

.slide-up:nth-child(1) {
    animation-delay: 0.05s;
}
.slide-up:nth-child(2) {
    animation-delay: 0.12s;
}
.slide-up:nth-child(3) {
    animation-delay: 0.19s;
}
.slide-up:nth-child(4) {
    animation-delay: 0.26s;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    transform: translateY(16px);
}

.parallax-wrap {
    perspective: 1px;
}

.parallax-slow {
    transition: transform 0.15s ease-out;
}

/* Admin */
.admin-body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
}

.admin-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--color-gray);
    color: #f0ebe5;
    padding: 1.25rem;
}

.admin-logo {
    display: block;
    font-weight: 800;
    color: var(--color-gold);
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-nav a {
    color: #d4ccc0;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-main {
    display: flex;
    flex-direction: column;
}

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.admin-top h1 {
    margin: 0;
    font-size: 1.25rem;
}

.admin-top-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.admin-content {
    flex: 1;
    padding-block: 1.5rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0.25rem 0 0;
    color: var(--color-wood);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
}

.admin-table th,
.admin-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    text-align: start;
}

.admin-form label {
    display: block;
    margin-top: 0.65rem;
    font-weight: 600;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    max-width: 520px;
    padding: 0.5rem 0.65rem;
    margin-top: 0.2rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

.admin-form .chk {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.admin-form .chk input {
    width: auto;
}

.inline-form {
    display: inline;
}

.admin-msg {
    background: #e8f5e9;
    color: #1b5e20;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.admin-img-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-img-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--color-beige) 0%, var(--color-bg) 50%, var(--color-beige-dark) 100%);
    padding: 1rem;
}

.admin-login-card {
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
}

.admin-login-lang {
    text-align: end;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.admin-login-lang a {
    color: var(--color-wood);
}

.admin-login-card h1 {
    margin-top: 0;
    color: var(--color-wood);
}

.admin-login-card label {
    display: block;
    margin-top: 0.75rem;
    font-weight: 600;
}

.admin-login-card input {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font: inherit;
}

.admin-login-hint {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.admin-hint {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.admin-order-head p {
    margin: 0.35rem 0;
}

/* Admin mobile app-style bottom nav */
.admin-body {
    --admin-tabbar-h: 0px;
    --admin-tabbar-safe: env(safe-area-inset-bottom, 0px);
}

.admin-bottom-nav {
    display: none;
}

.admin-top-mobile-quick {
    display: none;
    align-items: center;
    gap: 0.35rem;
    margin-inline-end: 0.25rem;
}

.admin-top-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--color-beige);
    color: var(--color-wood);
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.2s, transform 0.15s;
}

.admin-top-icon-btn:active {
    transform: scale(0.94);
}

[data-theme="dark"] .admin-top-icon-btn {
    background: var(--color-gray-mid);
    color: var(--color-beige);
}

.admin-bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    padding: 0.4rem 0.15rem 0.35rem;
    margin: 0;
    text-decoration: none;
    color: var(--color-muted);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.1;
    text-align: center;
    border-radius: 12px;
    transition: color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    position: relative;
}

.admin-bnav-item:active {
    transform: scale(0.96);
}

.admin-bnav-item.is-active {
    color: var(--color-wood);
}

[data-theme="dark"] .admin-bnav-item.is-active {
    color: var(--color-gold);
}

.admin-bnav-item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--color-gold);
    box-shadow: 0 1px 8px rgba(201, 162, 39, 0.45);
}

.admin-bnav-ic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: inherit;
    opacity: 0.72;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-bnav-item.is-active .admin-bnav-ic {
    opacity: 1;
    transform: translateY(-1px);
}

.admin-bnav-svg {
    width: 24px;
    height: 24px;
    display: block;
}

.admin-bnav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-inline: 1px;
}

/* Mobile */
@media (max-width: 900px) {
    .two-col,
    .product-detail-grid,
    .products-layout,
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }

    .checkout-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        padding-bottom: 1rem;
    }

    .main-nav.is-open {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
    }

    /* Mobile UX: theme left, logo right in RTL */
    [dir="rtl"] .header-inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas: "theme logo actions";
        align-items: center;
    }

    [dir="rtl"] .header-theme {
        grid-area: theme;
        justify-self: start;
    }

    [dir="rtl"] .logo {
        grid-area: logo;
        justify-self: end;
        text-align: end;
    }

    [dir="rtl"] .header-actions {
        grid-area: actions;
        justify-self: end;
    }

    [dir="ltr"] .header-inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas: "theme logo actions";
    }

    [dir="ltr"] .header-theme {
        grid-area: theme;
        justify-self: start;
    }

    [dir="ltr"] .logo {
        grid-area: logo;
        justify-self: center;
    }

    [dir="ltr"] .header-actions {
        grid-area: actions;
        justify-self: end;
    }

    .footer-bar-mobile {
        display: flex;
    }

    .footer-main {
        grid-template-columns: 1fr;
        padding-bottom: 0.5rem;
    }

    /* App shell: document does not scroll — only .admin-content scrolls; tab bar stays put */
    html.admin-html {
        height: 100%;
        overflow: hidden;
    }

    html.admin-html body.admin-body {
        height: 100%;
        max-height: 100dvh;
        max-height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0;
    }

    .admin-shell {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .admin-sidebar {
        display: none !important;
    }

    .admin-main {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .admin-top {
        flex-shrink: 0;
    }

    .admin-body {
        --admin-tabbar-h: 56px;
    }

    .admin-body .admin-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: calc(var(--admin-tabbar-h) + var(--admin-tabbar-safe) + 1.15rem);
    }

    .admin-top-mobile-quick {
        display: flex;
    }

    .admin-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        inset-inline: 0;
        width: 100%;
        max-width: 100vw;
        transform: translate3d(0, 0, 0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        z-index: 10050;
        align-items: stretch;
        justify-content: space-between;
        margin: 0;
        padding: 0;
        padding-bottom: var(--admin-tabbar-safe);
        min-height: calc(var(--admin-tabbar-h) + var(--admin-tabbar-safe));
        box-sizing: border-box;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        box-shadow:
            0 -1px 0 rgba(0, 0, 0, 0.04),
            0 -10px 40px rgba(45, 42, 40, 0.1);
    }

    [data-theme="dark"] .admin-bottom-nav {
        box-shadow:
            0 -1px 0 rgba(255, 255, 255, 0.06),
            0 -12px 48px rgba(0, 0, 0, 0.45);
    }

    @supports (backdrop-filter: blur(12px)) {
        .admin-bottom-nav {
            background: color-mix(in srgb, var(--color-surface) 86%, transparent);
            backdrop-filter: blur(18px) saturate(1.35);
            -webkit-backdrop-filter: blur(18px) saturate(1.35);
        }

        [data-theme="dark"] .admin-bottom-nav {
            background: color-mix(in srgb, var(--color-surface) 90%, transparent);
        }
    }

    .admin-top h1 {
        font-size: 1.05rem;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-top-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.35rem;
    }
}
