:root {
    --bg: #F5F2ED;
    --accent: #9A8272; /* The Brown Color from your image */
    --text: #333333;
    --white: #ffffff;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Kill the browser blue tap-flash on all interactive elements ── */
a, button, input, select, textarea, label, summary,
[onclick], [role="button"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-focus-ring-color: transparent;
}

a, button, [role="button"] {
    -webkit-tap-highlight-color: transparent;
}
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* --- Navigation & Search --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 20px; }

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: var(--accent);
    cursor: pointer;
}

.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }

.logo { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 500; }

.nav-icons { display: flex; align-items: center; gap: 15px; }

.search-container { display: flex; align-items: center; position: relative; }
.search-input {
    width: 0;
    border: none;
    outline: none;
    background: transparent;
    border-bottom: 1px solid var(--accent);
    transition: var(--transition);
    opacity: 0;
    padding: 5px;
}
.search-input.active { width: 150px; opacity: 1; margin-right: 10px; }

.btn-signup {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 8px 18px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}
.btn-signup:hover { background: #7d6a5c; color: #fff; }

/* Logout styling */
.btn-signup.desktop-only.logout-btn {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
    padding:6px 6px;
    width:44px;
    border-radius:6px;
    background: transparent;
    border: none !important;
    box-shadow: none;
    cursor: pointer;
}
.btn-signup.desktop-only.logout-btn i {
    color: #d9534f;
    font-size:1.25rem;
    line-height:1;
    transition: color 0.18s ease;
}
.logout-label { display: none; }
.btn-signup.desktop-only.logout-btn .logout-label {
    font-size:0.72rem;
    color:#d9534f;
    font-weight:600;
    display:block;
    text-align:center;
    transition: color 0.18s ease;
}

/* Mobile menu: keep logout at bottom */
.mobile-menu-content { display:flex; flex-direction:column; height:100%; }
.mobile-menu-content .mobile-links { margin-top:18px; }
.mobile-menu-content .logout-mobile { margin-top:auto; padding:16px 20px; border-top:1px solid #eee; display:flex; justify-content:center; }
.mobile-menu-content .logout-mobile a { color:#d9534f; text-decoration:none; display:flex; flex-direction:column; align-items:center; gap:6px; }
.mobile-menu-content .logout-mobile a i { font-size:1.2rem; }
.mobile-menu-content .logout-mobile a span { font-size:0.95rem; color:#d9534f; }

/* --- Mobile Menu --- */
.mobile-overlay {
    position: fixed;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--bg);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}
.mobile-overlay.active { left: 0; }
.mobile-links { list-style: none; text-align: center; }
.mobile-links li { margin: 25px 0; }
.mobile-links a { font-size: 1.5rem; text-decoration: none; color: var(--text); font-family: 'Playfair Display', serif; }
.close-menu { position: absolute; top: 30px; right: 30px; font-size: 2rem; color: var(--accent); }

/* --- Hero --- */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('https://images.unsplash.com/photo-1590439471364-192aa70c0b53?auto=format&fit=crop&q=80&w=1600');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}
.hero-content h1 { font-family: 'Playfair Display', serif; font-size: 4rem; margin-bottom: 1rem; }
.btn-shop { background: var(--accent); color: white; padding: 15px 40px; text-decoration: none; display: inline-block; margin-top: 20px; }

/* --- Products --- */
.container { padding: 80px 5%; }
.section-title { text-align: center; font-family: 'Playfair Display', serif; margin-bottom: 50px; font-size: 2.2rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }

.img-wrapper {
    position: relative;
    overflow: visible;
    height: 400px;
    background: white;
    cursor: pointer;
}
.img-wrapper img { width: 100%; height: 100%; object-fit: contain; overflow: hidden; display: block; }

.card-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(245, 242, 237, 0.88);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 12px; opacity: 0; transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 2;
}
/* Desktop hover reveal */
.product-card:hover .card-overlay {
    opacity: 1;
    pointer-events: auto;
}
/* Mobile: always show overlay so all buttons are tappable without hover */
@media (hover: none) {
    .card-overlay {
        opacity: 1;
        pointer-events: auto;
        background: rgba(245, 242, 237, 0.82);
    }
}

/* img-wrapper-link: makes the card image a navigation link without breaking layout */
a.img-wrapper-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
a.img-wrapper-link .img-wrapper {
    display: block;
}

/* small view icon inside overlay */
.overlay-icon { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:8px; background:rgba(255,255,255,0.9); color:var(--text); text-decoration:none; }
.overlay-icon i { font-size:1rem; }

/* wishlist grid */
.wishlist-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:20px; }
.wishlist-card { background:#fff; padding:12px; display:flex; gap:12px; border-radius:8px; align-items:center; box-shadow:0 6px 18px rgba(0,0,0,0.04); }
.wishlist-card img { width:100px; height:100px; object-fit:cover; border-radius:6px; background:#f6f6f6; }
.wishlist-info h3 { margin-bottom:8px; font-size:1rem; }
.wishlist-info .price { color:var(--accent); font-weight:600; margin-bottom:10px; }

.overlay-btn {
    width: auto; padding: 8px 10px; border: 1px solid var(--text);
    background: var(--text); color: white; cursor: pointer; border-radius:6px; font-size:0.95rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.card-overlay .wishlist-btn { background: white; color: var(--text); width:36px; height:36px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; }
.card-overlay .add-cart-btn { padding:8px 12px; }
.card-overlay .overlay-view-btn { background:rgba(255,255,255,0.9); color:var(--text); width:36px; height:36px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; border:none; cursor:pointer; touch-action:manipulation; text-decoration:none; }

/* --- Editor's Choice Section --- */
.editors-choice { padding: 100px 5%; background: #fff; }
.split-layout { display: flex; align-items: center; gap: 50px; }
.split-img, .split-text { flex: 1; }
.split-img img { width: 100%; border-radius: 4px; }
.badge { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 0.8rem; }
.split-text h2 { font-family: 'Playfair Display', serif; font-size: 2.5rem; margin: 15px 0; }

/* --- Footer --- */
footer { padding: 80px 5%; background: #eeeae3; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.footer-col h4 { margin-bottom: 20px; font-size: 0.9rem; text-transform: uppercase; }
.footer-col a { display: block; text-decoration: none; color: var(--text); margin-bottom: 10px; font-size: 0.85rem; }
.newsletter-box { display: flex; gap: 10px; margin-top: 20px; }
.newsletter-box input { padding: 10px; border: 1px solid #ccc; flex: 1; }
.newsletter-box button { background: var(--accent); color: white; border: none; padding: 10px 15px; cursor: pointer; }

/* --- Mobile Fixes --- */
@media (max-width: 768px) {
    .nav-links, .desktop-only { display: none; }
    /* Ensure logout button with higher specificity is also hidden on mobile */
    .btn-signup.desktop-only, .btn-signup.desktop-only.logout-btn { display: none !important; }
    .hamburger { display: block; }
    /* Hide any logout links inside the mobile menu (safety), keep only the .logout-mobile block */
    #mobileMenu a[href*="logout"] { display: none !important; }
    #mobileMenu .logout-mobile a { display: flex !important; }
    .hero-content h1 { font-size: 2.5rem; }
    .split-layout { flex-direction: column; }
    .product-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .img-wrapper { height: 250px; }
}
/* --- Cart Dropdown Styles --- */
.cart-wrapper {
    position: relative;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

.cart-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    width: 320px;
    background: var(--white);
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
    border-radius: 8px;
}

.cart-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-dropdown h4 {
    font-family: 'Playfair Display', serif;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.cart-dropdown .cart-items {
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    background: #f9f9f9;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

/* Admin settings layout fixes */
.settings-container { display:flex; gap:24px; padding:24px; align-items:flex-start; }
.settings-nav { width:220px; background:#fff; padding:12px; border-radius:8px; box-shadow:0 6px 18px rgba(0,0,0,0.04); }
.settings-nav .s-nav-btn { display:block; width:100%; text-align:left; padding:10px; border:none; background:transparent; cursor:pointer; margin-bottom:6px; }
.settings-nav .s-nav-btn.active { background:linear-gradient(90deg, rgba(154,130,114,0.08), rgba(154,130,114,0.02)); border-radius:6px; }
.settings-content { flex:1; min-width:0; }
.settings-pane { background:#fff; padding:18px; border-radius:8px; box-shadow:0 6px 18px rgba(0,0,0,0.04); margin-bottom:20px; }
.gateway-card { background:#fff; padding:12px; border:1px solid #f1f1f1; border-radius:8px; margin-bottom:12px; width:100%; box-sizing:border-box; }
.settings-content .gateway-card { max-width:100%; }

/* Hide non-active panes and show only the active one */
.settings-content .settings-pane { display: none; }
.settings-content .settings-pane.active { display: block; }
.curation-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.admin-list-mini .admin-row { display:flex; justify-content:space-between; align-items:center; padding:12px; border-bottom:1px solid #f6f6f6; }
.admin-info { display:flex; gap:12px; align-items:center; }
.user-avatar { width:40px; height:40px; border-radius:8px; background:#eee; display:flex; align-items:center; justify-content:center; font-weight:700; }
.builder-layout { display:flex; gap:20px; }
.builder-inputs { flex:1; }
.email-preview-mobile { width:320px; }
.toast {
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateY(10px) scale(0.98);
    opacity: 0; transition: all 220ms ease;
    max-width: 320px; font-size: 0.95rem;
}
.toast.visible { transform: translateY(0) scale(1); opacity: 1; }

/* Responsive: make settings layout stack on narrow screens and keep panes from pushing layout */
@media (max-width: 900px) {
    .settings-container { flex-direction: column; padding:16px; }
    .settings-nav { width:100%; display:flex; overflow-x:auto; padding:8px; gap:8px; -webkit-overflow-scrolling: touch; }
    .settings-nav .s-nav-btn { white-space:nowrap; flex:0 0 auto; width:auto; min-width:120px; display:inline-flex; align-items:center; justify-content:center; padding:8px 12px; margin-right:6px; border-radius:6px; }
    .settings-nav::-webkit-scrollbar { height:8px; }
    .settings-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius:6px; }
    .settings-nav { -ms-overflow-style: -ms-autohiding-scrollbar; }
    .settings-content { width:100%; }
    /* ensure only the active pane is visible and takes full width */

/* Also hide desktop-only logout on larger small screens (tablets) to avoid duplicate logout text */
@media (max-width: 1024px) {
    .btn-signup.desktop-only, .btn-signup.desktop-only.logout-btn { display: none !important; }
}

/* show logout label only on larger (desktop) screens */
@media (min-width: 769px) {
    .logout-label { display: block; }
    /* Desktop: keep the compact icon but show the label beneath */
    .btn-signup.desktop-only.logout-btn { padding:6px 6px; width:44px; }
    .btn-signup.desktop-only.logout-btn .logout-label { margin-top:2px; }
}

/* Hover color effect without a box */
.btn-signup.desktop-only.logout-btn:hover { background: transparent; }
.btn-signup.desktop-only.logout-btn:hover i { color: #4a4a4a; }
.btn-signup.desktop-only.logout-btn:hover .logout-label { color: #4a4a4a; }
    .settings-content .settings-pane { display:none; box-shadow:none; border-radius:6px; padding:14px; }
    .settings-content .settings-pane.active { display:block; }
    .builder-layout { flex-direction:column; }
    .email-preview-mobile { width:100%; max-width:100%; }
    .curation-grid { grid-template-columns: 1fr; }
    /* make drawer overlay full width friendly */
    #adminSlider { right: -100%; width: 100%; max-width: 420px; }
    #adminSlider.active { right: 0; }
}

/* Larger screens: ensure preview area and gateway cards align nicely */
@media (min-width: 901px) {
    .settings-container { align-items: flex-start; }
    .settings-nav { position: sticky; top: 24px; align-self: flex-start; }
    .settings-content { min-height: 480px; }
}
.toast.success { background: #2d7a46; }
.toast.error { background: #a33; }

/* Region swap: keep select and text input in same location to avoid layout shift when toggling */
.region-swap { position: relative; min-height: 44px; }
.region-swap > select,
.region-swap > input[type="text"] { position: absolute; top: 0; left: 0; right: 0; width: 100%; box-sizing: border-box; transition: opacity .14s ease, visibility .14s ease; }
.region-swap > select { visibility: visible; opacity: 1; z-index: 1; }
.region-swap > input[type="text"] { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; z-index: 2; }
.region-swap.show-text > select { visibility: hidden; opacity: 0; pointer-events: none; }
.region-swap.show-text > input[type="text"] { display: block !important; visibility: visible !important; opacity: 1 !important; pointer-events: auto !important; }

/* Make shipping locations list scrollable on small screens */
@media (max-width: 720px) {
    #shippingLocationsList { max-height: 320px !important; overflow: auto; -webkit-overflow-scrolling: touch; }
}

/* Notification icon styles */
.notif-wrapper { position: relative; color: var(--text); display:inline-flex; align-items:center; gap:6px; }
.notif-wrapper .fa-bell { font-size:1.05rem; }
.notif-wrapper .notif-count { background: var(--accent); color:#fff; font-size:0.75rem; padding:2px 6px; border-radius:999px; margin-left:6px; }
.notif-dropdown { border-radius:8px; overflow:hidden; }
.notif-item:last-child { border-bottom:none; }

.item-name { font-size: 0.85rem; font-weight: 600; }
.item-price { font-size: 0.8rem; color: var(--accent); }

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin: 15px 0;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.btn-checkout {
    width: 100%;
    background: var(--text);
    color: white;
    border: none;
    padding: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

/* --- Mobile Menu Overlay --- */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: -100%; /* Start off-screen */
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Transparent dim for the right side */
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: block; /* Changed from flex to block to allow absolute positioning */
}

.mobile-overlay.active {
    left: 0;
}

.mobile-menu-content {
    width: 60%; /* Fills 60% of the screen from the left */
    height: 100%;
    background: var(--bg); /* Warm Sand color from your image */
    padding: 80px 30px;
    position: absolute;
    left: 0; /* Ensures it stays on the left */
    top: 0;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

.close-menu {
    position: absolute;
    top: 30px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--accent);
    cursor: pointer;
}

.mobile-links {
    list-style: none;
    padding: 0;
}

.mobile-links li {
    margin-bottom: 25px;
}

.mobile-links a {
    text-decoration: none;
    color: var(--text);
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
}
/* --- Trust Bar Styles --- */
.trust-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 80px 5%;
    background-color: #FDFCFB; /* Slightly lighter than the main bg for contrast */
    border-top: 1px solid #eee;
    gap: 30px;
}

.trust-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

/* Container for the icon to give it more presence */
.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(154, 130, 114, 0.1); /* Light version of your brown accent */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.trust-item:hover .icon-circle {
    background: var(--accent);
}

/* --- Admin Mobile Enhancements --- */
/* hide mobile admin nav by default, shown on small screens */
.mobile-admin-nav { display: none; }

@media (max-width: 900px) {
    /* show a compact top nav and hide the desktop sidebar */
    .mobile-admin-nav { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:#fff; box-shadow:0 6px 18px rgba(0,0,0,0.04); border-bottom:1px solid #f6f6f6; }
    .admin-container { display:block; }
    .admin-sidebar { display:none; }
    .admin-main { padding:12px; }
    .admin-header { display:flex; flex-direction:row; gap:8px; align-items:center; justify-content:space-between; margin-bottom:12px; }
    .admin-header h2 { font-size:1.1rem; margin:0; }
    .admin-header .btn-shop { padding:10px 12px; font-size:0.95rem; white-space:nowrap; }

    /* tables scroll horizontally instead of squeezing columns */
    .admin-content-box { overflow-x:auto; -webkit-overflow-scrolling: touch; }
    .admin-table { min-width:700px; width:100%; }
    .admin-thumb { width:64px; height:64px; object-fit:cover; border-radius:6px; }

    /* make form controls touch-friendly */
    input, textarea, select, .styled-select { width:100%; padding:10px 12px; font-size:0.95rem; }
    .form-row { display:flex; flex-direction:column; gap:10px; }

/* removed conflicting drawer rule */

    /* compact gateway cards and stack their rows */
    .gateway-card .form-row { flex-direction:column; }
    .gateway-card .form-group { width:100%; }

    /* settings nav becomes a horizontal scroller (already enabled) — reduce button padding for small viewports */
    .settings-nav .s-nav-btn { padding:8px 10px; font-size:0.92rem; }

    /* admin list rows: make actions easier to tap */
    .admin-list-mini .admin-row { padding:10px; gap:10px; }
    .admin-list-mini .remove-btn { padding:8px 10px; }

    /* bulk toolbar (admin products) responsiveness */
    .bulk-toolbar { flex-direction:column; align-items:stretch; gap:8px; }
    .bulk-toolbar input { width:100%; }
    .bulk-toolbar button { width:100%; }

    /* smaller toast margins on mobile */
    .toast-container { right: 12px; left: 12px; bottom: 12px; }
}

@media (max-width: 480px) {
    .admin-header h2 { font-size:1rem; }
    .btn-signup, .btn-shop { padding:10px; font-size:0.95rem; }
}

.trust-item i {
    font-size: 1.5rem;
    color: var(--accent); /* Your Brown #9A8272 */
    transition: var(--transition);
}

.trust-item:hover i {
    color: white;
}

.trust-text h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}

.trust-text p {
    font-size: 0.85rem;
    color: #888;
    max-width: 200px;
    line-height: 1.4;
}

/* Low stock badge for admin product list */
.low-stock-badge {
    display: inline-block;
    background: #ff6b6b;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Mobile Fix */
@media (max-width: 768px) {
    .trust-bar {
        flex-direction: column;
        padding: 50px 10%;
    }
}
/* --- Category Section Styles --- */
.category-section {
    padding: 60px 5%;
    background-color: var(--bg);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.category-card {
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.category-img-container {
    width: 100%;
    aspect-ratio: 1 / 1; /* Keeps it perfectly square or circular */
    border-radius: 12px; /* Soft rounded corners as seen in the image */
    overflow: hidden;
    margin-bottom: 15px;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.03);
}

.category-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
}

/* Responsive Fix for Mobile */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr); /* 2x2 grid on mobile */
        gap: 15px;
    }
    
    .category-img-container {
        border-radius: 8px;
    }
}


/* --- Contact Page Styles --- */
.contact-page {
    padding: 80px 5%;
    background-color: var(--bg);
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: var(--white);
    padding: 60px;
    border-radius: 4px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.03);
}

.contact-form-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin: 15px 0;
}

.contact-form-section p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.main-contact-form .form-group {
    margin-bottom: 20px;
}

.main-contact-form label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.main-contact-form input, 
.main-contact-form select, 
.main-contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0ddd7;
    background: #fdfcfb;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.main-contact-form input:focus, 
.main-contact-form textarea:focus {
    border-color: var(--accent);
}

.contact-info-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.map-container {
    border-radius: 4px;
    overflow: hidden;
    filter: grayscale(0.5); /* Makes the map blend with your brand aesthetic */
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.info-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.info-item i {
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 5px;
}

.info-item h4 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 5px;
}

.info-item p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr;
        padding: 30px;
    }
}
/* --- Refined Auth Page Styles --- */
.auth-page {
    background-color: var(--bg); /* Warm Sand */
    min-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.auth-container {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 60px 40px;
    border-radius: 2px; /* Sharper corners for a modern look */
    box-shadow: 0 20px 60px rgba(0,0,0,0.05);
    text-align: center;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-box h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text);
}

.auth-box .form-group {
    text-align: left;
    margin-bottom: 25px;
}

.auth-box label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent); /* Brown Color */
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.auth-box input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #e0ddd7; /* Thin elegant line */
    padding: 12px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background: transparent;
    transition: border-color 0.3s;
}

.auth-box input:focus {
    outline: none;
    border-bottom: 1px solid var(--accent);
}

.auth-box .btn-shop {
    width: 100%;
    margin-top: 20px;
    background: var(--accent);
    padding: 18px;
    border: none;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.auth-box .btn-shop:hover {
    opacity: 0.9;
}

/* Forgot Password Styling */
.forgot-link {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: #888;
    text-decoration: none;
    margin-top: 8px;
}

.forgot-link:hover {
    color: var(--accent);
}

.switch-text {
    margin-top: 30px;
    font-size: 0.85rem;
    color: #777;
}

.switch-text a {
    color: var(--text);
    text-decoration: underline;
    font-weight: 600;
}

/* Fixed Sign Up Button Styling for Nav */
.btn-signup {
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--text);
    padding: 10px 22px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-signup:hover {
    background: var(--text);
    color: white;
}

/* --- Product Page Detail Styles --- */
.product-detail-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-image img {
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: 4px;
}

.thumbnail-bar {
    display: flex;
    gap: 15px;
}

.thumbnail-bar img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.thumbnail-bar img:hover {
    border-color: var(--accent);
}

.product-info-sticky {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.product-info-sticky h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    margin: 10px 0;
    font-weight: 400;
}

.product-price {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 30px;
}

.product-description {
    margin-bottom: 30px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.product-description ul {
    margin-top: 15px;
    padding-left: 20px;
}

.purchase-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e0ddd7;
    padding: 5px;
}

.quantity-selector button {
    background: none;
    border: none;
    width: 30px;
    cursor: pointer;
    font-size: 1.2rem;
}

.quantity-selector input {
    width: 40px;
    text-align: center;
    border: none;
    outline: none;
    background: transparent;
}

.btn-full {
    flex-grow: 1;
    text-align: center;
}

.wishlist-link {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
}

/* Accordion Styling */
.product-accordion details {
    border-top: 1px solid #eee;
    padding: 15px 0;
}

.product-accordion summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
}

.product-accordion summary::after {
    content: '+';
    color: var(--accent);
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }
    
    .product-info-sticky {
        position: static;
    }
}

/* --- Related Products Spacing --- */
.related-products {
    padding: 80px 0;
    border-top: 1px solid #eee;
    background-color: var(--white);
}

.related-products .container {
    padding: 0 5%;
}

/* Ensure the grid looks perfect on the product page */
.related-products .product-grid {
    margin-top: 40px;
}

/* --- Cart Page Specifics --- */
.cart-page-container {
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 70vh;
}

.cart-header {
    text-align: center;
    margin-bottom: 50px;
}

.cart-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 400;
}

.cart-content {
    display: grid;
    grid-template-columns: 1.5fr 0.5fr;
    gap: 50px;
    align-items: start;
}

.cart-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
}

.cart-page-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid #f0eee9;
}

.item-details {
    display: flex;
    gap: 20px;
    align-items: center;
}

.item-details img {
    width: 100px;
    height: 120px;
    object-fit: cover;
    background: #fff;
}

.item-details h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.remove-btn {
    background: none;
    border: none;
    font-size: 0.7rem;
    text-decoration: underline;
    color: #999;
    cursor: pointer;
}

.item-total-price {
    font-weight: 500;
    text-align: right;
}

/* --- Summary Card --- */
.summary-card {
    background: #FDFCFB;
    padding: 30px;
    border: 1px solid #f0eee9;
}

.summary-card h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 25px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.total-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-weight: 600;
    font-size: 1.1rem;
}

.promo-code {
    display: flex;
    gap: 10px;
    margin: 25px 0;
}

.promo-code input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0ddd7;
    font-size: 0.8rem;
}

.promo-code button {
    background: var(--text);
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
}

.payment-note {
    text-align: center;
    font-size: 0.7rem;
    color: var(--accent);
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 992px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
    .cart-page-item {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .item-total-price {
        text-align: left;
    }
}

/* --- Checkout Page Styles --- */
.checkout-header {
    padding: 30px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.back-link {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.checkout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 80px;
    padding: 60px 5%;
    max-width: 1300px;
    margin: 0 auto;
}

.checkout-section {
    margin-bottom: 50px;
}

.checkout-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 400;
}

.form-row {
    display: flex;
    gap: 15px;
}

.checkout-main .form-group {
    margin-bottom: 15px;
    flex: 1;
}

.checkout-main input {
    width: 100%;
    padding: 15px;
    border: 1px solid #e0ddd7;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

/* Payment Method Cards */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-card {
    border: 1px solid #e0ddd7;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border-radius: 4px;
}

.payment-card.active {
    border-color: var(--accent);
    background-color: #fdfcfb;
}

.payment-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Sidebar Summary */
.checkout-sidebar {
    background-color: #FDFCFB;
    padding: 24px;
    border-left: 1px solid #eee;
    max-height: 100vh;
    overflow: auto;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.summary-img-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid #eee;
    background: white;
}

.summary-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qty-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 50%;
}

.price-right { margin-left: auto; }

.divider { border: 0; border-top: 1px solid #eee; margin: 20px 0; }

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.final-total {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 20px;
}

.free-text { color: #6e8b3d; font-weight: 600; }

/* Mobile Adjustments */
@media (max-width: 992px) {
    .checkout-container {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }
    .checkout-sidebar {
        order: -1; /* Summary appears at top on mobile */
        height: auto;
        border-left: none;
        padding: 20px;
    }
}

/* --- Shop Page Layout --- */
.shop-header-banner {
    text-align: center;
    padding: 60px 5%;
    background-color: #FDFCFB;
    border-bottom: 1px solid #f0eee9;
}

.shop-header-banner h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 400;
}

.shop-container {
    display: grid;
    /* Changed to minmax to ensure the sidebar never gets too small for the text */
    grid-template-columns: minmax(220px, 250px) 1fr; 
    gap: 60px; /* Increased gap for better breathing room */
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar Filters */
.shop-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
    /* Prevent any overlapping with products */
    z-index: 10;
}

.filter-group {
    margin-bottom: 40px;
    width: 100%;
}

.filter-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    color: var(--accent);
}

.filter-list {
    list-style: none;
    padding: 0;
}

.filter-list li {
    margin-bottom: 12px;
}

.filter-btn {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px 0;
    transition: var(--transition);
    display: block;
    width: 100%;
    text-align: left;
    white-space: nowrap; /* Prevents "Beauty" or "Accessories" from breaking into 2 lines */
}

.filter-btn:hover, .filter-btn.active {
    color: var(--text);
    padding-left: 8px;
    font-weight: 600;
}

/* Fixed the Sort Dropdown Overlapping */
.sort-select {
    width: 100%;
    max-width: 180px; /* Limits the width so it doesn't span the whole sidebar */
    padding: 10px;
    border: 1px solid #e0ddd7;
    background: white;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    display: block;
    margin-top: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .shop-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .shop-sidebar {
        position: static;
        display: flex;
        flex-direction: column; /* Stack vertically on small screens to avoid horizontal overlap */
        gap: 20px;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid #eee;
    }

    .filter-group {
        margin-bottom: 0;
    }

    .filter-list {
        display: flex;
        gap: 20px;
        overflow-x: auto; /* Allows swiping through categories on phone */
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
    }

    .filter-list li {
        white-space: nowrap;
    }
    
    .sort-select {
        max-width: 100%; /* Allows it to be full width only on mobile */
    }
}
/* --- Styled Dropdowns --- */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 250px;
}

.styled-select {
    width: 100%;
    padding: 12px 40px 12px 0; /* Space for the custom arrow */
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0ddd7; /* Elegant thin line */
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    appearance: none; /* Removes default arrow */
    -webkit-appearance: none;
    border-radius: 0;
}

/* --- Sophisticated Filter Dropdowns --- */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    margin-top: 5px;
}

.styled-select {
    width: 100%;
    /* This removes the default grey box and browser styling */
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    
    background: none !important; /* Force removal of grey background */
    background-color: transparent !important;
    
    border: none;
    border-bottom: 1px solid #d1cdc7; /* The thin elegant line */
    border-radius: 0;
    
    padding: 10px 30px 10px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

/* Custom Dropdown Arrow */
.custom-select-wrapper::after {
    content: '\f107'; /* FontAwesome Chevron Down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    pointer-events: none; /* Allows you to click "through" the icon to open the menu */
    font-size: 0.75rem;
}

.styled-select:focus {
    border-bottom: 1px solid var(--accent);
}

/* --- Sidebar Spacing Adjustment --- */
.shop-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Mobile Alignment */
@media (max-width: 768px) {
    .shop-sidebar {
        flex-direction: row; /* Category and Sort side-by-side */
        gap: 20px;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
    }
    
    .filter-group {
        flex: 1;
    }
}


/* --- Sidebar Spacing --- */
.shop-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.filter-group h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--accent);
    font-weight: 600;
}

