/* layout.css - header, nav, role shells, grids */

/* Header shell */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--ht-nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  margin: 0 auto;
  max-width: calc(var(--ht-max-width) + 32px);
}

/* Logo */

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ht-text);
}

.logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 0 0, #4f46e5 0, #1d4ed8 40%, #020617 100%);
  padding: 4px;
}

.logo-icon.small {
  width: 22px;
  height: 22px;
}

.logo-text {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Hide old inline nav links (we now use side drawer) */

.nav-links {
  display: none;
}

/* Hamburger toggle */

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
  color: var(--ht-text-soft);
  cursor: pointer;
  margin-left: auto;
  margin-right: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  transition:
    background-color var(--ht-transition-fast),
    border-color var(--ht-transition-fast),
    transform 120ms ease-out,
    box-shadow var(--ht-transition-fast);
}

.nav-toggle i {
  font-size: 14px;
}

.nav-toggle:hover {
  background: radial-gradient(circle at top, rgba(30, 64, 175, 0.98), rgba(15, 23, 42, 0.96));
  border-color: rgba(129, 140, 248, 0.9);
  color: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.7);
}

/* Right side user/auth */

.nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 12px;
  color: var(--ht-text-soft);
}

.nav-user i {
  color: rgba(129, 140, 248, 0.9);
}

.header-search {
	display: inline-flex;
    /* flex-direction: column; */
    justify-content: center;
    margin-left: auto;
    /* min-width: 400px;*/
}

.header-search-form {
	display: flex;
    gap: 10px;
    /* margin: 0 auto; */
    /* justify-content: center; */
    /* width: 100%; */
    min-width: 400px;
}

/* Side nav overlay + drawer */

.side-nav-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(0, 0, 0, 0.85));
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--ht-transition-med),
    visibility var(--ht-transition-med);
  z-index: 39;
}

.side-nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.side-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 80vw);
  height: 100vh;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  box-shadow: -18px 0 45px rgba(0, 0, 0, 0.75);
  transform: translateX(100%);
  transition: transform var(--ht-transition-med);
  z-index: 40;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(31, 41, 55, 0.9);
}

.side-nav.is-open {
  transform: translateX(0%);
}

.side-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.95);
}

.side-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-nav-close {
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ht-text-soft);
  cursor: pointer;
  font-size: 13px;
}

.side-nav-close:hover {
  background: rgba(30, 64, 175, 0.95);
  color: #e5e7eb;
}

.side-nav-links {
  padding: 12px 12px 18px;
  overflow-y: auto;
  flex: 1;
}

.side-nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ht-text-soft);
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.side-nav-links a i {
  width: 16px;
  text-align: center;
  font-size: 13px;
}

.side-nav-links a:hover {
  background: rgba(30, 64, 175, 0.4);
  border-color: rgba(129, 140, 248, 0.7);
  color: var(--ht-text);
}

.side-nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ht-text-muted);
  margin: 10px 4px 4px;
}


/* Shell variants (role tint on nav border) */

.buyer-shell .glass-nav {
  border-color: rgba(59, 130, 246, 0.55);
}

.seller-shell .glass-nav {
  border-color: rgba(249, 115, 22, 0.65);
}

.admin-shell .glass-nav {
  border-color: rgba(244, 63, 94, 0.7);
}

.logistics-shell .glass-nav {
  border-color: rgba(45, 212, 191, 0.7);
}

/* Auth layout */

.auth-main {
  max-width: 420px;
  margin: calc(var(--ht-nav-height) + 32px) auto 40px;
  padding: 0 16px;
}

.auth-card {
  padding: 20px 22px;
}

.auth-title {
  font-size: 22px;
  margin-bottom: 4px;
}

.auth-title i {
  margin-right: 6px;
}

.auth-subtitle {
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-switch {
  margin-top: 14px;
  font-size: 13px;
}

/* Dashboard layouts */

.dashboard-hero {
  margin-bottom: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 14px 14px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
}

.dashboard-card {
  margin-top: 12px;
}

/* Marketplace & product layout */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--ht-radius-md);
}

.product-image {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

/* Product detail layout */

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 18px;
}

.product-main-image-wrap {
  position: relative;
  overflow: hidden;
}

.product-main-image {
  width: 100%;
  height: auto;
}

