/*
 * Ecommerce Website Styles (clean)
 * - Final mobile hamburger drawer (single source of truth)
 */

/* Reset and base styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Colour palette variables */
:root {
  --primary-bg: #001e2b;        /* deep navy */
  --secondary-bg: #022e48;      /* lighter navy */
  --accent-yellow: #f2c94c;     /* warm golden yellow */
  --accent-teal: #00a8b5;       /* cool teal */
  --accent-green: #00b44b;      /* vibrant green */
  --text-light: #f5f7fa;        /* near white */
  --text-muted: #a5b1c2;        /* muted blue-grey */
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-light); }
p { color: var(--text-muted); margin-bottom: 1rem; }
a { text-decoration: none; color: inherit; }

/* Container utility */
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 2rem 0; }

/* Header */
header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(90deg, #0077b6, #00a8b5);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0;
}

.nav .logo {
  font-size: 1.6rem; font-weight: 700; letter-spacing: 1px;
  color: var(--accent-yellow);
}

.nav ul { list-style: none; display: flex; gap: 2rem; }

/* Nav links */
.nav li a {
  color: #000; /* black text for visibility on teal */
  font-weight: 600;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.nav li a:hover, .nav li a:active {
  color: #000; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.nav li a:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

/* Hero Section */
.hero {
  display: flex; flex-wrap: wrap; align-items: center;
  min-height: 70vh; padding: 4rem 0;
  background:
    linear-gradient(180deg, rgba(0,30,43,.9) 0%, rgba(0,30,43,.5) 100%),
    url('images/server-rack.jpg') center/cover no-repeat;
  position: relative; overflow: hidden;
}
.hero .hero-content { flex: 1 1 500px; z-index: 1; }
.hero h1 { font-size: 2.8rem; margin-bottom: 1rem; color: var(--text-light); }
.hero p  { font-size: 1.1rem; margin-bottom: 2rem; color: var(--text-muted); max-width: 500px; }

.btn-primary {
  display: inline-block; padding: .8rem 1.6rem;
  background-color: var(--accent-teal); color: var(--primary-bg);
  border-radius: 4px; font-weight: 600;
  transition: transform .3s ease, background-color .3s ease;
}
.btn-primary:hover { transform: translateY(-3px); background-color: var(--accent-yellow); }

/* Category Section */
.categories { padding: 3rem 0; }

.category-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem;
}

/* Category cards (aligned buttons) */
.category-card {
  background-color: var(--secondary-bg); border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,.4);
  transition: transform .5s ease, box-shadow .5s ease;
  opacity: 0; transform: translateY(40px);
  display: flex; flex-direction: column;
}
.category-card.in-view { opacity: 1; transform: translateY(0); }
.category-card img { width: 100%; height: 180px; object-fit: cover; transition: transform .5s ease; }
.category-card:hover img { transform: scale(1.1); }
.category-card .category-body { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.category-card h3 { margin-bottom: .5rem; font-size: 1.3rem; }
.category-card p  { font-size: .9rem; color: var(--text-muted); margin-bottom: 1rem; }
.category-card a {
  display: inline-block; padding: .5rem 1rem;
  background-color: var(--accent-yellow); color: var(--primary-bg);
  border-radius: 4px; font-size: .9rem; font-weight: 600;
  transition: background-color .3s ease; margin-top: auto;
}
.category-card a:hover { background-color: var(--accent-teal); }

/* Products Section */
.products { padding: 3rem 0; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }

.product-card {
  background-color: var(--secondary-bg); border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,.5);
  transition: transform .5s ease, box-shadow .5s ease;
  opacity: 0; transform: translateY(40px);
}
.product-card.in-view { opacity: 1; transform: translateY(0); }
.product-card img { width: 100%; height: 200px; object-fit: cover; transition: transform .5s ease; }
.product-card:hover img { transform: scale(1.05) rotate(1deg); }
.product-card .product-body { padding: 1rem; }
.product-card h4 { margin-bottom: .5rem; font-size: 1.2rem; }
.product-card .price { color: #fff; font-size: 1.4rem; margin: .5rem 0; font-weight: 600; }
.product-card p { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; min-height: 48px; }
.product-card button {
  padding: .6rem 1rem; background-color: var(--accent-teal); color: var(--primary-bg);
  border: none; border-radius: 4px; font-weight: 600; cursor: pointer;
  transition: transform .3s ease, background-color .3s ease;
}
.product-card button:hover { transform: translateY(-3px); background-color: var(--accent-yellow); }

/* Footer */
footer { background-color: var(--secondary-bg); padding: 2rem 0; color: var(--text-muted); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-grid h5 { margin-bottom: 1rem; font-size: 1.1rem; color: var(--text-light); }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid li a { color: var(--text-muted); transition: color .3s ease; }
.footer-grid li a:hover { color: var(--accent-yellow); }
.whatsapp-btn {
  display: inline-block; margin-top: 1rem; padding: .6rem 1rem;
  background-color: #25d366; color: var(--primary-bg);
  border-radius: 4px; font-weight: 600; transition: transform .3s ease;
}
.whatsapp-btn:hover { transform: translateY(-3px); }

/* Scroll animations */
.animate-on-scroll { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s ease; }
.animate-on-scroll.in-view { opacity: 1; transform: translateY(0); }

/* Basic mobile tweaks (not nav) */
@media (max-width: 768px) {
  .hero { text-align: center; }
  .hero .hero-content { flex: 1 1 100%; }
}

/* Checkout qty controls */
.qty-controls { display: inline-flex; align-items: center; gap: .5rem; }
.qty-btn {
  width: 30px; height: 30px; border: none; border-radius: 6px;
  background: var(--accent-yellow); color: #001e2b;
  font-size: 18px; font-weight: 700; line-height: 1;
  cursor: pointer; transition: transform .15s ease, background-color .2s ease;
}
.qty-btn:hover { transform: translateY(-2px); background: #ffd95a; }
.qty { min-width: 20px; display: inline-block; text-align: center; }
.remove-btn {
  margin-left: .5rem; padding: 6px 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15); background: transparent; color: var(--text-light);
  cursor: pointer; transition: background-color .2s ease, transform .15s ease;
}
.remove-btn:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }

/* ======= MOBILE NAV & MENU BUTTON (single source of truth) ======= */

/* hide button on desktop */
.menu-toggle { display: none; }

@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  header { overflow: visible; }
  .nav { position: relative; padding: .6rem 0; }

  /* pill button */
  .menu-toggle {
    position: relative;
    display: inline-flex !important;
    align-items: center; justify-content: center;
    gap: 10px;

    width: auto !important;
    min-width: 140px;
    height: 48px !important;
    padding: 0 18px 0 56px;         /* space for bars on the left */

    border-radius: 999px;
    background: linear-gradient(90deg, #0077b6, #00a8b5);
    /* remove hard border to avoid dark edge */
    border: 0;
    /* soft base shadow */
    box-shadow: 0 8px 22px rgba(0,0,0,0.28);
    margin-left: auto;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, box-shadow .25s ease;
    overflow: hidden; z-index: 1001;
  }
  .menu-toggle:active { transform: scale(.98); }
  .menu-toggle:focus-visible {
    outline: none;
    box-shadow:
      0 0 0 3px rgba(0,153,255,.45),
      0 8px 22px rgba(0,0,0,.28);
  }

  /* subtle glow on hover */
  .menu-toggle:hover {
    box-shadow:
      0 10px 26px rgba(0,0,0,.30),          /* lift */
      0 0 10px rgba(0,153,255,.55),         /* inner glow */
      0 0 22px rgba(0,153,255,.35);         /* outer glow */
    transform: translateY(-2px);
  }

  /* label */
  .menu-toggle .label {
    color: #fff; font-weight: 700; font-size: 1rem; line-height: 1;
    white-space: nowrap; text-decoration: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  /* bars (stacked left) */
  .menu-toggle .bar {
    position: absolute; left: 22px; top: 50%;
    width: 24px; height: 3px; background: #fff; border-radius: 2px;
    transform: translateY(-50%); transition: transform .25s ease, opacity .2s ease;
  }
  .menu-toggle .bar:nth-child(1) { transform: translateY(calc(-50% - 8px)); } /* top */
  .menu-toggle .bar:nth-child(2) { transform: translateY(-50%); }             /* middle */
  .menu-toggle .bar:nth-child(3) { transform: translateY(calc(-50% + 8px)); } /* bottom */

  /* dropdown drawer */
  .nav ul {
    position: absolute; top: 100%; left: 0; right: 0;
    margin-top: 10px; padding: 12px 16px;
    background: linear-gradient(90deg, #0077b6, #00a8b5);
    border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.35);
    display: flex; flex-direction: column; gap: 12px;
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    pointer-events: none; z-index: 1000;
  }
  header.open .nav ul { visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto; }

  .nav li a { color: #000; font-size: 1rem; line-height: 1.3; padding: 6px 0; text-decoration: none; }
}

/* icon -> X and hide label when open */
header.open .menu-toggle .bar:nth-child(1) { transform: translateY(-50%) rotate(45deg); }
header.open .menu-toggle .bar:nth-child(2) { opacity: 0; }
header.open .menu-toggle .bar:nth-child(3) { transform: translateY(-50%) rotate(-45deg); }
header.open .menu-toggle .label { opacity: 0; transform: translateX(6px); }

/* one-time gentle pulse */
@keyframes pulseOnce {
  0% { transform: scale(1);   box-shadow: 0 8px 22px rgba(0,0,0,.28); }
  50%{ transform: scale(1.05);box-shadow: 0 12px 28px rgba(0,0,0,.34); }
  100%{transform: scale(1);   box-shadow: 0 8px 22px rgba(0,0,0,.28); }
}
.menu-toggle.pulse-once { animation: pulseOnce 1.1s ease-out 1 .9s; }

/* === Nav icons: align icon + text neatly on all screens === */
#primary-menu a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#primary-menu a svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Hide the top "Cart" link on mobile (FAB replaces it) */
@media (max-width: 768px) {
  .desktop-cart-link { display: none; }
}

/* === Floating Cart Button (mobile only) === */
.fab-cart {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: none;                 /* hidden by default, shown on mobile */
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0099ff, #0066cc);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 1002;
  transition: transform .15s ease, box-shadow .25s ease;
}
.fab-cart:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 30px rgba(0,0,0,.35),
    0 0 10px rgba(0,153,255,.55),
    0 0 22px rgba(0,153,255,.35);
}
.fab-cart svg {
  width: 26px;
  height: 26px;
}

/* Badge */
.fab-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4757;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* Only show FAB on mobile sizes */
@media (max-width: 768px) {
  .fab-cart { display: inline-flex; }
}

/* === Nav icons: stack vertically (icon above text) === */
#primary-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9px;
  text-align: center;
}
#primary-menu a svg {
  width: 22px;
  height: 22px;
}