/* --- Mobile Specific Formatting --- */
@media (max-width: 768px) {
    .shop-container {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        display: flex;
        flex-direction: row; /* Side by side dropdowns on mobile */
        gap: 20px;
        margin-bottom: 40px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        background: transparent; /* Clean look */
    }

    .filter-group {
        flex: 1; /* Equal width for Category and Sort */
        margin-bottom: 0;
    }

    .custom-select-wrapper {
        max-width: 100%;
    }
    
    .styled-select {
        font-size: 0.8rem; /* Slightly smaller for mobile screens */
    }
}
/* --- Sophisticated Filter Dropdowns --- */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    margin-top: 5px;
}

.styled-select {
    width: 100%;
    /* Removes the default grey/black box and blue radio styling */
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    
    background: transparent !important;
    background-color: transparent !important;
    
    /* Elegant thin line instead of a box */
    border: none;
    border-bottom: 1px solid #d1cdc7; 
    border-radius: 0;
    
    padding: 10px 30px 10px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text); /* Uses your #333333 text color */
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

/* Custom Dropdown Arrow to replace the default one */
.custom-select-wrapper::after {
    content: '\f107'; /* FontAwesome Chevron Down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent); /* Uses your #9A8272 brown accent */
    pointer-events: none; 
    font-size: 0.75rem;
}

