/* =========================================
   1. THEME TOKENS (COLORS, RADIUS, SHADOW)
   ========================================= */

:root {
  /* Brand palette */
  --cx-primary:   #00985B;  /* Deep navy – brand primary */
  --cx-accent:    #071343;  /* Green */
  --cx-secondary: #071343;  /* Lime green */

  /* Backgrounds */
  --cx-bg:        #F5F5F5;  /* Page background */
  --cx-bg-soft:   #EFEFEF;  /* Soft sections */
  --cx-card-bg:   #FFFFFF;

  /* Text */
  --cx-text:      #00985B;
  --cx-muted:     #64748B;

  /* Lines & depth */
  --cx-border:    #E2E8F0;
  --cx-shadow:    0 2px 8px rgba(0,0,0,0.06);
  --cx-radius:    8px;
}

/* =========================================
   2. GLOBAL LAYOUT & FOOTER
   ========================================= */

body {
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cx-bg);
  color: var(--cx-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Public/customer layout */
.cx-public main {
  flex: 1 0 auto;
  background: var(--cx-card-bg);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
}

/* Footer sticks to bottom when content is short */
body > footer {
  margin-top: auto;
}

/* =========================================
   3. DASHBOARD LAYOUT + SIDEBAR
   (Admin / Vendor / Rider)
   ========================================= */

/* Shell = sidebar + main column */
.cx-dashboard-shell {
  flex: 1 0 auto;
  display: flex;
  min-height: 100vh;
  background: var(--cx-bg);
}

/* Sidebar column */
.cx-sidebar {
  width: 240px;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  background: #071343;
  color: #E2E8F0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--cx-primary) rgba(255,255,255,0.1);
  z-index: 1040;
}

.cx-sidebar::-webkit-scrollbar {
  width: 6px;
}
.cx-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--cx-primary);
  border-radius: 3px;
}

/* Brand row */
.cx-sidebar-brand {
  padding: 0.85rem 1rem;
  background: #071343;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

/* Sidebar nav */
.cx-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.4rem 0.8rem;
  gap: 3px;
  flex-grow: 1;
}

/* Nav items with icons */
.cx-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 2px 4px;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: #E2E8F0;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s;
}

.cx-nav-item .cx-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.cx-nav-item:hover {
  background: rgba(255,255,255,0.14);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Active item */
.cx-nav-item-active {
  background: #ffffff;
  color: #071343;
}
.cx-nav-item-active .cx-nav-icon {
  background: #071343;
  color: #ffffff;
}

/* Main column (topbar + page) */
.cx-main-wrapper {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top bar */
.cx-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #ffffff;
}

/* Dashboard main content area */
.cx-dashboard .cx-main {
  flex: 1 1 auto;
  background: var(--cx-bg);
}

/* =========================================
   4. TABLES, FORMS, BUTTONS, LINKS
   ========================================= */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th, td {
  padding: 6px 8px;
  border: 1px solid var(--cx-border);
  font-size: 13px;
}

th {
  background: #EDF2F7;
  text-align: left;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid var(--cx-border);
}

/* Base buttons */
button,
input[type="submit"] {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, var(--cx-accent), var(--cx-secondary));
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

button:hover,
input[type="submit"]:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Bootstrap primary override */
.btn-primary {
  background: linear-gradient(90deg, var(--cx-accent), var(--cx-secondary));
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Outline primary */
.btn-outline-primary {
  background: none;
  border-color: var(--cx-accent);
  color: var(--cx-accent);
}

.btn-outline-primary:hover {
  background: none;
  border-color: var(--cx-accent);
  color: var(--cx-accent);
  transform: translateY(-2px);
}

/* =========================================
   5. BADGES (STATUS & PAYMENT)
   ========================================= */

.cx-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
}

/* Order status */
.cx-badge-status-pending    { background:#FEFCBF; color:#744210; }
.cx-badge-status-accepted   { background:#C6F6D5; color:#22543D; }
.cx-badge-status-on_the_way { background:#BEE3F8; color:#2A4365; }
.cx-badge-status-completed  { background:#C6F6D5; color:#22543D; }
.cx-badge-status-canceled   { background:#FED7D7; color:#742A2A; }

/* Payment status */
.cx-badge-pay-unpaid               { background:#FED7D7; color:#742A2A; }
.cx-badge-pay-pending_verification { background:#FEFCBF; color:#744210; }
.cx-badge-pay-paid                 { background:#C6F6D5; color:#22543D; }

/* =========================================
   6. MARKETPLACE FILTERS & PRODUCT CARDS
   ========================================= */

.object-fit-cover {
  object-fit: cover;
}

/* Filter sidebar */
.cx-filter-sidebar .card-body {
  border-radius: var(--cx-radius);
}

.cx-filter-title {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--cx-text);
}

/* Category pills */
.cx-filter-pill,
.cx-filter-pill-active {
  border-radius: 999px;
  border: 1px solid var(--cx-border);
  background: #ffffff;
  color: var(--cx-text);
  font-size: 12px;
}

.cx-filter-pill:hover {
  border-color: var(--cx-accent);
  color: var(--cx-accent);
}

.cx-filter-pill-active {
  background: var(--cx-secondary);
  border-color: var(--cx-secondary);
  color: #ffffff;
}

/* Product cards */
.cx-product-card {
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.cx-product-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.09);
  transform: translateY(-2px);
}

/* Badges on product image */
.cx-product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 3;
}

.cx-product-badge-sale,
.cx-product-badge-hot {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #ffffff;
}

.cx-product-badge-sale {
  background: #e11d48;  /* red */
}

.cx-product-badge-hot {
  background: #071343;  /* navy */
}

/* =========================================
   7. CUSTOMER DASHBOARD – HERO & QUICK CARDS
   ========================================= */

.cx-dashboard-hero {
  background: linear-gradient(
    135deg,
    rgba(0, 152, 91, 0.12),
    rgba(0, 197, 105, 0.06)
  );
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.cx-hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--cx-muted);
}

.cx-hero-title {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--cx-text);
}

/* Quick action cards */
.cx-quick-card {
  border-radius: 16px;
  border: 1px solid rgba(100, 116, 139, 0.15);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}

.cx-quick-card .card-body {
  padding: 14px 10px;
}

.cx-quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0, 197, 105, 0.08);
  color: var(--cx-accent);
  font-size: 18px;
}

.cx-quick-title {
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--cx-text);
}

.cx-quick-card:hover {
  border-color: var(--cx-secondary);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* =========================================
   8. SERVICE REQUEST FORMS – SHARED STYLES
   ========================================= */

.cx-form-card {
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--cx-shadow);
  border: 1px solid rgba(100, 116, 139, 0.15);
}

.cx-form-card .card-body {
  padding: 16px 16px;
}

@media (min-width: 768px) {
  .cx-form-card .card-body {
    padding: 20px 22px;
  }
}

.cx-section-title {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cx-muted);
  margin-bottom: 4px;
}

