/* =============================================
   ANDIAC Store & Service – Design System CSS
   Porting custom Tailwind tokens → Bootstrap 5
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Brand Colors */
  --color-primary:              #0057cd;
  --color-primary-container:    #0d6efd;
  --color-on-primary:           #ffffff;
  --color-secondary:            #006d41;
  --color-on-secondary:         #ffffff;
  --color-secondary-container:  #90f4b7;
  --color-tertiary:             #a63b00;
  --color-tertiary-container:   #cf4b00;

  /* Surface & Background */
  --color-background:                #f7f9ff;
  --color-surface:                   #f7f9ff;
  --color-surface-dim:               #d7dadf;
  --color-surface-bright:            #f7f9ff;
  --color-surface-container-lowest:  #ffffff;
  --color-surface-container-low:     #f1f4f9;
  --color-surface-container:         #ebeef3;
  --color-surface-container-high:    #e5e8ee;
  --color-surface-container-highest: #e0e3e8;
  --color-surface-variant:           #e0e3e8;

  /* On-Surface Text */
  --color-on-background:       #181c20;
  --color-on-surface:          #181c20;
  --color-on-surface-variant:  #424655;
  --color-outline:             #727787;
  --color-outline-variant:     #c2c6d8;

  /* Inverse */
  --color-inverse-surface:     #2d3135;
  --color-inverse-on-surface:  #eef1f6;
  --color-inverse-primary:     #b1c5ff;

  /* Error */
  --color-error:               #ba1a1a;
  --color-error-container:     #ffdad6;
  --color-on-error:            #ffffff;

  /* Shadows */
  --shadow-level1:  0 2px 4px rgba(0,0,0,0.05);
  --shadow-level2:  0 10px 20px rgba(0,0,0,0.08);
  --shadow-level3:  0 20px 40px rgba(0,0,0,0.12);

  /* Bootstrap overrides */
  --bs-primary:        #0057cd;
  --bs-primary-rgb:    0,87,205;
  --bs-secondary:      #006d41;
  --bs-secondary-rgb:  0,109,65;
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, sans-serif;
  --bs-body-bg:        #f7f9ff;
  --bs-body-color:     #181c20;
  --bs-border-radius:  0.375rem;
  --bs-border-radius-lg: 0.5rem;
  --bs-border-radius-xl: 0.75rem;
}

/* ===========================
   Base
   =========================== */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--color-background);
  color: var(--color-on-background);
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   Typography Scale
   =========================== */
.display-hero {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.heading-1 { font-size: 32px; font-weight: 700; line-height: 1.3; }
.heading-2 { font-size: 24px; font-weight: 600; line-height: 1.4; }
.body-lg   { font-size: 18px; font-weight: 400; line-height: 1.6; }
.body-md   { font-size: 16px; font-weight: 400; line-height: 1.6; }
.label-sm  { font-size: 14px; font-weight: 500; line-height: 1.4; letter-spacing: 0.01em; }
.btn-text  { font-size: 16px; font-weight: 600; line-height: 1;   letter-spacing: 0.02em; }

/* ===========================
   Container
   =========================== */
.container-andiac {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ===========================
   Navbar / TopAppBar
   =========================== */
.navbar-andiac {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: var(--shadow-level1);
  position: sticky;
  top: 0;
  z-index: 1050;
  height: 80px;
}
.navbar-andiac .brand {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--color-primary);
  text-decoration: none;
}
.navbar-andiac .brand .brand-icon {
  font-size: 1.875rem;
  color: var(--color-primary);
  vertical-align: middle;
  margin-right: 0.25rem;
}
.navbar-andiac .nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  padding: 0.25rem 0;
  transition: color 0.2s;
  text-decoration: none;
}
.navbar-andiac .nav-link:hover,
.navbar-andiac .nav-link.active {
  color: var(--color-primary);
}
.navbar-andiac .nav-link.active {
  font-weight: 700;
  border-bottom: 2px solid var(--color-primary);
}
.btn-cart {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  color: #475569;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.btn-cart:hover { background: #f8fafc; }
.cart-badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--color-error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 9999px;
  min-width: 18px;
  text-align: center;
}

/* ===========================
   Buttons
   =========================== */
.btn-primary-andiac {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s, opacity 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  text-decoration: none;
  display: inline-block;
}
.btn-primary-andiac:hover {
  box-shadow: 0 4px 12px rgba(0,87,205,0.25);
  color: #fff;
}
.btn-primary-andiac:active { transform: scale(0.97); }