.styled-select:focus {
    border-bottom: 1px solid var(--accent);
}

/* Mobile Alignment: Side-by-side dropdowns */
@media (max-width: 768px) {
    .shop-sidebar {
        display: flex;
        flex-direction: row; 
        gap: 20px;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
        background: transparent;
    }
    
    .filter-group {
        flex: 1;
    }
}

/* --- Admin Dashboard Styles --- */
.admin-body {
    background-color: #f9f7f4; /* Slightly different from main bg for depth */
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid #eee;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
}

.admin-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin: 40px 0 20px 10px;
}

.admin-nav {
    list-style: none;
    flex-grow: 1;
}

.admin-nav li {
    margin-bottom: 5px;
}

.admin-nav a {
    text-decoration: none;
    color: var(--text);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: var(--transition);
}

.admin-nav li.active a, .admin-nav a:hover {
    background: var(--bg);
    color: var(--accent);
}

.sidebar-footer a {
    color: #cc0000;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 15px;
    display: block;
}

/* Main Content Area */
.admin-main {
    margin-left: 260px;
    flex-grow: 1;
    padding: 40px 5%;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.admin-header h2 {
    font-family: 'Playfair Display', serif;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Stats Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}

.stat-card p { font-size: 0.8rem; color: #777; margin-bottom: 10px; }
.stat-card h3 { font-size: 1.8rem; margin-bottom: 5px; }
.trend { font-size: 0.75rem; color: #6e8b3d; font-weight: 600; }

/* Content Box & Table */
.admin-content-box {
    background: var(--white);
    padding: 30px;
    border-radius: 4px;
}

.box-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.admin-table td {
    padding: 20px 0;
    border-bottom: 1px solid #fafafa;
    font-size: 0.9rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.paid { background: #eef7e8; color: #6e8b3d; }
.status-badge.pending { background: #fff8e6; color: #f0ad4e; }

/* Mobile Admin Fix: tablet range now uses slide-in overlay (handled below at 900px),
   so we only need a modest width reduction here, keeping icon + label visible */
@media (max-width: 992px) and (min-width: 901px) {
    .admin-sidebar { width: 200px; padding: 40px 12px; }
    .admin-main { margin-left: 200px; }
    .admin-stats { grid-template-columns: 1fr; }
}

/* --- Admin Product Table & Modal --- */
.admin-thumb {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}

/* Modal Overlay */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition); /* */
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal-content {
    background: var(--white); /* */
    width: 100%;
    max-width: 600px;
    padding: 40px;
    border-radius: 2px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h3 {
    font-family: 'Playfair Display', serif; /* */
}

/* Admin Form Elements */
.admin-form .form-group {
    margin-bottom: 20px;
}

/* Account & Form Panels */
.panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.form-actions { margin-top: 12px; display:flex; gap:12px; align-items:center; }
.form-actions a { color: var(--accent); text-decoration: none; font-size:0.95rem; }

@media (max-width: 720px) {
    .form-row { flex-direction: column; }
}

.admin-form label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent); /* */
    margin-bottom: 8px;
    display: block;
}

.admin-form input, .admin-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0ddd7;
    font-family: 'Inter', sans-serif; /* */
}

.image-upload-box {
    border: 2px dashed #e0ddd7;
    padding: 30px;
    text-align: center;
    color: #999;
    cursor: pointer;
    transition: var(--transition); /* */
}

.image-upload-box:hover {
    border-color: var(--accent); /* */
    color: var(--accent);
}

.image-upload-box i {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* --- Admin Orders Page Specifics --- */

.order-tabs {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--text);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

/* Status Badge Palette - Muted "Clean Girl" Tones */
.status-badge {
    padding: 6px 12px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.processing {
    background-color: #F4F0EC; /* Soft Taupe */
    color: #9A8272;
}

.status-badge.shipped {
    background-color: #E8F0F2; /* Soft Blue-Grey */
    color: #5A7D8C;
}

.status-badge.completed {
    background-color: #EBF2ED; /* Soft Sage */
    color: #6E8B3D;
}

.detail-link {
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.detail-link:hover {
    color: var(--accent);
}

/* Ensure the table is responsive on the admin side */
@media (max-width: 1024px) {
    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* --- Admin Order Drawer --- */
.order-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    z-index: 2500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ── Canonical order-drawer rule (single source of truth) ── */
.order-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(480px, 100vw);
    height: 100%;
    height: 100dvh;
    background: var(--white);
    z-index: 5000;
    box-shadow: -6px 0 24px rgba(0,0,0,0.10);
    transition: right 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.order-drawer.active { right: 0; }
.order-drawer-overlay.active { display: block; opacity: 1; }

.drawer-header {
    padding: 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 { font-family: 'Playfair Display', serif; }

.drawer-content {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.drawer-section {
    margin-bottom: 35px;
}

.customer-info-card, .address-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-light);
}

.drawer-item {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dotted #eee;
}

.drawer-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 2px;
}

.item-meta p { font-size: 0.85rem; font-weight: 500; }
.item-meta span { font-size: 0.75rem; color: #999; }

.fulfillment-box {
    background: #FDFCFB;
    padding: 20px;
    border: 1px solid #f0eee9;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.summary-row.total {
    font-weight: 600;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}

.status-update {
    margin: 25px 0;
}

/* --- Admin Customer Profile Styles --- */
.customer-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-main-info {
    text-align: center;
    margin-bottom: 30px;
}

.user-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
    margin: 0 auto 15px;
}

.profile-main-info h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.profile-main-info p {
    font-size: 0.8rem;
    color: #999;
}

.stats-grid-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 40px;
}

.mini-stat {
    background: #FDFCFB;
    padding: 15px;
    border: 1px solid #f0eee9;
    text-align: center;
}

.mini-stat span {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
}

.detail-text {
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #fafafa;
}

.history-left p {
    font-size: 0.85rem;
    font-weight: 600;
}

.history-left span {
    font-size: 0.75rem;
    color: #999;
}

/* --- Settings Page Layout --- */
.settings-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    background: var(--white);
    padding: 30px;
    border-radius: 4px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
}

.s-nav-btn {
    text-align: left;
    background: none;
    border: none;
    padding: 15px 10px;
    font-size: 0.85rem;
    color: #999;
    cursor: pointer;
    border-left: 2px solid transparent;
}

.s-nav-btn.active {
    color: var(--accent);
    border-left: 2px solid var(--accent);
    background: #fdfcfb;
}

.settings-pane {
    display: none;
}

.settings-pane.active {
    display: block;
}

.gateway-card {
    border: 1px solid #f0eee9;
    padding: 25px;
    margin-bottom: 20px;
}

.gateway-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

input:checked + .slider { background-color: var(--accent); }

.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider:before { transform: translateX(20px); }

/* Autofill switch layout for checkout */
.autofill-row { display:flex; align-items:center; gap:12px; }
.autofill-row .switch { width:46px; height:24px; }
.autofill-row .slider:before { height:18px; width:18px; left:3px; bottom:3px; }
input:checked + .slider:before { transform: translateX(22px); }
.autofill-label { cursor:pointer; font-size:0.95rem; color: var(--text); }

/* Secure payment box used on checkout */
.secure-payment {
    display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:8px;
    background: #f3fff6; border: 1px solid #cdebd3; color: #2d7a46; max-width: 420px;
}
.secure-payment .fa-lock {
    background: #2d7a46; color:#fff; padding:8px; border-radius:50%; font-size:0.95rem; width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center;
}
.secure-payment .secure-text strong { display:block; font-size:1rem; }
.secure-payment .muted { font-size:0.9rem; color:#566; margin-top:2px; }

.secure-payment .paystack-logo {
    margin-left: auto;
    height: 5px;
    max-height: 5px;
    width: auto;
    display: inline-block;
    object-fit: none;
    flex: 0 0 auto;
}
@media (max-width:720px) {
    .secure-payment { max-width:100%; }
    .secure-payment .paystack-logo { height: 5px; max-height:5px; }
}

/* --- Curation Styling --- */
.curation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.curation-item {
    background: #FDFCFB;
    border: 1px solid #f0eee9;
    padding: 20px;
}

.curation-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* --- Admin Row Styling --- */
.admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #fafafa;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Ensure drawer is ready for Admin Slider */
#adminSlider {
    right: -500px;
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#adminSlider.active {
    right: 0;
}

/* --- Drawer Formatting --- */
.order-drawer {
    padding-bottom: 30px;
}

.admin-meta {
    font-size: 0.75rem;
    color: #999;
}

/* Status & Action Buttons in Slider */
.status-box-drawer {
    background: #FDFCFB;
    padding: 20px;
    border: 1px solid #f0eee9;
    margin: 25px 0;
}

.drawer-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-action {
    flex: 1;
    padding: 10px;
    font-size: 0.8rem;
    border: 1px solid #e0ddd7;
    background: white;
    cursor: pointer;
    transition: 0.3s;
}

.btn-action.pause:hover { background: #fff8e6; color: #f0ad4e; }
.btn-action.delete:hover { background: #fbeaea; color: #cc0000; }

/* Visual Curation Cards */
.curation-selector {
    background: white;
    padding: 15px;
    border: 1px solid #e0ddd7;
    margin-top: 10px;
}
/* Ensure panes are hidden unless active */
.settings-pane {
    display: none; 
    animation: fadeIn 0.3s ease-in-out;
}

.settings-pane.active {
    display: block;
}

/* Curation Card Styling */
.curation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.curation-card {
    background: #fff;
    border: 1px solid #f0eee9;
    overflow: hidden;
}

.curation-image-placeholder {
    height: 150px;
    background: #FDFCFB;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #d1cdc7;
    border-bottom: 1px solid #f0eee9;
}

.curation-details {
    padding: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.gateway-card h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.gateway-card h4 i {
    color: var(--accent);
    font-size: 0.9rem;
}

.section-desc {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 25px;
}
.box-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.box-header .btn-signup {
    padding: 10px 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-desc {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}
/* --- Welcome Message Builder --- */
.welcome-builder-card {
    background: var(--white);
    border: 1px solid #f0eee9;
    padding: 30px;
    margin-top: 30px;
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    border-bottom: 1px solid #fafafa;
    padding-bottom: 20px;
}

.builder-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

/* Mobile Frame Preview */
.email-preview-mobile {
    text-align: center;
}

.mobile-frame {
    width: 280px;
    height: 500px;
    border: 12px solid #333;
    border-radius: 30px;
    margin: 0 auto 15px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.email-content-preview {
    text-align: left;
    font-size: 0.75rem;
}

.preview-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.preview-text {
    padding: 20px;
}

.preview-button {
    background: var(--accent);
    color: white;
    padding: 10px;
    text-align: center;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
}

.preview-footer {
    padding: 20px;
    font-size: 0.6rem;
    color: #999;
    text-align: center;
    border-top: 1px solid #eee;
}

.preview-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
}

.input-with-action {
    display: flex;
    gap: 10px;
}

.small-action-btn {
    background: #f4f0ec;
    border: 1px solid #e0ddd7;
    padding: 0 15px;
    cursor: pointer;
    font-size: 0.75rem;
}

@media (max-width: 1100px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }
}
/* --- Mobile Responsive Layout --- */

@media (max-width: 992px) {
    /* Main Sidebar Transformation */
    .admin-container {
        grid-template-columns: 1fr; /* Stack layout */
    }

    .admin-sidebar {
        position: fixed;
        left: -100%; /* Hide sidebar */
        top: 0;
        bottom: 0;
        z-index: 4000;
        width: 280px;
        transition: var(--transition);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }

    .admin-sidebar.active {
        left: 0; /* Slide in */
    }

    /* Show Mobile Header */
    .mobile-admin-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: var(--white);
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        z-index: 3500;
    }

    /* Settings Page Specific Adjustments */
    .settings-container {
        grid-template-columns: 1fr; /* Stack sidebar and content */
        padding: 15px;
    }

    .settings-nav {
        flex-direction: row; /* Horizontal layout */
        overflow-x: auto; /* Enable scrolling */
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
        margin-bottom: 20px;
        white-space: nowrap;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .s-nav-btn {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 10px 15px;
    }

    .s-nav-btn.active {
        border-left: none;
        border-bottom: 2px solid var(--accent);
    }

    /* Form Rows & Table Fixes */
    .form-row, .builder-layout {
        grid-template-columns: 1fr; /* Single column forms */
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }

    .curation-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide mobile header on desktop */
.mobile-admin-nav {
    display: none;
}
/* Ensure Admin Mobile Nav is visible and styled */
.mobile-admin-nav {
    display: none; /* Hidden on desktop */
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--white);
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 3500;
}

.menu-toggle {
    font-size: 1.5rem;
    color: var(--accent);
    cursor: pointer;
}

@media (max-width: 992px) {
    .mobile-admin-nav {
        display: flex; /* Show on mobile */
    }
    
    .admin-sidebar {
        position: fixed;
        left: -100%; /* Hide sidebar off-screen */
        top: 0;
        bottom: 0;
        z-index: 4000;
        width: 280px;
        transition: var(--transition);
        background: var(--white);
    }

    .admin-sidebar.active {
        left: 0; /* Slide in when active */
    }
}
@media (max-width: 992px) {
    /* Stack the sidebar and main content */
    .admin-container {
        display: block;
    }

    .admin-main {
        padding: 15px;
        width: 100%;
        overflow-x: hidden; /* Prevent horizontal scroll on main body */
    }

    /* Force tables to be scrollable within their containers */
    .admin-content-box {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 600px; /* Allow table to be wide but scrollable */
        display: table;
    }

    /* Fix Settings Navigation (Horizontal Scroll) */
    .settings-container {
        grid-template-columns: 1fr;
    }

   

    .s-nav-btn {
        border-left: none !important;
        border-bottom: 2px solid transparent;
        padding: 10px 15px;
    }

    .s-nav-btn.active {
        border-bottom: 2px solid var(--accent);
    }

    /* Stack form rows (Payments, Shipping, etc.) */
    .form-row, .builder-layout, .gateway-card .form-row {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Ensure images and builders fit */
    .email-preview-mobile {
        display: none; /* Hide heavy previews on small phones to save space */
    }
}
@media (max-width: 992px) {
    /* 1. Prevent the entire body from leaking right */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    /* 2. Force the Admin Container to stack rather than sit side-by-side */
    .admin-container {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* 3. Center and contain the Main content */
    .admin-main {
        width: 100%;
        max-width: 100vw;
        padding: 15px; /* Adds breathing room on the edges */
        margin: 0 auto;
        display: block;
    }

    /* 4. Fix Grid Overflows (The main culprit) */
    .admin-stats, 
    .form-row, 
    .builder-layout,
    .settings-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        grid-template-columns: 1fr !important; 
    }

    /* 5. Fix Tables (They always push pages to the right) */
    .admin-content-box {
        width: 100%;
        overflow-x: auto; /* Makes the table scrollable WITHOUT moving the page */
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    .admin-table {
        min-width: 500px; /* Table stays readable, but contained in a scroll box */
    }

    /* 6. Center the Headers */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        text-align: left;
    }
}
/* --- Global Minimalist Form Styling --- */
input[type="text"], 
input[type="number"], 
input[type="email"], 
input[type="password"], 
textarea, 
select {
    width: 100%;
    padding: 12px 16px;
    background-color: #f9f8f6; /* Soft off-white background */
    border: 1px solid #e0ddd7; /* Very light neutral border */
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
    outline: none; /* Removes the blue/black default outline */
}

/* Focus State: Soft highlight instead of a thick outline */
input:focus, 
textarea:focus, 
select:focus {
    background-color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(154, 130, 114, 0.1); /* Subtle brown glow */
}

/* Specific fix for search input to keep its line style */
.search-input {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--accent);
    background: transparent !important;
}

/* Styling for labels to match the luxury aesthetic */
.form-group label, .admin-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    display: block;
}
/* --- Newsletter Desktop Centering --- */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 60px; /* Increased gap for better breathing room */
    align-items: center; /* This centers both columns vertically */
    max-width: 1100px;
    margin: 0 auto; /* Centers the whole builder in the pane */
}

/* Adjusting the email builder card for better spacing */
.welcome-builder-card {
    background: var(--white);
    border: 1px solid #f0eee9;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}
/* --- Newsletter Layout Fixes --- */
.builder-layout {
    display: grid;
    /* Give 65% of space to inputs and fixed small space to the phone */
    grid-template-columns: 1fr 280px; 
    gap: 50px;
    align-items: start; /* Align to top so long forms don't pull the phone down */
    max-width: 1200px;
    margin: 0 auto;
}

.builder-inputs {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Make the phone frame physically smaller */
.mobile-frame {
    width: 240px; /* Reduced from 280px */
    height: 430px; /* Reduced from 500px */
    border: 10px solid #333; /* Slightly thinner bezels */
    border-radius: 25px;
    margin: 0 auto 15px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    /* Scale the content inside to fit the smaller screen */
    transform: scale(1); 
    transform-origin: top;
}

/* Adjust internal preview text for the smaller frame */
.email-content-preview {
    font-size: 0.7rem; /* Slightly smaller text */
}

.preview-img {
    height: 110px; /* Shorter image */
}

.preview-text {
    padding: 15px;
}

.preview-text h2 {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
}

/* Ensure the inputs look clean and don't feel cramped */
.builder-inputs .form-group {
    margin-bottom: 20px;
}

/* Mobile Responsiveness for the Builder */
@media (max-width: 1100px) {
    .builder-layout {
        grid-template-columns: 1fr; /* Stack on small screens */
    }
    
    .email-preview-mobile {
        order: -1; /* Put preview at top on tablet */
        margin-bottom: 30px;
    }
}
/* Admin Name Link styling */
.admin-name-link {
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px border transparent;
}

.admin-name-link:hover {
    border-bottom: 1px solid var(--accent);
    opacity: 0.8;
}

/* Ensure the drawer fields match our new clean design */
#adminSlider .form-group {
    margin-bottom: 20px;
}
/* order-drawer base rule consolidated above */

/* Ensure the overlay dims the background */
.order-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    z-index: 4500;
    transition: 0.3s;
}

.order-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.gallery-upload-box {
    aspect-ratio: 1/1;
    border: 2px dashed #e0ddd7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: #fafafa;
    transition: var(--transition);
}

.gallery-upload-box:hover {
    border-color: var(--accent);
}

.gallery-upload-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-upload-box i {
    color: #999;
    font-size: 1.2rem;
}
/* ============================================================
   ADMIN DASHBOARD — MOBILE-FIRST RESPONSIVE OVERHAUL
   Breakpoints: ≤900px = tablet/mobile, ≤600px = phone
   ============================================================ */

/* Admin sidebar: slide-in drawer on mobile */
@media (max-width: 900px) {
    /* Full-bleed admin container, no side-by-side layout */
    .admin-container { display: block; position: relative; }

    /* Fixed top bar replaces the sidebar on mobile */
    .mobile-admin-nav {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 200;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.07);
        border-bottom: 1px solid #f0ece7;
    }
    .mobile-admin-nav .logo { font-size: 1.2rem; }

    /* Sidebar becomes a slide-in overlay */
    .admin-sidebar {
        display: flex !important;
        position: fixed;
        top: 0; left: -280px;
        width: 260px;
        height: 100%;
        z-index: 300;
        background: #fff;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 24px 20px 40px;
    }
    .admin-sidebar.active { left: 0; }

    /* Dark backdrop when sidebar is open */
    .admin-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 290;
    }
    .admin-sidebar-backdrop.active { display: block; }

    /* Main content: full width, no left margin */
    .admin-main {
        margin-left: 0 !important;
        padding: 16px;
        min-height: calc(100vh - 56px);
    }

    /* Header row: stack on very small screens */
    .admin-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 16px;
    }
    .admin-header h2 { font-size: 1.15rem; flex: 1; }
    .header-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

    /* Stats grid: 2 columns on tablet, 1 on phone */
    .admin-stats { grid-template-columns: 1fr 1fr; gap: 12px; }

    /* Tables: horizontal scroll wrapper */
    .admin-content-box { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
    .admin-table { min-width: 600px; font-size: 0.88rem; }
    .admin-table th, .admin-table td { padding: 10px 12px; }

/* removed conflicting drawer rule */

    /* Form rows: stack vertically */
    .form-row { flex-direction: column !important; gap: 10px; }
    .form-group { width: 100% !important; }

    /* Gateway cards: full width */
    .gateway-card { padding: 14px; }
    .gateway-card .form-row { flex-direction: column; }

    /* Settings nav: horizontal scroll */
    .settings-container { flex-direction: column; }
    .settings-nav {
        width: 100%;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding: 8px;
        border-right: none;
        border-bottom: 1px solid #eee;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .settings-nav::-webkit-scrollbar { display: none; }
    .s-nav-btn { white-space: nowrap; padding: 8px 14px; flex-shrink: 0; }
    .settings-content { padding: 16px; }

    /* Category grid in admin */
    #categoriesList { flex-direction: column; }
    .category-card-admin { width: 100% !important; }

    /* Curation grid */
    .curation-grid { grid-template-columns: 1fr; }

    /* Email preview: hide on very small screens */
    .email-preview-mobile { display: none; }
    .builder-layout { flex-direction: column; }
    .builder-inputs { width: 100%; }

    /* Admin stats mini */
    .stats-grid-mini { grid-template-columns: 1fr 1fr; }

    /* Bulk toolbar */
    .bulk-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .bulk-toolbar > * { width: 100%; }

    /* Order tabs: horizontal scroll */
    .order-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; display: flex; gap: 6px; padding: 0 2px 8px; }
    .tab-btn { white-space: nowrap; flex-shrink: 0; }

    /* Pagination controls */
    #paginationControls { margin-top: 8px; }

    /* Low-stock alerts */
    #lowStockList { flex-direction: column; }
}

@media (max-width: 600px) {
    /* Stats grid: single column on phone */
    .admin-stats { grid-template-columns: 1fr; }

    /* Stat cards */
    .stat-card { padding: 16px; }
    .stat-card h3 { font-size: 1.4rem; }

    /* Product slider: full height */
    .order-drawer { height: 100dvh; overflow-y: auto; }
    .drawer-header { padding: 16px; position: sticky; top: 0; background: #fff; z-index: 1; border-bottom: 1px solid #eee; }

    /* Gallery grid: 2 cols on phone */
    .gallery-grid { grid-template-columns: 1fr 1fr 1fr; }

    /* Admin product table — only show essentials on tiny screens */
    .admin-table thead th:nth-child(4), /* category */
    .admin-table tbody td:nth-child(4) { display: none; }

    /* Orders table — hide date on tiny screens */
    .admin-table.orders-table thead th:first-child,
    .admin-table.orders-table tbody td:first-child { display: none; }

    /* Settings mini stats */
    .admin-stats[style*="grid-template-columns: repeat(2"] { grid-template-columns: 1fr !important; }

    /* Profile main info */
    .profile-main-info { padding: 12px 0; }
    .user-avatar.large { width: 52px; height: 52px; font-size: 1.1rem; }
}

/* ============================================================
   MOBILE FIXES — Sliders, Discount, Shipping, Drawers
   ============================================================ */

/* removed conflicting drawer rule */

/* ── Discount / Coupon section (cart + checkout) ── */
.promo-code {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}
.promo-code input {
    flex: 1 1 160px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e0ddd7;
    border-radius: 6px;
    font-size: 0.88rem;
}
.promo-code button {
    flex: 0 0 auto;
    padding: 11px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
}
.promo-code button:hover { background: #7d6a5c; }

@media (max-width: 480px) {
    .promo-code { flex-direction: column; }
    .promo-code input  { flex: 1 1 auto; width: 100%; }
    .promo-code button { width: 100%; padding: 12px; }
}

/* ── Admin Coupons pane ── */
@media (max-width: 700px) {
    #coupons .admin-table { min-width: 500px; font-size: 0.82rem; }
    #coupons .admin-table th, #coupons .admin-table td { padding: 8px 10px; }
}

/* ── Shipping locations section in settings ── */
@media (max-width: 700px) {
    /* Stack the four location inputs vertically */
    #shipping .gateway-card > div[style*="flex"] {
        flex-direction: column !important;
        gap: 8px;
    }
    #shipping .gateway-card input[id="newLocationName"],
    #shipping .gateway-card input[id="newLocationFee"],
    #shipping .gateway-card input[id="newLocationETA"],
    #shipping .gateway-card input[id="newLocationFreeOver"] {
        width: 100% !important;
        flex: unset !important;
    }
    #shipping .gateway-card button[id="addLocationBtn"] {
        width: 100%;
        margin-top: 4px;
    }

    /* Global fee row: stack */
    #shipping .form-row {
        flex-direction: column !important;
        gap: 10px;
    }
    #shipping .form-group { width: 100% !important; }

    /* Location list items: wrap text */
    .shipping-loc-item {
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start !important;
    }
    .shipping-loc-item > div:first-child { flex: 1 1 auto; }
    .shipping-loc-item .small-action-btn { align-self: flex-end; }
}

/* ── Cart page (shopping bag) ── */
@media (max-width: 640px) {
    .cart-page-container { padding: 0; }
    .cart-header { padding: 20px 16px 12px; }
    .cart-content { padding: 0 16px 32px; }

    .cart-items-list { margin-bottom: 20px; }
    .cart-table-header { display: none; } /* hide desktop column labels */

    .cart-page-item {
        grid-template-columns: 1fr !important;
        gap: 12px;
        padding: 14px 0;
        border-bottom: 1px solid #f0ece7;
    }

    /* Item image smaller on phone */
    .cart-page-item .item-details img {
        width: 72px;
        height: 72px;
        object-fit: cover;
        border-radius: 6px;
        flex-shrink: 0;
    }

    /* Qty selector full width on phone */
    .item-qty { width: 100%; }
    .quantity-selector { width: 100%; justify-content: flex-start; }
    .quantity-selector button { min-width: 36px; min-height: 36px; }
    .quantity-selector input { width: 48px; text-align: center; }

    /* Item total: right-align */
    .item-total-price { text-align: right; font-weight: 600; font-size: 1rem; }

    /* Summary card: no fixed dimensions */
    .summary-card { padding: 18px; }

    /* Checkout button full width */
    .summary-card .btn-shop.btn-full { padding: 14px; font-size: 0.95rem; }
}

/* ── Checkout page ── */
@media (max-width: 680px) {
    .checkout-container {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 0 !important;
    }
    .checkout-main { padding: 16px; }
    .checkout-sidebar {
        order: -1; /* Show summary first on mobile */
        border-left: none;
        border-bottom: 1px solid #eee;
        padding: 16px;
        height: auto;
    }
    .checkout-section { padding: 16px 0; }
    .checkout-section h3 { font-size: 1rem; }

    /* Checkout form inputs */
    .checkout-section input[type="text"],
    .checkout-section input[type="email"],
    .checkout-section select { padding: 11px 12px; font-size: 0.92rem; }

    /* Complete order button */
    #completeOrderBtn { padding: 15px; font-size: 1rem; margin-top: 20px; }

    /* Summary box items */
    .checkout-summary-box .summary-item { font-size: 0.85rem; }
    .checkout-summary-box img { width: 48px !important; height: 48px !important; }
}

/* ── Cart dropdown on mobile ── */
@media (max-width: 480px) {
    .cart-dropdown {
        width: calc(100vw - 24px);
        right: -8px;
        left: auto;
    }
}

/* Shipping inputs row: stack on small screens */
@media (max-width: 700px) {
    .shipping-inputs-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .shipping-inputs-row input,
    .shipping-inputs-row button {
        width: 100% !important;
        flex: unset !important;
    }
}

/* ============================================================
   MOBILE SCROLL + DRAWER SIZE FIXES
   ============================================================ */

/* ── Fix: body overflow-x hidden breaks table scrolling on iOS ─────────────
   We set it only on the body, but admin-content-box needs a proper stacking
   context. The key is: the scrollable child must NOT be inside an
   overflow:hidden ancestor at any level. */
@media (max-width: 900px) {
    /* Remove overflow-x:hidden from admin-main so tables can scroll freely */
    .admin-main { overflow-x: visible !important; }
    /* The scroll container is the content box itself */
    .admin-content-box {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        /* Subtle scroll indicator */
        scrollbar-width: thin;
        scrollbar-color: #d4cdc8 transparent;
    }
    .admin-content-box::-webkit-scrollbar { height: 4px; }
    .admin-content-box::-webkit-scrollbar-thumb { background: #d4cdc8; border-radius: 2px; }

    /* Tables: fixed minimum width so columns never collapse */
    .admin-table { min-width: 580px !important; }

    /* Stats grid scrollable row on very small screens */
    .admin-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        overflow-x: visible;
    }
}

@media (max-width: 480px) {
    .admin-stats { grid-template-columns: 1fr; }
}

/* ── Drawers: proper sizing so content is NEVER clipped ───────────────────── */
@media (max-width: 700px) {
    /* Full-screen drawer on mobile — but drawer-content must scroll */
    .order-drawer {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;   /* dynamic viewport height — safe on iOS */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Sticky header — always visible */
    .order-drawer .drawer-header {
        flex-shrink: 0;
        padding: 14px 16px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        border-bottom: 1px solid #eee;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }

    /* Scrollable body — fills remaining height */
    .order-drawer .drawer-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
        /* Ensure content reachable above mobile bottom bar */
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    /* Make sure the submit button at the bottom is always visible */
    .order-drawer .btn-shop.btn-full {
        margin-top: 12px;
        margin-bottom: 8px;
    }

    /* Form groups inside drawers — generous touch targets */
    .order-drawer .form-group input,
    .order-drawer .form-group textarea,
    .order-drawer .form-group select {
        padding: 11px 12px;
        font-size: 0.92rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Gallery grid inside product slider */
    .order-drawer .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .order-drawer .gallery-upload-box { height: 72px; }
    .order-drawer .image-upload-box.main-upload { height: 130px; }

    /* Sections inside drawers */
    .order-drawer .drawer-section { margin-bottom: 20px; }
    .order-drawer .fulfillment-box { padding: 12px; }

    /* Status update inside drawer */
    .order-drawer .status-update { margin-top: 12px; }
    .order-drawer .status-box-drawer { padding: 12px; margin-bottom: 12px; }

    /* Drawer actions row: stack vertically */
    .order-drawer .drawer-actions-row {
        flex-direction: column;
        gap: 8px;
    }
    .order-drawer .drawer-actions-row .btn-action { width: 100%; }
}

/* ── Settings pane specific: make each pane scrollable independently ────── */
@media (max-width: 900px) {
    .settings-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - 180px);
    }
    .settings-pane { padding: 12px 0; }
}

/* ── Order tabs: scroll indicator arrow hint on mobile ─────────────────── */
@media (max-width: 700px) {
    .order-tabs {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        display: flex;
        gap: 6px;
        padding-bottom: 8px;
    }
    .order-tabs::-webkit-scrollbar { display: none; }
    .tab-btn { flex-shrink: 0; padding: 8px 14px; font-size: 0.85rem; }
}

/* ── Bulk toolbar in products: stack and scroll ─────────────────────────── */
@media (max-width: 700px) {
    .bulk-toolbar {
        flex-direction: column;
        gap: 8px;
    }
    .bulk-toolbar > * { width: 100% !important; margin-left: 0 !important; }
    .bulk-toolbar input[type="number"] { width: 100% !important; }
}

/* ── Category cards in admin products: grid on mobile ─────────────────── */
@media (max-width: 700px) {
    #categoriesList {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .category-card-admin { width: 100% !important; }
}

/* ── Admin header: wrap action buttons below title ──────────────────────── */
@media (max-width: 560px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .admin-header .header-actions,
    .admin-header > div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .admin-header .search-container { flex: 1; min-width: 0; }
    .admin-header #exportCsvBtn { width: auto; }
}

/* ============================================================
   FIX BATCH: Customer slider zoom, Coupons scroll,
   Products page mobile, Product drawer fit, Tax line
   ============================================================ */

/* ── 1. Customer slider: prevent zoom / ensure it fits ─────────────────── */
#customerSlider,
#emailSlider {
    /* Ensure the drawer never forces the viewport to zoom */
    max-width: 100vw;
    box-sizing: border-box;
}

/* Profile info inside drawer: constrain to drawer width */
#customerSlider .profile-main-info {
    padding: 0 0 16px;
    text-align: center;
    overflow: hidden;
}
#customerSlider .user-avatar.large {
    width: 64px;
    height: 64px;
    font-size: 1.2rem;
    margin: 0 auto 12px;
    flex-shrink: 0;
}
#customerSlider .profile-main-info h4 {
    font-size: 1.1rem;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 4px;
}
#customerSlider .stats-grid-mini {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
#customerSlider .mini-stat {
    padding: 10px;
    min-width: 0;
    overflow: hidden;
}
#customerSlider .drawer-content {
    /* All content inside scrolls — never overflows the drawer */
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}
/* Ensure all inputs/text inside customer drawer don't exceed drawer */
#customerSlider input,
#customerSlider textarea,
#customerSlider p,
#customerSlider span {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

