/* ============================================
   SK GROUP - GLOBAL STYLESHEET
   Shri Kabariya - Hardware | Electrical | Sanitary
   ============================================ */

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

/* ---------- CSS VARIABLES ---------- */
:root {
  /* Colors */
  --color-bg-dark: #0d0d0d;
  --color-bg-dark-2: #1a1a1a;
  --color-gold: #c9a24b;
  --color-gold-light: #d4a15d;
  --color-gold-hover: #e0b85f;
  --color-cream: #f5f1ea;
  --color-white: #ffffff;
  --color-text-gray: #8a8a8a;
  --color-text-dark: #1a1a1a;
  --color-border: #2a2a2a;
  --color-border-light: #e5e0d5;

  --color-success: #2e7d32;
  --color-warning: #e0812d;
  --color-info: #2b6fd4;
  --color-danger: #d43b2b;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Poppins', sans-serif;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.12);
  --shadow-gold: 0 4px 16px rgba(201,162,75,0.35);

  --max-width: 1280px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-dark);
  color: var(--color-white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 70px; /* space for bottom nav on mobile */
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

img, video, svg, iframe, table, pre {
  max-width: 100%;
}

img {
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-gold {
  background: var(--color-gold);
  color: #1a1400;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: var(--color-gold-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-gold);
  color: var(--color-gold);
}

.btn-outline:hover {
  background: rgba(201,162,75,0.1);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* ---------- HEADER ---------- */
.site-header {
  background: var(--color-bg-dark);
  border-bottom: 1px solid rgba(201,162,75,0.18);
  padding: 12px 0 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}

.header-menu-btn:active {
  background: rgba(201,162,75,0.15);
  transform: scale(0.94);
}

.header-menu-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-white);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-right: -6px;
}

.header-bell {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}

.header-bell:active {
  background: rgba(201,162,75,0.15);
  transform: scale(0.94);
}

.header-bell svg {
  width: 21px;
  height: 21px;
  stroke: var(--color-white);
}

.header-bell .bell-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  border: 1.5px solid var(--color-bg-dark);
}

.header-location {
  display: flex;
  flex-direction: column;
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  padding-left: 50px;
}

.header-location strong {
  color: var(--color-white);
  font-size: 13px;
  font-weight: 600;
}

.header-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  flex: 1;
  min-width: 0;
  position: relative;
}

.header-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 42px 11px 42px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(201,162,75,0.2);
  background: var(--color-bg-dark-2);
  color: var(--color-white);
  font-size: 13px;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.header-search input:focus {
  background: #222;
  border-color: var(--color-gold);
}

.header-search input::placeholder {
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .header-search input {
    font-size: 12px;
    padding: 10px 38px 10px 38px;
  }
}

@media (max-width: 380px) {
  .header-brand-name {
    font-size: 15px;
  }

  .header-logo img {
    width: 30px;
    height: 30px;
  }

  .header-right {
    gap: 2px;
  }

  .header-bell,
  .header-cart,
  .header-menu-btn {
    width: 34px;
    height: 34px;
  }
}

.header-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.6;
  stroke: rgba(255,255,255,0.5) !important;
}

.header-search .mic-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}

.header-search .mic-btn:active {
  background: rgba(201,162,75,0.18);
  transform: translateY(-50%) scale(0.92);
}

.header-search .mic-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-gold);
}

.header-search .mic-btn.listening svg {
  stroke: var(--color-danger);
}

.header-cart {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}

.header-cart svg {
  stroke: var(--color-white) !important;
}

.header-cart:active {
  background: rgba(201,162,75,0.15);
  transform: scale(0.94);
}

.header-cart .cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-gold);
  color: #1a1400;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- SIDE DRAWER (hamburger menu) ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

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

.side-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 78%;
  max-width: 300px;
  background: var(--color-bg-dark-2);
  border-right: 1px solid rgba(201,162,75,0.2);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.side-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid rgba(201,162,75,0.15);
}

.drawer-header img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.drawer-header span {
  font-family: var(--font-display);
  color: var(--color-white);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

.drawer-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.drawer-links a:active {
  background: rgba(201,162,75,0.1);
}

.drawer-links a svg {
  width: 19px;
  height: 19px;
  stroke: var(--color-gold);
  flex-shrink: 0;
}

.drawer-divider {
  height: 1px;
  background: rgba(201,162,75,0.12);
  margin: 6px 20px;
}

/* ---------- BOTTOM NAVIGATION (mobile) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-border-light);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  z-index: 100;
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-gray);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  min-width: 52px;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.bottom-nav .nav-item svg {
  width: 21px;
  height: 21px;
  stroke: var(--color-text-gray);
  transition: stroke 0.12s ease;
}

.bottom-nav .nav-item:active {
  transform: scale(0.92);
  background: rgba(201,162,75,0.08);
}

.bottom-nav .nav-item.active {
  color: var(--color-gold);
  font-weight: 700;
}

.bottom-nav .nav-item.active svg {
  stroke: var(--color-gold);
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--color-bg-dark-2);
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  margin-top: 40px;
  display: none; /* shown on desktop only, mobile uses bottom-nav */
}

.footer-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.footer-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-gray);
}

.footer-trust-item svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-gold);
  flex-shrink: 0;
}

.footer-apps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

.footer-apps .btn-outline {
  padding: 10px 18px;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--color-cream);
  border-radius: var(--radius-md);
  color: var(--color-text-dark);
}

/* ---------- SECTION HEADING (with View All) ---------- */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 18px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-heading .view-all {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--color-gold);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  margin: -10px 0;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease, transform 0.1s ease;
}

.section-heading .view-all:active {
  background: rgba(201,162,75,0.12);
  transform: scale(0.95);
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-processing { background: rgba(224,129,45,0.15); color: var(--color-warning); }
.badge-shipped { background: rgba(43,111,212,0.15); color: var(--color-info); }
.badge-delivered { background: rgba(46,125,50,0.15); color: var(--color-success); }
.badge-cancelled { background: rgba(212,59,43,0.15); color: var(--color-danger); }

/* ---------- BACK HEADER (for inner pages) ---------- */
.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-header .back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f2f0ea;
  transition: transform 0.12s ease, background 0.12s ease;
}

.page-header .back-btn:active {
  transform: scale(0.92);
  background: #e9e6dc;
}

.page-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-dark);
}

/* ---------- LOADING SPINNER ---------- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-gray);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  stroke: var(--color-text-gray);
  margin: 0 auto 16px;
}

/* ---------- SKELETON LOADERS (shown while data loads from Firestore) ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-dark-2);
  border-radius: var(--radius-md);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}

@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

.skeleton-card { height: 128px; }
.skeleton-chip { height: 52px; }
.skeleton-row { height: 64px; margin-bottom: 10px; }

/* ---------- HIDDEN UTILITY (global) ---------- */
.hidden {
  display: none !important;
}

/* ---------- RESPONSIVE: DESKTOP ---------- */
@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }

  .header-location {
    display: flex;
  }

  .bottom-nav {
    display: none;
  }

  .site-footer {
    display: block;
  }

  .footer-trust {
    grid-template-columns: repeat(6, 1fr);
  }
}