.btn-buy {
  background-color: var(--color-secondary);
  color: var(--color-on-secondary);
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-buy:hover  { opacity: 0.9; color: #fff; }
.btn-buy:active { transform: scale(0.95); }

.btn-secondary-andiac {
  background-color: var(--color-surface-container);
  color: var(--color-on-surface);
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary-andiac:hover { background-color: var(--color-surface-container-high); color: var(--color-on-surface); }

/* ===========================
   Hero Section
   =========================== */
.hero-section {
  background: #ffffff;
  overflow: hidden;
  padding: 6rem 0 5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: #dae2ff;
  color: var(--color-primary);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
}
.hero-img-wrapper {
  position: relative;
}
.hero-glow {
  position: absolute;
  inset: -1rem;
  background: rgba(0,87,205,0.1);
  border-radius: 9999px;
  filter: blur(3rem);
  z-index: 0;
}
.hero-img {
  position: relative;
  z-index: 1;
  border-radius: 1rem;
  box-shadow: var(--shadow-level3);
  width: 100%;
  height: 500px;
  object-fit: cover;
}

/* ===========================
   Trust Bar
   =========================== */
.trust-bar {
  background-color: var(--color-surface-container-low);
  padding: 2rem 0;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
}
.trust-icon {
  width: 3rem;
  height: 3rem;
  background-color: var(--color-secondary-container);
  color: #007144;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===========================
   Search Section
   =========================== */
.search-section { padding: 5rem 0; }
.search-wrap {
  position: relative;
}
.search-wrap .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s;
  z-index: 2;
}
.search-wrap:focus-within .search-icon { color: var(--color-primary); }
.search-input {
  width: 100%;
  height: 4rem;
  padding: 0 8rem 0 3.5rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 16px;
  box-shadow: var(--shadow-level1);
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.search-input:focus {
  box-shadow: 0 0 0 4px rgba(0,87,205,0.10);
  border-color: var(--color-primary);
}
.search-btn {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 0 2rem;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s;
}
.search-btn:hover { background: #0049b0; }

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0; right: 0;
  background: #ffffff;
  border: 1px solid var(--color-outline-variant);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-level2);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 15px;
  color: var(--color-on-surface);
  text-decoration: none;
}
.autocomplete-item:hover { background: var(--color-surface-container-low); }
.autocomplete-item .search-icon-sm {
  font-size: 18px;
  color: var(--color-outline);
}
.autocomplete-item .product-type-badge {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

/* ===========================
   Category Chips
   =========================== */
.categories-section {
  padding: 3rem 0;
  background: #ffffff;
}
.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-on-surface);
}
.category-icon-wrap {
  width: 5rem;
  height: 5rem;
  background: var(--color-surface-container);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.3s;
}
.category-icon-wrap .material-symbols-outlined {
  font-size: 1.875rem;
  color: var(--color-on-surface-variant);
  transition: color 0.3s;
}
.category-item:hover .category-icon-wrap {
  background: #dae2ff;
  transform: translateY(-0.5rem);
}
.category-item:hover .category-icon-wrap .material-symbols-outlined {
  color: var(--color-primary);
}
.category-item:hover .category-label { color: var(--color-primary); }
.category-label { font-size: 14px; font-weight: 600; }

/* ===========================
   Product Cards
   =========================== */
.featured-section {
  padding: 6rem 0;
  background: var(--color-surface);
}
.product-card {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.25s, border-color 0.25s;
}
.product-card:hover {
  box-shadow: var(--shadow-level2);
  border-color: transparent;
}
.product-card-img-wrap {
  position: relative;
  height: 16rem;
  overflow: hidden;
}
.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.product-card:hover .product-card-img-wrap img { transform: scale(1.1); }
.product-badge {
  position: absolute;
  top: 1rem; left: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 12px;
  font-weight: 700;
}
.badge-bestseller  { background: #10b981; color: #fff; }
.badge-new         { background: var(--color-primary); color: #fff; }
.badge-promo       { background: var(--color-tertiary-container); color: #fff; }
.badge-service     { background: #7c3aed; color: #fff; }
.badge-rental      { background: #0891b2; color: #fff; }
.product-card-body { padding: 1.5rem; }
.product-name      { font-size: 16px; font-weight: 600; margin-bottom: 0.25rem; }
.product-desc      { font-size: 14px; color: var(--color-on-surface-variant); }
.product-price     { font-size: 18px; font-weight: 700; color: var(--color-primary); }
.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--color-outline-variant);
}

/* ===========================
   Sidebar Filters
   =========================== */
.filter-sidebar {
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  position: sticky;
  top: 90px;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  text-decoration: none;
}
.filter-item:hover { background: #f1f5f9; transform: translateX(4px); color: #475569; }
.filter-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

/* ===========================
   Cart Table
   =========================== */
.cart-table {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-level1);
  border: 1px solid rgba(194,198,216,0.3);
  overflow: hidden;
}
.cart-table-header {
  display: grid;
  grid-template-columns: 6fr 2fr 2fr 2fr;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--color-surface-container-low);
  border-bottom: 1px solid rgba(194,198,216,0.3);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-on-surface-variant);
}
.cart-item {
  display: grid;
  grid-template-columns: 6fr 2fr 2fr 2fr;
  gap: 1rem;
  padding: 1.5rem;
  align-items: center;
  border-bottom: 1px solid rgba(194,198,216,0.2);
  transition: background 0.2s;
}
.cart-item:hover  { background: var(--color-surface-container-low); }
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 6rem;
  height: 6rem;
  border-radius: 0.5rem;
  object-fit: cover;
  background: var(--color-surface-container-high);
}
.qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.qty-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-outline-variant);
  background: var(--color-surface-container-low);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: background 0.15s;
}
.qty-btn:hover { background: var(--color-surface-container); }
.qty-input {
  width: 3rem;
  text-align: center;
  border: 1px solid var(--color-outline-variant);
  border-radius: 0.375rem;
  padding: 0.25rem;
  font-size: 15px;
  font-weight: 600;
}