@media (max-width: 700px) {
    #customerSlider { width: 100vw !important; }
    #customerSlider .stats-grid-mini { grid-template-columns: 1fr 1fr; gap: 8px; }
    #customerSlider .mini-stat { padding: 8px; font-size: 0.85rem; }
    #customerSlider .mini-stat strong { font-size: 1rem; }
    #emailSlider { width: 100vw !important; }
}

/* ── 2. Coupons section: scrollable table, never hidden ─────────────────── */
#coupons .admin-content-box,
#coupons > .admin-content-box {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d4cdc8 transparent;
}
#coupons .admin-table {
    min-width: 520px;
    width: 100%;
}
#coupons .admin-table th,
#coupons .admin-table td {
    white-space: nowrap;
    padding: 10px 14px;
}
/* The coupons pane itself must not clip */
#coupons {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── 3. Admin Products page: full mobile layout ─────────────────────────── */

/* Categories grid: index-page style cards */
.admin-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.category-card-admin {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.category-card-admin:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.cat-card-img {
    height: 110px;
    overflow: hidden;
}
.cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-card-admin > div:nth-child(2) { /* name */
    font-weight: 600;
    padding: 8px 10px 4px;
    font-size: 0.88rem;
}

.category-card-admin > div:last-child { /* buttons */
    display: flex;
    gap: 6px;
    padding: 0 10px 10px;
}

.cat-card-add {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    border: 2px dashed #e0ddd7;
    border-radius: 10px;
    background: #fdfcfb;
}
.cat-card-add .btn-signup { margin: 0; }

/* Products section header */
.products-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.products-section-header h3 { margin: 0; }

/* Bulk toolbar */
.bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #fdfcfb;
    border-radius: 8px;
    border: 1px solid #f0ece7;
}
.bulk-toolbar label { font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.bulk-toolbar select {
    padding: 6px 10px;
    border: 1px solid #e0ddd7;
    border-radius: 6px;
    font-size: 0.85rem;
}
.bulk-stock-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}
.bulk-stock-group label { font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.bulk-stock-group input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #e0ddd7;
    border-radius: 6px;
    font-size: 0.85rem;
}

