/* Tech Emporium — Amazon-style storefront design system
   No preprocessor, no build step. Loaded once from layouts/app.blade.php. */

:root {
  /* Brand — client-requested black / white / sky blue / gray palette */
  --te-brand: #0a0a0a;
  --te-brand-hover: #1a1a1a;
  --te-accent: #0a0a0a;
  --te-accent-hover: #1a1a1a;
  --te-search-btn: #0a0a0a;
  --te-search-btn-hover: #1a1a1a;

  /* Neutrals — light, low-chrome */
  --te-ink: #0a0a0a;
  --te-muted: #64748b;
  --te-border: #e2e8f0;
  --te-surface: #ffffff;
  --te-bg: #f8fafc;

  /* Header surfaces */
  --te-header-bg: #0a0a0a;
  --te-header-bg-alt: #1a1a1a;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius scale — capped at 8px, no pills */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Shadow */
  --shadow-card: 0 1px 3px rgba(15, 17, 17, 0.12);

  /* Header height — single source of truth for main's top offset */
  --header-h: 99px; /* 60px utility row + 39px department row */
}

@media (max-width: 991.98px) {
  :root {
    /* Static fallback for the instant before chrome.js measures the real
       header and corrects this — keep it close to the actual rendered
       height (verified ~189px on a 375px-wide phone) so there's nothing
       to visibly snap into place. */
    --header-h: 190px;
  }
}

* {
  box-sizing: border-box;
}

body {
  background: var(--te-bg);
  color: var(--te-ink);
  font-family: 'Inter', sans-serif;
}

a {
  color: var(--te-brand);
  text-decoration: none;
}

a:hover {
  color: var(--te-brand-hover);
  text-decoration: underline;
}

main {
  margin-top: var(--header-h);
}

.te-card {
  background: var(--te-surface);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.te-alerts {
  margin-top: var(--space-3);
}

.te-alerts .alert:not(:last-child) {
  margin-bottom: var(--space-2);
}

/* Header */
.te-header {
  z-index: 1030;
}

.te-utility-bar {
  background: var(--te-header-bg);
  color: #fff;
}

.te-utility-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  max-width: 1500px;
  margin: 0 auto;
}

.te-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.te-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.te-logo strong {
  color: #ccc;
}

.te-search {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.te-search__scope {
  border: none;
  background: #e6e6e6;
  color: var(--te-ink);
  font-size: 12px;
  padding: 0 var(--space-2);
  max-width: 160px;
}

.te-search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  padding: 0 var(--space-3);
  font-size: 15px;
}

.te-search__submit {
  width: 45px;
  border: none;
  background: var(--te-search-btn);
  color: #fff;
  flex-shrink: 0;
}

.te-search__submit:hover {
  background: var(--te-search-btn-hover);
}

.te-search:focus-within {
  box-shadow: 0 0 0 3px var(--te-search-btn);
}

.te-utility-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.te-action-link {
  display: flex;
  flex-direction: column;
  color: #fff;
  line-height: 1.2;
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  position: relative;
  white-space: nowrap;
}

.te-action-link:hover {
  border-color: #fff;
  color: #fff;
  text-decoration: none;
}

.te-action-link__line1 {
  font-size: 12px;
  color: #ccc;
}

.te-action-link__line2 {
  font-size: 14px;
  font-weight: 700;
}

.te-action-link--icon {
  flex-direction: row;
  align-items: center;
  gap: var(--space-1);
  font-size: 22px;
}

.te-action-link__cart-label {
  font-size: 14px;
  font-weight: 700;
}

