/* =============================================
   Mithila Art Platform — app.css
   Mobile-first, Bootstrap 5.3 extended
   ============================================= */

/* =====================
   Design Tokens
   ===================== */
:root {
  --saffron:       #e67e22;
  --saffron-dark:  #ca6f1e;
  --maroon:        #922b21;
  --cream:         #fdf6ec;
  --text-dark:     #2c3e50;

  /* Fluid typography — scales from 320px phone to 1440px desktop */
  --fs-xs:   clamp(0.72rem,  1.8vw,  0.8rem);
  --fs-sm:   clamp(0.8rem,   2vw,    0.875rem);
  --fs-base: clamp(0.9rem,   2.5vw,  1rem);
  --fs-md:   clamp(1rem,     3vw,    1.2rem);
  --fs-lg:   clamp(1.15rem,  3.5vw,  1.5rem);
  --fs-xl:   clamp(1.4rem,   4.5vw,  2rem);
  --fs-2xl:  clamp(1.75rem,  6vw,    3rem);

  /* Fluid spacing */
  --sp-xs: clamp(0.35rem, 1.5vw, 0.5rem);
  --sp-sm: clamp(0.6rem,  2vw,   1rem);
  --sp-md: clamp(1rem,    4vw,   1.5rem);
  --sp-lg: clamp(1.5rem,  5vw,   2.5rem);
  --sp-xl: clamp(2rem,    8vw,   4rem);

  /* Layout */
  --navbar-h: 60px;
  --tap-min:  44px;
  --r-sm:     6px;
  --r-md:     10px;
  --r-lg:     16px;
}

/* =====================
   Reset / Base
   ===================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Lato', sans-serif;
  color: var(--text-dark);
  background: #fff;
  font-size: var(--fs-base);
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  line-height: 1.25;
}

img { max-width: 100%; height: auto; display: block; }

/* =====================
   Accessibility
   ===================== */
:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
  border-radius: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* =====================
   Navbar
   ===================== */
.navbar {
  min-height: var(--navbar-h);
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  color: var(--maroon) !important;
  font-weight: 700;
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-brand span { color: var(--saffron); }

.navbar-toggler {
  border: none;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0.2rem 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(230,126,34,0.25);
  outline: none;
}

.navbar .nav-link {
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
}

/* =====================
   Buttons (touch-safe)
   ===================== */
.btn {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-sm {
  min-height: 36px;
  font-size: var(--fs-sm);
}

.btn-saffron {
  background-color: var(--saffron);
  border-color: var(--saffron);
  color: #fff;
}
.btn-saffron:hover {
  background-color: var(--saffron-dark);
  border-color: var(--saffron-dark);
  color: #fff;
}
.btn-saffron:active {
  background-color: #a85d10;
  border-color: #a85d10;
  color: #fff;
}

/* =====================
   Banner Carousel
   ===================== */
.banner-img {
  width: 100%;
  height: clamp(200px, 40vw, 500px);
  object-fit: cover;
}

/* =====================
   Hero Section
   ===================== */
.hero-section {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--saffron) 100%);
  color: #fff;
  padding: clamp(3rem, 10vw, 7rem) 0;
  text-align: center;
}

.hero-section h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-section .lead {
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  opacity: 0.92;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* =====================
   Section Titles
   ===================== */
.section-title {
  font-size: var(--fs-xl);
  color: var(--maroon);
  position: relative;
  margin-bottom: var(--sp-lg);
  line-height: 1.2;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--saffron);
  margin-top: 8px;
}

/* =====================
   Category Badges
   ===================== */
.badge-category {
  background-color: var(--saffron);
  color: #fff;
  font-size: var(--fs-xs);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* =====================
   Artwork Cards
   ===================== */
.artwork-card {
  border: none;
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Hover lift only for pointer devices (not touch) */
@media (hover: hover) and (pointer: fine) {
  .artwork-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.13);
  }
}

.artwork-card .card-img-top {
  height: clamp(160px, 28vw, 260px);
  object-fit: cover;
  width: 100%;
}

.artwork-card .card-body {
  padding: var(--sp-sm);
  background: var(--cream);
}

