/* ================== RESET & BASE ================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html,
body {
  min-height: 100%;
}

body {
  background: rgb(209, 219, 221);
  color: #333;
  line-height: 1.5;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
}

/* ================== NAVBAR — MOBILE FIRST ================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.2rem;
 background: rgb(12, 12, 12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 2000;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ================== HAMBURGER BUTTON ================== */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2100;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: #f1f5f9;
  border-radius: 3px;
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity  0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburger → X animation */
.hamburger.is-active span:nth-child(1) {
  transform: translateY(7.75px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.is-active span:nth-child(3) {
  transform: translateY(-7.75px) rotate(-45deg);
}

/* ================== MOBILE NAV PANEL ================== */
#main-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  top: 56px; /* overridden by JS to exact navbar height */
  max-height: calc(100vh - 56px);
  background: rgba(10, 14, 20, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 1999;
}

#main-nav.nav-open {
  display: block;
  animation: navSlideDown 0.22s ease forwards;
}

@keyframes navSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile nav list — vertical stack */
nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  gap: 0;
  padding: 0.5rem 0;
}

nav ul li {
  position: relative;
}

nav ul li a {
  display: block;
  padding: 0.88rem 1.5rem;
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  -webkit-tap-highlight-color: transparent;
}

nav ul li a:hover,
nav ul li a:active {
  background: rgba(255, 60, 0, 0.09);
  color: #ff7a40;
  box-shadow: none;
}

/* Cart / Profile parent link — label only on mobile */
.dropdown > a.bossd {
  color: #7c8fa6;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 0.75rem 1.5rem 0.35rem;
  border-bottom: none;
  cursor: default;
  pointer-events: none;
}

/* Mobile dropdown sub-items — always visible, indented */
.dropdown-menu {
  position: static;
  display: block;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: none;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0;
  padding: 0 0 0.6rem;
  min-width: unset;
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: auto;
}

.dropdown-menu li a {
  display: block;
  padding: 0.55rem 1.5rem 0.55rem 2.5rem;
  color: #7c8fa6;
  font-size: 0.88rem;
  font-weight: 500;
  border-bottom: none;
}

.dropdown-menu li a:hover,
.dropdown-menu li a:active {
  color: #ff9040;
  background: none;
}

.bossd {
  position: relative;
  z-index: 2001;
}

/* Cart Count Badge */
#cart-count {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
}

/* ================== BANNER ================== */
.thala {
  background: #2874f0;
  color: white;
  padding: 0.5rem 1rem;
  text-align: center;
}

.first { font-size: 1.5rem; margin: 0; }
.second { color: white; text-decoration: none; font-size: 0.95rem; }

/* ================== MAIN CONTAINER — MOBILE BASE ================== */
main.cart-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ================== CART ITEMS ================== */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Cart card */
.cart-card {
  display: flex;
  flex-direction: column;
  background: white;
  padding: 0.9rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  gap: 0.8rem;
}

/* Image */
.cart-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
}