@media (max-width: 700px) {
    /* Categories: 2 columns on phone */
    .admin-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .cat-card-img { height: 90px; }

    /* Bulk toolbar: full stacked */
    .bulk-toolbar { flex-direction: column; align-items: stretch; }
    .bulk-toolbar > * { width: 100%; }
    .bulk-toolbar select { width: 100%; }
    .bulk-stock-group { margin-left: 0; width: 100%; }
    .bulk-stock-group input { flex: 1; width: auto; }

    /* Products header */
    .products-section-header { flex-direction: column; align-items: flex-start; }
    .products-section-header .btn-signup { width: 100%; text-align: center; }
}

/* ── 4. Product / Edit slider: fit on mobile ────────────────────────────── */
@media (max-width: 700px) {
    #productSlider {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh;
        display: flex;
        flex-direction: column;
    }
    #productSlider .drawer-header {
        flex-shrink: 0;
        padding: 12px 16px;
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
    }
    #productSlider .drawer-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }
    /* Stacked form rows inside product slider */
    #productSlider .form-row {
        flex-direction: column !important;
        gap: 10px;
    }
    #productSlider .form-group { width: 100% !important; }

    /* Main image upload box: sensible height */
    #productSlider .image-upload-box.main-upload {
        height: 140px !important;
    }
    /* Gallery: 3 small boxes in a row */
    #productSlider .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    #productSlider .gallery-upload-box {
        height: 72px;
    }
    /* Submit button always visible */
    #productSlider #productSubmitBtn {
        margin-top: 12px;
        margin-bottom: 8px;
        width: 100%;
    }
    /* Textarea: reasonable height */
    #productSlider textarea { max-height: 120px; }
}

