
:root {
    --bg: #020617;
    --bg-elevated: #020617;
    --bg-card: #020617;
    --bg-soft: #020617;
    --border-subtle: #1f2937;
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.18);
    --accent-strong: #4ade80;
    --text-primary: #f9fafb;
    --text-muted: #9ca3af;
    --text-soft: #6b7280;
    --danger: #f97373;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.75);
    --radius-lg: 1rem;
    --radius-pill: 999px;
    --nav-height: 64px;
}

/* LIGHT THEME — CLEAN WHITE NEUTRAL */
:root[data-theme="light"] {
    --bg: #ffffff;               /* pure clean white */
    --bg-elevated: #fdfdfd;
    --bg-card: #ffffff;
    --bg-soft: #f3f4f6;          /* soft grey */

    --border-subtle: #e5e7eb;

    --accent: #22c55e;           /* your neon green but softer */
    --accent-soft: rgba(34,197,94,0.15);
    --accent-strong: #16a34a;

    --text-primary: #111827;     /* deep navy grey */
    --text-muted: #4b5563;
    --text-soft: #6b7280;

    --danger: #dc2626;

    --shadow-soft: 0 8px 20px rgba(0,0,0,0.05);
}


/* Light mode navbar */
:root[data-theme="light"] .navbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}


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

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

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #020617 0, var(--bg) 42%, #000 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Light Mode: Clean background */
html[data-theme="light"] body {
    background: #ffffff !important;
}
/* Dark Mode: Keep the gradient */
html[data-theme="dark"] body {
    background: radial-gradient(circle at top, #020617 0%, #0a1120 40%, #000000 100%) !important;
}



/* Layout helpers */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-inline: 1.5rem;
}

/* NAVBAR */

.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(18px);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(8, 47, 73, 0.96));
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.navbar-inner {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 0%, #22c55e, transparent 60%);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.5);
}

.brand-text {
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Nav links */

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.15s ease;
}

.nav-links a:hover {
    color: var(--accent-strong);
    background-color: rgba(148, 163, 184, 0.12);
    transform: translateY(-1px);
}

.nav-links .nav-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #020617;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.5);
}

.nav-links .nav-primary:hover {
    transform: translateY(-1px) scale(1.01);
}

/* Navbar actions */

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Icon buttons */

.icon-button {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.35rem 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.icon-button:hover {
    background: rgba(30, 64, 175, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
    border-color: rgba(96, 165, 250, 0.8);
}

.icon-burger {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background-color: var(--text-primary);
}
.icon-burger::before,
.icon-burger::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background-color: var(--text-primary);
}
.icon-burger::before { top: -5px; }
.icon-burger::after { top: 5px; }

.theme-toggle-icon {
    font-size: 1.1rem;
}

/* Sidebar toggle only visible on mobile */
.sidebar-toggle {
    display: none;
}

/* SEARCH BAR */

.search-container {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 55%);
}

.search-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem 1rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-bar input[type="text"],
.filter-bar input[type="number"],
.filter-bar select {
    min-width: 0;
    flex: 1 1 130px;
}

/* Buttons & inputs */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    font: inherit;
    color: var(--text-primary);
    background-color: rgba(15, 23, 42, 0.85);
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.55rem 0.75rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.08s ease;
}

:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] input[type="password"],
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
    background-color: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.7);
    transform: translateY(-1px);
}

.btn-primary,
button[type="submit"] {
    border-radius: 999px;
    border: none;
    padding: 0.5rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #020617;
    box-shadow: 0 14px 30px rgba(34, 197, 94, 0.48);
    transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.12s ease;
}

.btn-primary:hover,
button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(34, 197, 94, 0.75);
    filter: brightness(1.03);
}

/* MAIN LAYOUT */

.layout {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 0 2.25rem;
}

/* Sidebar */

.sidebar {
    background: radial-gradient(circle at top, rgba(15, 118, 110, 0.4), rgba(15, 23, 42, 0.96) 40%, #020617);
    border-radius: 1.2rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    box-shadow: var(--shadow-soft);
    padding: 1rem 0.9rem 1.1rem;
    position: relative;
    overflow: hidden;
}

.sidebar-header {
    padding: 0 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    margin-bottom: 0.6rem;
}

.sidebar-hello {
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--text-soft);
    margin-top: 0.15rem;
}

.side-nav {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 0.4rem;
    padding-left: 0.15rem;
    margin-bottom: 0.75rem;
}

.category-group + .category-group {
    margin-top: 0.35rem;
}

.category-title a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.45);
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
}

.category-title a:hover {
    background: rgba(8, 47, 73, 0.9);
    border-color: var(--accent-strong);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
    transform: translateY(-1px);
}

.subcategory-list {
    list-style: none;
    padding-left: 1rem;
    margin: 0.3rem 0 0.25rem;
}