/* Info */
.cart-info { flex: 1; min-width: 0; }
.cart-info h3 { margin: 0; font-size: 1rem; }
.cart-info p { margin: 0.3rem 0; font-size: 0.95rem; color: #555; }

/* Price */
.price { margin-top: 0.5rem; font-size: 1rem; }
.price .old-price { text-decoration: line-through; color: #888; margin-right: 0.5rem; }
.price .new-price { font-weight: bold; color: #000; margin-right: 0.5rem; }
.price .discount { color: #388e3c; font-weight: 600; }

/* Quantity controls */
.qty-form { display: flex; align-items: center; margin-top: 0.8rem; gap: 0.25rem; }
.qty-form button {
  background: #f1f3f6;
  border: 1px solid #ccc;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
}
.qty-form input[type="number"] {
  width: 60px;
  text-align: center;
  border: 1px solid #ccc;
  margin: 0 0.5rem;
  border-radius: 4px;
  padding: 0.3rem;
  -moz-appearance: textfield;
}
.qty-form input[type="number"]::-webkit-outer-spin-button,
.qty-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Actions */
.actions { margin-top: 0.8rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.actions button { background: none; border: none; color: #2874f0; font-size: 0.95rem; cursor: pointer; }
.actions button.remove { color: #d32f2f; }

/* ================== CART SUMMARY ================== */
.cart-summary {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  width: 100%;
}
.cart-summary h2 { margin-bottom: 1rem; font-size: 1rem; color: #555; }
.cart-summary p { display: flex; justify-content: space-between; margin: 0.6rem 0; font-size: 0.95rem; }
.cart-summary .green { color: #388e3c; }
.cart-summary .total { font-weight: bold; font-size: 1.1rem; }
.cart-summary .savings { margin-top: 0.8rem; color: #388e3c; font-size: 0.9rem; }

/* Checkout button */
.checkout-btn {
  margin-top: 1.5rem;
  width: 100%;
  background: #fb641b;
  color: white;
  padding: 0.9rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
}
.checkout-btn:hover { background: #e85a15; }

/* ================== EMPTY CART ================== */
.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  gap: 1rem;
  color: #444;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin: 1.5rem auto;
  width: 100%;
  max-width: 600px;
  padding: 2rem 1.2rem;
}

.empty-cart img {
  width: 150px;
  height: auto;
  opacity: 0.9;
}

.empty-cart h2 { font-size: 1.4rem; color: #222; margin-top: 1rem; }
.empty-cart p { font-size: 1rem; color: #666; }

.empty-cart .button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.4rem;
  background: #2874f0;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.3s ease;
}
.empty-cart .button:hover { background: #1257c4; }

/* ================== FOOTER ================== */
.footer { text-align: center; padding: 1rem; background: #111; color: #fff; width: 100%; }

/* ================== TABLET (600px+) ================== */
@media (min-width: 600px) {
  main.cart-container {
    padding: 1.5rem;
    gap: 2rem;
  }

  .cart-card {
    flex-direction: row;
    align-items: flex-start;
  }

  .cart-img {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
  }

  .empty-cart {
    margin: 2rem auto;
    padding: 2rem;
  }

  .empty-cart img {
    width: 180px;
  }

  .empty-cart h2 {
    font-size: 1.6rem;
  }
}

/* ================== DESKTOP (768px+) ================== */
@media (min-width: 768px) {

  /* ---- NAVBAR ---- */
  .navbar {
    padding: 0rem 2rem;
  }

  /* Hide hamburger on desktop */
  .hamburger {
    display: none;
  }

  /* Restore nav as horizontal desktop bar */
  #main-nav {
    display: flex !important;
    position: static;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    border: none;
    max-height: none;
    overflow: visible;
    top: auto;
    animation: none !important;
    align-items: center;
  }

  nav ul {
    flex-direction: row;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
  }

  nav ul li {
    position: relative;
    border-bottom: none;
  }

  nav ul li a {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-block;
    border-bottom: none;
    text-transform: none;
    letter-spacing: 0;
  }

  nav ul li a:hover {
    background: linear-gradient(90deg, #e7b9b9, #d16e11);
    color: #fff;
    box-shadow: 0 0 10px rgba(209, 110, 17, 0.5);
  }

  /* Restore Cart / Profile parent link to normal nav link */
  .dropdown > a.bossd {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.5rem 0.8rem;
    border-bottom: none;
    cursor: pointer;
    pointer-events: auto;
  }

  /* Restore dropdown to hover-triggered absolute menu */
  .dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(24, 29, 37, 0.97);
    backdrop-filter: blur(10px);
    border-radius: 0 0 8px 8px;
    padding: 0.6rem 0;
    min-width: 160px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    visibility: hidden;
    z-index: 3000;
    border-bottom: none;
  }

  .dropdown-menu li a {
    display: block;
    padding: 0.6rem 1rem;
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: none;
    text-transform: none;
    letter-spacing: 0;
    padding-left: 1rem;
  }

  .dropdown-menu li a:hover {
    background: linear-gradient(90deg, #d16e11, #e7b9b9);
    color: #fff;
  }

  /* ---- CART LAYOUT — DESKTOP SIDE BY SIDE ---- */
  .thala {
    padding: 0.5rem 2rem;
  }

  main.cart-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 5rem;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
  }

  .cart-items {
    flex: 2.2;
  }

  .cart-summary {
    flex: 1;
    min-width: 280px;
    width: auto;
  }

  .cart-img {
    width: 120px;
    height: 120px;
  }

  .cart-info h3 {
    font-size: 1.1rem;
  }

  .empty-cart {
    margin: 3rem auto;
  }
}

/* ================== LARGE DESKTOP (1024px+) ================== */
@media (min-width: 1024px) {
  main.cart-container {
    padding: 2rem 4rem;
  }
}