/* ── 5. Tax line in checkout summary ────────────────────────────────────── */
#summaryTax {
    color: var(--text);
}
.total-line .tax-label {
    color: #888;
    font-size: 0.88rem;
}

/* ============================================================
   AUTHORITATIVE MOBILE FIX — Drawers, Coupons, Products
   (All previous conflicting rules removed above)
   ============================================================ */

/* ── Drawer: header always sticky, body always scrolls ─────────────────── */
.order-drawer .drawer-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.order-drawer .drawer-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    margin: 0;
}
.order-drawer .drawer-header i.fa-xmark {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    color: #999;
}
.order-drawer .drawer-header i.fa-xmark:hover { color: #333; }

.order-drawer .drawer-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
}

/* ── Drawer form rows stack vertically ──────────────────────────────────── */
.order-drawer .form-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (min-width: 540px) {
    .order-drawer .form-row {
        flex-direction: row;
    }
    .order-drawer .form-row .form-group { flex: 1; }
}

/* ── Mobile: drawer goes full-screen ────────────────────────────────────── */
@media (max-width: 600px) {
    .order-drawer {
        width: 100vw !important;
        right: -100vw;
    }
    .order-drawer .drawer-header {
        padding: 14px 16px;
    }
    .order-drawer .drawer-content {
        padding: 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    /* All inputs in drawers: full width, touch-friendly */
    .order-drawer input,
    .order-drawer select,
    .order-drawer textarea {
        width: 100%;
        box-sizing: border-box;
        font-size: 0.95rem;
        padding: 11px 12px;
    }
    /* Drawer action button rows: stack */
    .order-drawer .drawer-actions-row {
        flex-direction: column;
        gap: 8px;
    }
    .order-drawer .drawer-actions-row .btn-action { width: 100%; }
    /* Submit button */
    .order-drawer .btn-shop.btn-full { margin-top: 16px; }
    /* Image upload in drawer */
    .order-drawer .image-upload-box.main-upload { height: 130px !important; }
    .order-drawer .gallery-upload-box { height: 68px !important; }
    /* Textarea height */
    .order-drawer textarea { min-height: 80px; max-height: 130px; }
}

/* ── Customer slider: no zoom, content always fits ──────────────────────── */
#customerSlider .profile-main-info {
    text-align: center;
    padding: 8px 0 20px;
}
#customerSlider .user-avatar.large {
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
    margin: 0 auto 10px;
    flex-shrink: 0;
}
#customerSlider .profile-main-info h4 {
    font-size: 1.05rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 4px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