.cx-section-subtitle {
  font-size: 13px;
  color: var(--cx-text);
  margin-bottom: 12px;
}

.cx-field-hint {
  font-size: 11px;
  color: var(--cx-muted);
}

.cx-form-group {
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .cx-form-group {
    margin-bottom: 16px;
  }
}

.cx-form-divider {
  border-top: 1px dashed var(--cx-border);
  margin: 16px 0;
}

.cx-form-card .form-label {
  font-size: 13px;
  color: var(--cx-text);
}

.cx-form-card .form-control,
.cx-form-card .form-select {
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--cx-border);
}

.cx-form-card .form-control:focus,
.cx-form-card .form-select:focus {
  border-color: var(--cx-accent);
  box-shadow: 0 0 0 1px rgba(0, 152, 91, 0.25);
}

.cx-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

@media (max-width: 575.98px) {
  .cx-form-actions .btn {
    flex: 1 1 100%;
  }
}

/* =========================================
   9. CART & CHECKOUT
   ========================================= */

.cx-cart-item {
  border-radius: 12px;
}

.cx-cart-thumb {
  width: 80px;
  flex-shrink: 0;
}

@media (max-width: 575.98px) {
  .cx-cart-thumb {
    width: 72px;
  }
}

.cx-cart-plus-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, var(--cx-accent), var(--cx-secondary));
  color: #ffffff;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.16);
}

.cx-cart-plus-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.24);
}

/* =========================================
   10. LANDING / PUBLIC TEXT COLOR
   ========================================= */

.cx-public {
  color: var(--cx-text);
}

.cx-public main {
  background: var(--cx-bg);
}

/* Hero on landing – only here we force white text */
.cx-landing-hero {
  color: #ffffff;
}
.cx-landing-hero h1,
.cx-landing-hero h2,
.cx-landing-hero p,
.cx-landing-hero .btn {
  color: inherit;
}

/* =========================================
   11. RESPONSIVE TWEAKS
   ========================================= */

/* Public layout: soften frame on mobile */
@media (max-width: 767.98px) {
  .cx-public main {
    box-shadow: none;
    border-radius: 0;
    padding: 12px;
  }

  .cx-dashboard-hero {
    padding: 12px 14px;
  }

  .cx-hero-title {
    font-size: 18px;
  }

  .cx-hero-kicker {
    font-size: 10px;
  }

  .cx-quick-card .card-body {
    padding: 10px 8px;
  }

  .cx-filter-sidebar .card-body {
    padding: 12px 10px;
  }

  .cx-filter-title {
    font-size: 10px;
  }

  .cx-product-card {
    border-radius: 12px;
  }

  .row.g-3 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }
}

/* Dashboard behavior on tablets/phones */
@media (max-width: 991.98px) {
  .cx-dashboard-shell {
    flex-direction: column;
  }

  .cx-dashboard .cx-sidebar {
    width: 100%;
    position: relative;
    height: auto;
    max-height: none;
  }

  .cx-dashboard .cx-main {
    height: auto;
    min-height: auto;
  }

  .cx-sidebar-nav .cx-nav-item {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  .cx-dashboard .card {
    margin-bottom: 0.75rem;
  }

  .cx-dashboard h2.h5 {
    font-size: 1rem;
  }
}