/* ===========================
   Order Summary Card
   =========================== */
.order-summary-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-level1);
  border: 1px solid rgba(194,198,216,0.3);
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  font-size: 15px;
  color: var(--color-on-surface-variant);
}
.summary-row.total {
  border-top: 2px solid var(--color-outline-variant);
  margin-top: 0.5rem;
  padding-top: 1rem;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-on-surface);
}

/* ===========================
   Checkout Form
   =========================== */
.checkout-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-level1);
  border: 1px solid var(--color-outline-variant);
  padding: 2rem;
}
.form-label-andiac {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-on-surface-variant);
  margin-bottom: 0.5rem;
}
.form-control-andiac {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-outline-variant);
  background: #fff;
  font-size: 16px;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.form-control-andiac:focus {
  box-shadow: 0 0 0 4px rgba(0,87,205,0.10);
  border-color: var(--color-primary);
}
textarea.form-control-andiac { height: auto; padding: 0.75rem 1rem; }
select.form-control-andiac { cursor: pointer; }

/* ===========================
   Product Detail
   =========================== */
.product-detail-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-level1);
}
.breadcrumb-andiac {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  color: var(--color-outline);
  margin-bottom: 2rem;
}
.breadcrumb-andiac a { color: var(--color-outline); text-decoration: none; transition: color 0.2s; }
.breadcrumb-andiac a:hover { color: var(--color-primary); }

/* ===========================
   Order Tracking
   =========================== */
.order-status-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--color-surface-container-low);
  margin-bottom: 0.75rem;
}
.status-dot {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.status-dot.done    { background: #d1fae5; color: #059669; }
.status-dot.active  { background: #dbeafe; color: #2563eb; }
.status-dot.pending { background: #f3f4f6; color: #9ca3af; }

/* ===========================
   Admin Dashboard
   =========================== */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--color-inverse-surface);
  padding: 1.5rem 1rem;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .admin-brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 0.25rem;
}
.admin-nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin-nav-link.active { background: var(--color-primary); color: #fff; }
.admin-main { margin-left: 260px; padding: 2rem; min-height: 100vh; }
.stat-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-level1);
  border: 1px solid #e2e8f0;
}
.stat-card .stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--color-on-surface); }
.stat-card .stat-label { font-size: 14px; color: var(--color-on-surface-variant); }

/* ===========================
   Footer
   =========================== */
.footer-andiac {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 3rem 0 1.5rem;
  margin-top: 5rem;
}
.footer-social-btn {
  width: 2.5rem;
  height: 2.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-social-btn:hover { color: var(--color-primary); }

/* ===========================
   Utility Classes
   =========================== */
.text-primary-andiac  { color: var(--color-primary) !important; }
.text-secondary-andiac { color: var(--color-secondary) !important; }
.text-muted-andiac    { color: var(--color-on-surface-variant) !important; }
.bg-surface           { background-color: var(--color-surface) !important; }
.bg-surface-low       { background-color: var(--color-surface-container-low) !important; }
.bg-container         { background-color: var(--color-surface-container) !important; }
.rounded-andiac       { border-radius: 0.75rem !important; }
.rounded-full-andiac  { border-radius: 9999px !important; }
.shadow-andiac        { box-shadow: var(--shadow-level1) !important; }
.shadow-andiac-hover  { box-shadow: var(--shadow-level2) !important; }

/* Flash messages */
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; border-radius: 0.5rem; padding: 1rem; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; border-radius: 0.5rem; padding: 1rem; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; border-radius: 0.5rem; padding: 1rem; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .display-hero { font-size: 32px; }
  .hero-img     { height: 280px; }
  .cart-table-header { display: none; }
  .cart-item    { grid-template-columns: 1fr; }
  .admin-sidebar { transform: translateX(-260px); }
  .admin-main   { margin-left: 0; }
}

/* Loading spinner */
.spinner-andiac {
  display: inline-block;
  width: 1.5rem; height: 1.5rem;
  border: 3px solid rgba(0,87,205,0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