#customerSlider .profile-main-info p {
    font-size: 0.8rem;
    color: #999;
}
#customerSlider .stats-grid-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
#customerSlider .mini-stat {
    padding: 10px;
    text-align: center;
    background: #fdfcfb;
    border: 1px solid #f0ece7;
    border-radius: 6px;
    overflow: hidden;
}
#customerSlider .mini-stat span {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}
#customerSlider .mini-stat strong {
    font-size: 1rem;
    word-break: break-all;
}
#customerSlider .detail-text {
    font-size: 0.88rem;
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* ── Coupons table: independent horizontal scroll ───────────────────────── */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    /* Critical: this creates a new scroll context */
    display: block;
    width: 100%;
}
.table-scroll-wrapper::-webkit-scrollbar { height: 5px; }
.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #d4cdc8;
    border-radius: 3px;
}

.coupons-table {
    min-width: 500px;
    width: 100%;
    table-layout: auto;
}
.coupons-table th,
.coupons-table td {
    white-space: nowrap;
    padding: 10px 14px;
}

/* Settings pane and content must NOT clip children's scroll */
.settings-content {
    overflow-x: visible !important;
    min-width: 0;
}
#coupons {
    overflow-x: visible;
}

/* ── Admin Products page ────────────────────────────────────────────────── */

/* Table scroll wrapper */
.admin-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    width: 100%;
    display: block;
}
.admin-table-scroll::-webkit-scrollbar { height: 5px; }
.admin-table-scroll::-webkit-scrollbar-thumb {
    background: #d4cdc8;
    border-radius: 3px;
}
.admin-table-scroll .admin-table { min-width: 560px; }

/* Categories grid — index-page style, smaller cards */
.admin-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 600px) {
    .admin-categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}
@media (max-width: 380px) {
    .admin-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.category-card-admin {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: default;
}
.category-card-admin:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.09);
    transform: translateY(-1px);
}
.cat-card-img {
    height: 80px;
    overflow: hidden;
    background: #f5f2ed;
}
.cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.category-card-admin > div:nth-child(2) {
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 8px 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.category-card-admin > div:last-child {
    display: flex;
    gap: 4px;
    padding: 0 8px 8px;
}
.category-card-admin .small-action-btn,
.category-card-admin .remove-btn {
    font-size: 0.72rem;
    padding: 4px 8px;
    flex: 1;
    text-align: center;
}

.cat-card-add {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    border: 2px dashed #e0ddd7;
    border-radius: 8px;
    background: #fdfcfb;
    transition: border-color 0.2s;
}
.cat-card-add:hover { border-color: var(--accent); }
.cat-card-add .btn-signup { font-size: 0.82rem; margin: 0; }

/* Products section header */
.products-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.products-section-header h3 { margin: 0; }

/* Bulk toolbar */
.bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #fdfcfb;
    border-radius: 8px;
    border: 1px solid #f0ece7;
}
.bulk-toolbar label { font-weight: 600; font-size: 0.83rem; white-space: nowrap; }
.bulk-toolbar select {
    padding: 6px 10px;
    border: 1px solid #e0ddd7;
    border-radius: 6px;
    font-size: 0.83rem;
}
.bulk-stock-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.bulk-stock-group input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #e0ddd7;
    border-radius: 6px;
    font-size: 0.83rem;
}
@media (max-width: 640px) {
    .bulk-toolbar { flex-direction: column; align-items: stretch; }
    .bulk-toolbar select,
    .bulk-toolbar label { width: 100%; }
    .bulk-stock-group { margin-left: 0; width: 100%; }
    .bulk-stock-group input { flex: 1; width: auto; }
    .products-section-header { flex-direction: column; align-items: stretch; }
    .products-section-header .btn-signup { width: 100%; text-align: center; }
}

/* ── Product slider on mobile ───────────────────────────────────────────── */
@media (max-width: 600px) {
    #productSlider .image-upload-box.main-upload { height: 120px !important; }
    #productSlider .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    #productSlider .gallery-upload-box { height: 64px !important; }
    #productSlider #productSubmitBtn { width: 100%; margin-top: 16px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   COMPREHENSIVE OVERFLOW / MOBILE FIXES  — appended patch
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Global: prevent any page-level horizontal scroll ─────────────────── */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ── 2. Admin main content: never wider than viewport ───────────────────── */
.admin-main {
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

/* ── 3. All admin content boxes: keep inside parent ────────────────────── */
.admin-content-box {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;  /* let inner scroll wrappers handle overflow */
}

/* ── 4. Coupons section: proper bounded scroll ───────────────────────────── */
#coupons.settings-pane {
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}
.coupon-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
}
.coupon-table-container::-webkit-scrollbar { height: 5px; }
.coupon-table-container::-webkit-scrollbar-thumb { background: #d4cdc8; border-radius: 3px; }
.coupon-table-container .coupons-table {
    min-width: 480px;
    width: 100%;
    table-layout: auto;
}
.coupon-table-container .coupons-table th,
.coupon-table-container .coupons-table td {
    white-space: nowrap;
    padding: 10px 14px;
}

/* ── 5. Settings pane/content: no clipping ──────────────────────────────── */
.settings-pane {
    max-width: 100%;
    box-sizing: border-box;
}
.settings-content {
    min-width: 0;
    overflow-x: hidden;
}
.settings-container {
    max-width: 100%;
    box-sizing: border-box;
}

/* ── 6. Admin products page: all content fits mobile ────────────────────── */
.bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    max-width: 100%;
    box-sizing: border-box;
}
.bulk-toolbar select,
.bulk-toolbar input[type="number"] {
    max-width: 100%;
    box-sizing: border-box;
}
.admin-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* ── 7. Product form inputs — never overflow drawer ─────────────────────── */
.order-drawer input,
.order-drawer select,
.order-drawer textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* ── 8. Admin categories grid — responsive ──────────────────────────────── */
.admin-categories-grid {
    max-width: 100%;
    box-sizing: border-box;
}