.te-badge {
  position: absolute;
  top: -2px;
  right: -6px;
  background: var(--te-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.te-action-link--icon .te-badge {
  position: static;
  margin-left: -8px;
  margin-top: -10px;
}

.te-department-bar {
  background: var(--te-header-bg-alt);
}

.te-department-bar__scroll {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.te-department-bar__scroll::-webkit-scrollbar {
  display: none;
}

.te-department-bar__all,
.te-department-bar__link {
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  padding: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
}

.te-department-bar__all {
  font-weight: 700;
  flex-shrink: 0;
}

.te-department-bar__all:hover,
.te-department-bar__link:hover {
  border-color: #fff;
  color: #fff;
  text-decoration: none;
}

@media (max-width: 991.98px) {
  .te-utility-bar__inner {
    flex-wrap: wrap;
  }

  .te-search {
    order: 3;
    flex-basis: 100%;
  }

  .te-action-link__line1 {
    display: none;
  }
}

/* Department drawer */
.te-drawer {
  width: min(365px, calc(100vw - 60px));
}

.te-drawer__header {
  background: var(--te-header-bg-alt);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  font-size: 18px;
}

.te-drawer__group {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--te-border);
}

.te-drawer__heading {
  font-size: 18px;
  font-weight: 700;
  padding: 0 var(--space-4) var(--space-1);
}

.te-drawer__row {
  display: block;
  padding: var(--space-2) var(--space-4);
  color: var(--te-ink);
  font-size: 14px;
}

.te-drawer__row:hover {
  background: #eee;
  text-decoration: none;
}

.te-drawer__row--button {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
}

.te-drawer__department summary {
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}

.te-drawer__row--child {
  padding-left: var(--space-6);
}

/* Footer */
.te-footer {
  background: var(--te-header-bg);
  color: #ccc;
  padding: var(--space-7) 0 var(--space-4);
}

.te-footer a {
  color: #ccc;
}

.te-footer a:hover {
  color: #fff;
}

.te-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #fff;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.te-footer__brand strong {
  color: #ccc;
}

.te-footer__tagline {
  font-size: 14px;
  color: #999;
}

.te-footer__heading {
  color: #fff !important;
  font-size: 15px;
  margin-bottom: var(--space-3);
}

.te-footer__social {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.te-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #333;
  border-radius: 50%;
  color: #ccc;
  font-size: 1rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.te-footer__social a:hover {
  color: var(--te-brand);
  border-color: var(--te-brand);
}

.te-footer ul li {
  margin-bottom: var(--space-2);
  font-size: 14px;
}

.te-footer hr {
  border-color: #333;
  margin-bottom: var(--space-3);
}

.te-footer__copyright {
  font-size: 13px;
}

/* Home: promo banner (replaces the old glassmorphism hero) */
.home-promo-banner {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(120deg, var(--te-header-bg) 0%, var(--te-header-bg-alt) 150%);
  background-size: cover;
  background-position: center;
  padding: var(--space-7) 0 var(--space-6);
  color: #fff;
}

/* A quiet, ever-so-slowly drifting glow — the one bit of automatic motion on
   an otherwise static hero, low-opacity enough to never fight the text. */
.home-promo-banner__glow {
  position: absolute;
  top: -30%;
  right: -8%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(10, 10, 10, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.home-promo-banner__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

@media (prefers-reduced-motion: no-preference) {
  .home-promo-banner__glow {
    animation: heroGlowDrift 13s ease-in-out infinite;
  }

  /* One orchestrated entrance on load — eyebrow, headline, subtitle, actions
     and each stat rise in as a single cascading moment, not a per-section
     scroll trick repeated everywhere. */
  .home-promo-banner__eyebrow,
  .home-promo-banner__title,
  .home-promo-banner__subtitle,
  .home-promo-banner__actions,
  .home-promo-banner__stat {
    animation: heroRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .home-promo-banner__eyebrow { animation-delay: 0.05s; }
  .home-promo-banner__title { animation-delay: 0.15s; }
  .home-promo-banner__subtitle { animation-delay: 0.28s; }
  .home-promo-banner__actions { animation-delay: 0.4s; }
  .home-promo-banner__stat:nth-child(1) { animation-delay: 0.5s; }
  .home-promo-banner__stat:nth-child(2) { animation-delay: 0.58s; }
  .home-promo-banner__stat:nth-child(3) { animation-delay: 0.66s; }
}

@keyframes heroGlowDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-34px, 22px) scale(1.12); }
}

@keyframes heroRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-promo-banner__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--te-accent);
  margin-bottom: var(--space-3);
}

.home-promo-banner__title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  max-width: 560px;
  margin-bottom: var(--space-3);
  color: #fff !important;
}

.home-promo-banner__subtitle {
  color: #d7deee;
  max-width: 480px;
  margin-bottom: var(--space-4);
}

.home-promo-banner__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.home-promo-banner__cta {
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.home-promo-banner__cta-outline {
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  background: transparent;
}

.home-promo-banner__cta-outline:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.home-promo-banner__stats {
  display: flex;
  gap: var(--space-5);
  flex-shrink: 0;
}

.home-promo-banner__stat {
  text-align: center;
}

.home-promo-banner__stat strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
}

.home-promo-banner__stat span {
  font-size: 12px;
  color: #c3cbdc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 767.98px) {
  .home-promo-banner__stats {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-3);
  }

  /* iOS Safari auto-zooms into any text input/select with a font-size
     under 16px, and the page never zooms back out on its own — the exact
     bug reported on the search bar. 16px is the documented threshold
     that keeps Safari from triggering the zoom in the first place. */
  .te-search__input,
  .te-search__scope {
    font-size: 16px;
  }
}

/* Home: category tile grid (Amazon-style module) */
.home-tile {
  background: var(--te-surface);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.home-tile:hover {
  transform: translateY(-4px);
  border-color: var(--te-brand);
  box-shadow: 0 12px 28px rgba(10, 10, 10, 0.14);
}

.home-tile__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--te-ink);
  margin-bottom: var(--space-3);
}

.home-tile__image {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  margin-bottom: var(--space-3);
}

.home-tile__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.home-tile:hover .home-tile__image img {
  transform: scale(1.04);
}

.home-tile__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--te-brand);
  margin-top: auto;
}

/* Home: product row header (Best Sellers / Featured Products) */
.home-row-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.home-row-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.payment-box--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.payment-box--disabled:hover {
  cursor: not-allowed;
}