/* Keep Cart hidden on mobile since FAB is used */
@media (max-width: 768px) {
  .desktop-cart-link { display: none; }
}

/* Nav links with icons above text */
.nav ul {
  display: flex;
  gap: 2rem;
}

.nav li a {
  display: flex;
  flex-direction: column;   /* stack icon above text */
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #000;
  font-size: 0.95rem;
  line-height: 1.2;         /* tighter text */
}

.nav li a i {
  font-size: 1.4rem;        /* icon size */
  margin-bottom: 4px;       /* reduced spacing */
}

/* Hover states */
.nav li a:hover {
  color: var(--accent-teal);
}

/* Mobile floating cart */
.mobile-cart {
  position: fixed;
  bottom: 70px;
  right: 20px;
  background: linear-gradient(90deg, #0077b6, #00a8b5);
  color: #fff;
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;    /* icon above text */
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  z-index: 2000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-cart i {
  font-size: 1.5rem;
  margin-bottom: 1px;       /* tighter gap */
}

.mobile-cart:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.3);
}

/* Only show floating cart on mobile */
@media (min-width: 769px) {
  .mobile-cart { display: none; }
}

/* === Nav icons stacked: tighten gap you chose === */
#primary-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9px;                /* your desktop/tablet gap */
  text-align: center;
  color: #000;               /* stay black on hover */
  text-decoration: none;
  transition: transform .15s ease;
  transform-origin: center;
  will-change: transform;
}