/* ── 9. Tables globally: horizontal scroll instead of overflow ──────────── */
.admin-content-box .admin-table {
    min-width: 480px;
}
/* Wrap existing non-scroll tables on mobile */
@media (max-width: 900px) {
    .admin-content-box {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-main {
        padding: 12px 10px;
    }
    /* bulk toolbar vertical stack */
    .bulk-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .bulk-toolbar select,
    .bulk-toolbar input,
    .bulk-toolbar button {
        width: 100%;
        box-sizing: border-box;
    }
    .bulk-stock-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }
}
@media (max-width: 600px) {
    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }
    .settings-container {
        padding: 10px;
    }
    .form-row {
        flex-direction: column;
    }
    .form-row .form-group {
        width: 100%;
    }
}

/* ── 10. Category slider ────────────────────────────────────────────────── */
/* Uses the same .order-drawer styles already defined — no extra needed     */
/* Override any lingering inline categoryFormBox if present */
#categoryFormBox { display: none !important; }

/* ── 11. Coupon status display inside drawer ────────────────────────────── */
#couponStatusDisplay {
    margin-top: 4px;
}

/* ── 12. Ensure products section header stays in row ───────────────────── */
.products-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

/* ── 13. Fix orders table / customers table overflow on mobile ─────────── */
@media (max-width: 900px) {
    .admin-content-box table {
        min-width: 520px;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   FINAL AUTHORITATIVE PATCH — Category Cards & Drawer Mobile Fix
   All rules use !important to win over the many conflicting definitions
   ══════════════════════════════════════════════════════════════════════ */

/* ── Category grid: compact, always 2-col on mobile ──────────────────── */
.admin-categories-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.category-card-admin {
    background: #fff !important;
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: box-shadow 0.2s !important;
    width: auto !important;          /* cancel any 100% !important from old rules */
    min-width: 0 !important;
    box-sizing: border-box !important;
}
.category-card-admin:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08) !important; }

.cat-card-img {
    height: 72px !important;
    overflow: hidden !important;
    background: #f5f2ed !important;
}
.cat-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Category card name text */
.category-card-admin > div:nth-child(2) {
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    padding: 5px 8px 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #333 !important;
}

/* Category card buttons row */
.category-card-admin > div:last-child {
    display: flex !important;
    gap: 4px !important;
    padding: 0 6px 7px !important;
}
.category-card-admin .small-action-btn,
.category-card-admin .remove-btn {
    font-size: 0.7rem !important;
    padding: 3px 6px !important;
    flex: 1 !important;
    text-align: center !important;
    min-width: 0 !important;
}

/* Add-category placeholder card */
.cat-card-add {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 72px !important;
    border: 2px dashed #e0ddd7 !important;
    border-radius: 8px !important;
    background: #fdfcfb !important;
    box-sizing: border-box !important;
}
.cat-card-add .btn-signup {
    font-size: 0.78rem !important;
    margin: 0 !important;
    padding: 6px 10px !important;
}

/* Mobile: force exactly 2 columns */
@media (max-width: 767px) {
    .admin-categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .cat-card-img { height: 64px !important; }
}

/* ── Drawer: single source of truth, all screens ─────────────────────── */

/* Base closed state */
.order-drawer {
    position: fixed !important;
    top: 0 !important;
    right: -100vw !important;          /* fully off-screen to the right */
    width: min(460px, 100vw) !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    background: #fff !important;
    z-index: 5000 !important;
    box-shadow: -4px 0 20px rgba(0,0,0,0.10) !important;
    transition: right 0.32s cubic-bezier(0.25, 1, 0.5, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Open state */
.order-drawer.active {
    right: 0 !important;
}

/* Overlay */
.order-drawer-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.25) !important;
    backdrop-filter: blur(2px) !important;
    z-index: 2500 !important;
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}
.order-drawer-overlay.active {
    display: block !important;
    opacity: 1 !important;
}

/* Header: always sticky */
.order-drawer > .drawer-header {
    flex-shrink: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 18px 22px !important;
    border-bottom: 1px solid #eee !important;
    background: #fff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
    width: 100% !important;
}
.order-drawer > .drawer-header h3 {
    font-family: 'Playfair Display', serif !important;
    font-size: 1rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.order-drawer > .drawer-header i.fa-xmark {
    cursor: pointer !important;
    font-size: 1.1rem !important;
    color: #999 !important;
    padding: 4px !important;
    flex-shrink: 0 !important;
}

/* Content: scrollable, never clips */
.order-drawer > .drawer-content {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 20px 22px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Everything inside drawer: never wider than the drawer */
.order-drawer * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}
/* Exception: don't crush icons or checkboxes */
.order-drawer i,
.order-drawer input[type="checkbox"],
.order-drawer input[type="radio"] {
    max-width: none !important;
}

/* Form inputs inside drawer: full width */
.order-drawer input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.order-drawer select,
.order-drawer textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 0.9rem !important;
}

/* form-row inside drawer: side by side on wider screens, stack on narrow */
.order-drawer .form-row {
    display: flex !important;
    gap: 12px !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
}
.order-drawer .form-row .form-group {
    flex: 1 1 120px !important;
    min-width: 0 !important;
}

/* Mobile: full-width drawer, tighter padding */
@media (max-width: 600px) {
    .order-drawer {
        width: 100vw !important;
        right: -100vw !important;
    }
    .order-drawer.active { right: 0 !important; }

    .order-drawer > .drawer-header {
        padding: 14px 16px !important;
    }
    .order-drawer > .drawer-content {
        padding: 14px 16px !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Stack all form rows on small screens */
    .order-drawer .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* Drawer action buttons: stack vertically */
    .order-drawer .drawer-actions-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .order-drawer .drawer-actions-row .btn-action {
        width: 100% !important;
    }

    /* Image upload boxes: sensible fixed heights */
    .order-drawer .image-upload-box.main-upload {
        height: 120px !important;
    }
    .order-drawer .gallery-upload-box {
        height: 64px !important;
    }

    /* Submit button */
    .order-drawer .btn-shop.btn-full {
        margin-top: 14px !important;
        width: 100% !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   ADMIN CATEGORY CARDS — match homepage .category-card style exactly
   Overrides ALL previous admin-categories-grid / category-card-admin rules
   ══════════════════════════════════════════════════════════════════════ */

.admin-categories-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ── Each card: same pattern as homepage category-card ── */
.category-card-admin {
    text-align: center !important;
    cursor: default !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    width: auto !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    transition: none !important;
}
.category-card-admin:hover {
    box-shadow: none !important;
    transform: none !important;
}

/* Square image container — exactly like .category-img-container */
.cat-card-img {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
    border: 1px solid rgba(0,0,0,0.04) !important;
    margin-bottom: 8px !important;
    display: block !important;
}
.cat-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 0 !important;
    transition: transform 0.5s ease !important;
}
.category-card-admin:hover .cat-card-img img {
    transform: scale(1.05) !important;
}

/* Category name — like homepage h3 */
.category-card-admin > div:nth-child(2) {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: var(--text) !important;
    padding: 0 0 6px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
}

/* Edit / Delete buttons row — small, centred below name */
.category-card-admin > div:last-child {
    display: flex !important;
    gap: 4px !important;
    padding: 0 !important;
    justify-content: center !important;
}
.category-card-admin .small-action-btn,
.category-card-admin .remove-btn {
    font-size: 0.68rem !important;
    padding: 3px 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-align: center !important;
    max-width: 60px !important;
}

/* Add-category placeholder tile */
.cat-card-add {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    aspect-ratio: 1 / 1 !important;
    min-height: unset !important;
    height: auto !important;
    border: 2px dashed #d4cdc8 !important;
    border-radius: 10px !important;
    background: #fdfcfb !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s !important;
}
.cat-card-add:hover { border-color: var(--accent) !important; }
.cat-card-add .btn-signup {
    font-size: 0.75rem !important;
    padding: 6px 10px !important;
    margin: 0 !important;
}

/* ── Responsive breakpoints ── */
@media (max-width: 900px) {
    .admin-categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 600px) {
    .admin-categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    /* Cancel old width:100% !important from legacy rules on mobile */
    .category-card-admin {
        width: auto !important;
    }
}

/* ============================================================
   FIX PATCHES — Password fields, Checkboxes, Settings Nav
   ============================================================ */

/* Password field wrapper */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}
.password-field input[type="password"],
.password-field input[type="text"] {
    flex: 1;
    padding-right: 44px !important;
}
.pw-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.pw-toggle:hover { color: #333; }

/* Checkbox groups — checkbox always left of text */
.checkbox-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
}
.checkbox-group input[type="checkbox"] {
    flex-shrink: 0;
    margin: 3px 0 0 0 !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer;
    accent-color: var(--accent, #9a8272);
}
.checkbox-group .check-label {
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
}

/* Settings nav — clean sidebar, all items visible */
.settings-container {
    display: flex !important;
    gap: 24px !important;
    padding: 0 24px 24px !important;
    align-items: flex-start !important;
}
.settings-nav {
    width: 210px !important;
    flex-shrink: 0 !important;
    background: #fff !important;
    padding: 10px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05) !important;
    position: sticky !important;
    top: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}
.settings-nav .s-nav-btn {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    text-align: left !important;
    padding: 10px 12px !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    border-radius: 7px !important;
    font-size: 0.87rem !important;
    font-family: 'Inter', sans-serif !important;
    color: #555 !important;
    font-weight: 400 !important;
    transition: background 0.15s, color 0.15s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}
.settings-nav .s-nav-btn i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.82rem;
    opacity: 0.7;
}
.settings-nav .s-nav-btn:hover {
    background: #f5f2ef !important;
    color: #333 !important;
}
.settings-nav .s-nav-btn.active {
    background: #f0ece8 !important;
    color: #6b5344 !important;
    font-weight: 600 !important;
    border-left: 3px solid var(--accent, #9a8272) !important;
}
.settings-nav .s-nav-btn.active i {
    opacity: 1;
}
.settings-content {
    flex: 1 !important;
    min-width: 0 !important;
}
.settings-pane {
    background: #fff !important;
    padding: 24px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05) !important;
}
.settings-content .settings-pane { display: none !important; }
.settings-content .settings-pane.active { display: block !important; }

/* Admin header — remove the extra gap */
.admin-header {
    padding: 20px 24px 16px !important;
}

@media (max-width: 768px) {
    .settings-container {
        flex-direction: column !important;
        padding: 0 16px 16px !important;
    }
    .settings-nav {
        width: 100% !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        position: static !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
    }
    .settings-nav .s-nav-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        border-left: none !important;
        border-bottom: 2px solid transparent !important;
    }
    .settings-nav .s-nav-btn.active {
        border-left: none !important;
        border-bottom: 2px solid var(--accent, #9a8272) !important;
    }
    .settings-nav::-webkit-scrollbar { height: 3px; }
    .settings-nav::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
}