.subcategory-list li a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--text-soft);
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.subcategory-list li a::before {
    content: "•";
    margin-right: 0.32rem;
    color: rgba(148, 163, 184, 0.85);
}

.subcategory-list li a:hover {
    color: var(--accent-strong);
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-1px);
}

.back-btn {
    width: 100%;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.back-btn:hover {
    background: rgba(15, 23, 42, 0.9);
    color: var(--accent-strong);
    border-color: var(--accent-strong);
}

/* Content area */

.content-area {
    min-width: 0;
}

/* Page header */

.page-header {
    margin-bottom: 0.75rem;
}

.page-title {
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 1.6rem;
    margin: 0 0 0.15rem;
}

.page-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-soft);
}

/* Sections */

.category-section {
    margin-top: 1.15rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem;
}

.section-title a {
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
}

.section-title a:hover {
    color: var(--accent-strong);
}

/* Cards & grids */

.card {
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 60%), var(--bg-card);
    border-radius: 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: var(--shadow-soft);
    padding: 0.9rem 1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0.4rem;
}

.item-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.4rem;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 55%), var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    min-height: 210px;
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.18s ease, background-position 0.25s ease;
}

.item-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(34, 197, 94, 0.15), transparent 55%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.item-card:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 26px 55px rgba(15, 23, 42, 0.95);
    border-color: rgba(74, 222, 128, 0.9);
}

.item-card:hover::before {
    opacity: 1;
}

.card-media {
    height: 130px;
    overflow: hidden;
    border-bottom: 1px solid rgba(31, 41, 55, 0.7);
}

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

.card-body {
    padding: 0.8rem 0.9rem 0.9rem;
}

.item-title {
    font-size: 1.02rem;
    margin: 0 0 0.3rem;
}

.item-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.item-title a:hover {
    color: var(--accent-strong);
}

.item-description {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-soft);
}

.item-meta {
    margin: 0.45rem 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.price {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--accent-strong);
}

/* Pills */

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    white-space: nowrap;
}

.pill-soft {
    background-color: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

:root[data-theme="light"] .pill-soft {
    background-color: #e5e7eb;
}

.pill-outline {
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: var(--text-muted);
}

/* Empty state */

.empty-state {
    margin-top: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-soft);
}

/* Tables - for any legacy pages still using them */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.86rem;
    background-color: rgba(15, 23, 42, 0.9);
    border-radius: 0.9rem;
    overflow: hidden;
}

thead {
    background: rgba(15, 23, 42, 0.96);
}

thead th {
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(31, 41, 55, 0.95);
}

tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.9);
}

tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.85);
}

/* Forms / generic form layout */

.form {
    max-width: 480px;
    padding: 1.1rem 1.25rem;
    border-radius: 1.1rem;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 55%), var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: var(--shadow-soft);
}

.form label {
    display: block;
    font-size: 0.85rem;
    margin: 0.45rem 0 0.2rem;
}

.form input,
.form textarea,
.form select {
    width: 100%;
}

.form button {
    margin-top: 0.8rem;
}

/* Alerts */