/* Remove color/underline on hover; use zoom instead */
@media (hover:hover) {
  #primary-menu a:hover { transform: scale(1.06); }
  #primary-menu a:hover span { text-decoration: none; }
}

/* Icon size & spacing (stacked) */
#primary-menu a svg { width: 22px; height: 22px; display: block; }

/* Mobile menu: slightly bigger icon + your 1px gap */
@media (max-width: 768px) {
  #primary-menu a { gap: 1px; }
  #primary-menu a svg { width: 24px; height: 24px; }
}

/* Keep Cart link hidden on mobile—FAB handles it */
@media (max-width: 768px) {
  .desktop-cart-link { display: none; }
}

/* Optional: also use zoom on the mobile Floating Cart button (no color change) */
@media (hover:hover) {
  .fab-cart:hover {
    transform: translateY(-2px) scale(1.05);
    /* keep your glow/shadow if you liked it */
  }
}

/* ===============================
   Mobile Animations & Motions
   =============================== */

/* Keyframes */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes tapPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* Scroll reveal base */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entry (delay per item) */
.animate-on-scroll.stagger-1 { transition-delay: 0.1s; }
.animate-on-scroll.stagger-2 { transition-delay: 0.2s; }
.animate-on-scroll.stagger-3 { transition-delay: 0.3s; }
.animate-on-scroll.stagger-4 { transition-delay: 0.4s; }

/* Tap feedback (for touch) */
.tap-animate {
  animation: tapPulse 0.2s ease;
}

/* Mobile-only tweaks */
@media (max-width: 768px) {
  .product-card, .category-card, .btn-primary, .add-to-cart {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .product-card:active,
  .category-card:active,
  .btn-primary:active,
  .add-to-cart:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
}