.product-thumbnails {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.product-thumb {
	width: 94%;
    margin: 3%;
    height: 200px;
  object-fit: cover;
  cursor: pointer;
  border-radius: var(--ht-radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.product-thumb:hover {
  border-color: rgba(129, 140, 248, 0.9);
}

/* Orders list layout */

.order-card {
  margin-bottom: 10px;
}

.order-card-body {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.order-card-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Cart layout */

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 320px);
  gap: 18px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.cart-item-image-wrap {
  width: 96px;
  height: 96px;
  border-radius: var(--ht-radius-md);
  overflow: hidden;
}

.cart-summary {
  align-self: flex-start;
}

/* Empty state */

.empty-state {
  text-align: center;
  padding: 28px 16px;
}

/* Reels layout basics */

.reels-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Responsive layout */

@media (max-width: 1040px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-inline: 12px;
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
    order: 2;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-links::-webkit-scrollbar {
    height: 4px;
  }

  .nav-links::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 999px;
  }
  
  .header-search-form {
	min-width: 200px;
  }

  .nav-auth {
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cart-item {
    grid-template-columns: 80px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .cart-item-total {
    justify-self: flex-end;
  }
}

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

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-header {
    padding-inline: 8px;
  }

  .logo-text {
    font-size: 13px;
  }

  .auth-main {
    margin-top: calc(var(--ht-nav-height) + 18px);
  }
}

/* ========================= */
/* Landing page: sections    */
/* ========================= */

.section {
  padding: 40px 16px;
}

.section + .section {
  margin-top: 24px;
}

.section-inner {
  max-width: var(--ht-max-width);
  margin: 0 auto;
}

.section-inner--split {
  display: grid;
  gap: 32px;
}

.section-header {
  max-width: var(--ht-max-width);
  margin: 0 auto 20px;
  text-align: left;
}

.section-header h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.section-header p {
  color: var(--ht-text-muted);
  font-size: 14px;
}

.section-header--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--ht-max-width);
  margin: 0 auto 20px;
}

.section-header--row h2 {
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--ht-text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.section-empty {
  max-width: var(--ht-max-width);
  margin: 8px auto 0;
  font-size: 14px;
  color: var(--ht-text-muted);
}

/* ========================= */
/* Hero layout               */
/* ========================= */

.section--hero {
  padding: 32px 16px 40px;
}

.section--hero .section-inner--split {
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ht-accent-soft);
}

.hero-title {
  font-size: 28px;
  line-height: 1.15;
}

.hero-subtitle {
  max-width: 460px;
  color: var(--ht-text-soft);
  font-size: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ht-text-muted);
}

.hero-meta--row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.hero-meta--row i {
  margin-right: 6px;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-visual--device .hero-device {
  position: relative;
  width: 270px;
  max-width: 100%;
  border-radius: 32px;
  padding: 10px;
  background:
    radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.35), transparent 65%),
    linear-gradient(145deg, #020617, #020617);
  box-shadow: var(--ht-shadow-soft);
}

.hero-device-screen {
  border-radius: 26px;
  overflow: hidden;
  background: #020617;
}

.hero-device-reel {
  position: relative;
}

.hero-device-image {
  width: 100%;
  display: block;
  object-fit: cover;
}

.hero-device-live-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(to right, #ef4444, #f97316);
  font-weight: 600;
}

.hero-device-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
  margin-top: 20px;
  position: relative;
}

.hero-device-product {
  font-size: 13px;
  font-weight: 500;
}

.hero-device-meta {
  font-size: 11px;
  color: var(--ht-text-muted);
}

/* ========================= */
/* Generic cards grid        */
/* ========================= */

.cards-grid {
  max-width: var(--ht-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.cards-grid--4 {
  /* base 2 cols on medium screens, 4 on large */
}

/* Reels/product grids share spacing */
.product-grid,
.reels-grid {
  max-width: var(--ht-max-width);
  margin: 0 auto;
}

/* ========================= */
/* Tall reels grid           */
/* ========================= */

.reels-grid--tall {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

/* ========================= */
/* Responsive layout         */
/* ========================= */

@media (min-width: 640px) {
  .section {
    padding: 48px 20px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reels-grid--tall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .section {
    padding: 56px 24px;
  }

  .section--hero {
    padding-top: 56px;
    padding-bottom: 64px;
  }

  .section-inner--split {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }

  .cards-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .reels-grid--tall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Live reels horizontal scroller on home */
.reels-scroller {
  max-width: var(--ht-max-width);
  margin: 0 auto;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scroll-snap-type: x mandatory;
}

.reels-scroller::-webkit-scrollbar {
  height: 6px;
}

.reels-scroller::-webkit-scrollbar-track {
  background: transparent;
}

.reels-scroller::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

/* Reel cards inside the horizontal scroller */
.reels-scroller .reel-card--tall {
  flex: 0 0 min(230px, 70vw);
  scroll-snap-align: start;
}

/* ========================= */
/* Site footer               */
/* ========================= */

.site-footer {
  border-top: 1px solid var(--ht-border-subtle);
  background:
    radial-gradient(circle at top, rgba(79, 70, 229, 0.18), transparent 60%),
    #020617;
  padding: 32px 20px 20px;
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--ht-max-width);
  margin: 0 auto;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr);
  align-items: flex-start;
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.footer-tagline {
  font-size: 13px;
  color: var(--ht-text-muted);
  max-width: 360px;
}

.footer-meta {
  font-size: 12px;
  color: var(--ht-text-soft);
}

.footer-contact a {
  font-size: 13px;
  color: var(--ht-accent-soft);
  text-decoration: none;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.footer-social a {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--ht-text-soft);
  font-size: 13px;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.footer-social a:hover {
  background-color: rgba(79, 70, 229, 0.85);
  border-color: rgba(129, 140, 248, 0.9);
  transform: translateY(-1px);
}

.footer-links-block {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.footer-column h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  color: var(--ht-text-muted);
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-column a {
  font-size: 13px;
  color: var(--ht-text-soft);
  text-decoration: none;
}

.footer-column a:hover {
  color: var(--ht-text);
}

.footer-bottom {
  max-width: var(--ht-max-width);
  margin: 16px auto 0;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ht-text-soft);
}

.footer-bottom-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Footer responsiveness */
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-links-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .footer-links-block {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer {
    padding-inline: 16px;
  }
}