.alert {
    padding: 0.55rem 0.8rem;
    border-radius: 0.8rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.alert-danger {
    background-color: rgba(220, 38, 38, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.8);
}

.alert-success {
    background-color: rgba(22, 163, 74, 0.18);
    color: #4ade80;
    border: 1px solid rgba(52, 211, 153, 0.85);
}

/* Badges */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    padding-inline: 0.3rem;
    height: 1.15rem;
    border-radius: 999px;
    background-color: var(--accent);
    color: #020617;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

/* Footer */

.footer {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding: 0.9rem 0 1.1rem;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617 40%, #000 100%);
}

.footer-inner {
    font-size: 0.82rem;
    color: var(--text-soft);
}

/* Utility */

a {
    color: var(--accent-strong);
}

a:hover {
    color: var(--accent);
}

/* RESPONSIVE */

.nav-toggle {
    display: none;
}

@media (max-width: 900px) {
    .navbar-inner {
        gap: 0.8rem;
    }

    .nav-links {
        position: absolute;
        inset-inline: 0.75rem;
        top: calc(var(--nav-height) + 0.4rem);
        background-color: rgba(15, 23, 42, 0.96);
        border-radius: 1rem;
        border: 1px solid rgba(148, 163, 184, 0.5);
        flex-direction: column;
        padding: 0.6rem 0.5rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    .nav-links.nav-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-links a {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.2rem;
    }

    .sidebar {
        position: fixed;
        top: calc(var(--nav-height) + 0.75rem);
        bottom: 1.1rem;
        left: 0.75rem;
        width: min(80vw, 280px);
        max-width: 100%;
        transform: translateX(-120%);
        transition: transform 0.22s ease;
        z-index: 45;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.7);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
        z-index: 40;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .search-form {
        padding-inline: 1rem;
    }
}

@media (max-width: 640px) {
    .card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar input,
    .filter-bar select,
    .filter-bar button {
        width: 100%;
    }

    .page-title {
        font-size: 1.35rem;
    }
}

/* Calendar */
.calendars {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}
.calendar {
    padding:1rem;
}
.calendar-month {
    font-weight:600;
    margin-bottom:0.5rem;
}
.calendar-grid {
    display:grid;
    grid-template-columns: repeat(7,1fr);
    gap:4px;
}
.cal-day {
    height:32px;
    border-radius:6px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:0.8rem;
    color:var(--text-primary);
}
.cal-day.available {
    background-color:rgba(34,197,94,0.18);
    border:1px solid var(--accent);
}
.cal-day.booked {
    background-color:rgba(239,68,68,0.18);
    border:1px solid #ef4444;
}
.cal-day.empty {
    background:transparent;
}


/* === Sidebar behavior overrides (Option C: always hidden, open via hamburger) === */
.layout {
    flex: 1 1 auto;
    display: block;
    padding: 1.5rem 0 2.25rem;
}

/* Sidebar is off-canvas on ALL screen sizes */
.sidebar {
    position: fixed;
    top: calc(var(--nav-height) + 0.75rem);
    bottom: 1.1rem;
    left: 0.75rem;
    width: min(320px, 80vw);
    max-width: 100%;
    transform: translateX(-120%);
    z-index: 45;
}

/* Overlay always available */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 40;
}

body.sidebar-open .sidebar {
    transform: translateX(0);
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar hamburger visible on all devices */
.sidebar-toggle {
    display: inline-flex;
}

/* Light theme sidebar readability */
:root[data-theme="light"] .sidebar {
    background: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}

:root[data-theme="light"] .sidebar-header {
    border-bottom: 1px solid #e5e7eb;
}

:root[data-theme="light"] .category-title a {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

:root[data-theme="light"] .subcategory-list li a {
    color: #374151;
}

:root[data-theme="light"] .subcategory-list li a::before {
    color: #9ca3af;
}

/* === Calendar styling (preserve original behavior: green = available, strikethrough = booked) === */
.calendars {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
}

.calendar {
    background-color: var(--bg-card);
    padding: 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.9rem;
    min-width: 260px;
}

:root[data-theme="light"] .calendar {
    background-color: #ffffff;
    border-color: #e5e7eb;
}

.calendar h4 {
    text-align: center;
    margin: 0.4rem 0 0.6rem;
    font-size: 0.9rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.day {
    text-align: center;
    padding: 0.25rem 0.1rem;
    border-radius: 0.45rem;
    font-size: 0.75rem;
}

.day span,
.day .booked-day {
    display: inline-block;
    min-width: 1.45rem;
    line-height: 1.45rem;
    border-radius: 999px;
}

/* Available dates = green pill */
.day.available span {
    background-color: rgba(34, 197, 94, 0.2);
    color: var(--accent-strong);
}

:root[data-theme="light"] .day.available span {
    background-color: #d4edda;
    color: #166534;
}

/* Booked dates = line-through, muted */
.day.booked span,
.day .booked-day {
    color: var(--text-soft);
    text-decoration: line-through;
}

/* Empty cells transparent */
.day.empty {
    background-color: transparent;
}

/* === Image gallery & detail image styling (for item detail page) === */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.gallery-img {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background-color: rgba(15, 23, 42, 0.6);
}

:root[data-theme="light"] .gallery-img {
    background-color: #f9fafb;
}

.detail-img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    display: block;
    margin: 0.75rem 0 0.9rem;
}

/* Make item-detail use card styling nicely */
.item-detail.card {
    margin-top: 0.5rem;
}

/* === Mobile: Hide min/max/location filters === */
@media (max-width: 640px) {
    input[name="min_price"],
    input[name="max_price"],
    input[name="location"],
    input[name="category"] {
        display: none !important;
    }
}

/* === MOBILE: Perfect 3-Element Layout (No Scroll, No Cutoff) === */
@media (max-width: 640px) {

    .filter-bar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    /* Hide category dropdown fully */
    .filter-bar select[name="category"] {
        display: none !important;
    }

    /* Search input (takes most of the space) */
    .filter-bar input[name="q"] {
        flex: 1 1 60% !important;     /* majority of width */
        min-width: 0 !important;      /* allow shrinking */
    }

    /* Sort dropdown (auto width but allowed to shrink) */
    .filter-bar select[name="sort"] {
        flex: 0 1 20% !important;     /* small but flexible */
        min-width: 0 !important;
        white-space: nowrap !important;
    }

    /* Search button (compact fixed width but shrinkable) */
    .filter-bar button {
        flex: 0 1 20% !important;
        min-width: 0 !important;
        padding: 8px 12px !important;
        white-space: nowrap !important;
    }
}