.artwork-card .price {
  color: var(--maroon);
  font-weight: 700;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}

.artwork-card .artist {
  color: #777;
  font-size: var(--fs-sm);
}

/* =====================
   Gallery Filter Pills
   ===================== */
.filter-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.filter-scroll-wrap::-webkit-scrollbar { display: none; }

.filter-pill-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  min-width: max-content;
}

@media (min-width: 768px) {
  .filter-pill-row {
    flex-wrap: wrap;
    min-width: auto;
  }
}

/* =====================
   Artwork Detail Image
   ===================== */
.artwork-detail-img {
  height: clamp(260px, 50vw, 480px);
  object-fit: contain;
  background: #f8f9fa;
  width: 100%;
}

/* =====================
   Cart / Checkout Sticky Summary
   ===================== */
.sticky-summary {
  position: sticky;
  top: calc(var(--navbar-h) + 12px);
}

/* =====================
   Status Badges (admin)
   ===================== */
.status-PUBLISHED { background-color: #198754; color: #fff; }
.status-DRAFT     { background-color: #6c757d; color: #fff; }
.status-SOLD_OUT  { background-color: #dc3545; color: #fff; }
.status-ARCHIVED  { background-color: #343a40; color: #fff; }

/* =====================
   Admin Layout
   ===================== */
.admin-sidebar {
  background-color: #1a1a2e;
  min-height: 100vh;
  flex-direction: column;
}

.admin-sidebar .brand {
  padding: 1rem 1rem;
  background: #16213e;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--saffron);
  display: flex;
  align-items: center;
  text-decoration: none;
  min-height: 58px;
}

.admin-sidebar .nav-link,
.admin-offcanvas .nav-link {
  color: #adb5bd;
  padding: 0.55rem 1rem;
  border-radius: var(--r-sm);
  margin: 2px 8px;
  font-size: 0.875rem;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active,
.admin-offcanvas .nav-link:hover,
.admin-offcanvas .nav-link.active {
  background-color: rgba(230,126,34,0.15);
  color: var(--saffron);
}

.admin-sidebar .nav-link i,
.admin-offcanvas .nav-link i { width: 20px; flex-shrink: 0; }

.admin-sidebar .nav-section,
.admin-offcanvas .nav-section {
  color: #6c757d;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.9rem 1rem 0.3rem;
}

/* On mobile/tablet: admin main fills full width (sidebar is hidden) */
@media (max-width: 991.98px) {
  .admin-main {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    flex: 0 0 100% !important;
  }
}

.admin-main {
  background-color: #f8f9fa;
  min-height: 100vh;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  min-height: 54px;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Mobile offcanvas sidebar (Bootstrap Offcanvas) */
.admin-offcanvas {
  width: 240px !important;
  background-color: #1a1a2e !important;
}

/* Mobile sidebar toggle button — injected by JS into every admin topbar */
.admin-sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-dark);
  padding: 0;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.admin-sidebar-toggle:hover { background: #f0f0f0; }

/* =====================
   Footer
   ===================== */
footer {
  background-color: #1a1a2e;
  color: #adb5bd;
}

footer a {
  color: #adb5bd;
  text-decoration: none;
  transition: color 0.15s ease;
}
footer a:hover { color: var(--saffron); }
footer li { padding: 3px 0; }

/* =====================
   Account Page Nav Links
   ===================== */
.account-nav a {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
}

/* =====================
   Mobile Section Spacing
   ===================== */
@media (max-width: 575.98px) {
  /* Reduce oversized padding on small phones */
  section.py-5, div.py-5 {
    padding-top: 2.25rem !important;
    padding-bottom: 2.25rem !important;
  }

  /* Tighter card body on small screens */
  .card-body.p-4, .card-body.p-md-5 {
    padding: 1.25rem !important;
  }

  /* Admin content area padding */
  .admin-main .p-4 {
    padding: 1rem !important;
  }
}

/* =====================
   Tables
   ===================== */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* =====================
   Print
   ===================== */
@media print {
  .navbar, footer, .btn { display: none !important; }
}
