/* ===============================
   GLOBAL RESET
================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  font-family: Arial, sans-serif;
}


/* ===============================
   HEADER CONTAINER
================================ */
.site-header {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  height: 90px;
  position: relative;
}


/* ===============================
   LEFT LOGO IMAGE
================================ */
.logo-img img {
  height: 60px;
  display: block;
}


/* ===============================
   CENTER BRAND TEXT
================================ */
.brand {
  position: absolute;
  left: 20%;
  transform: translateX(-50%);
}

.brand-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* permanent reggae colors */
.brand-name .r {
  color: #ff2d2d; /* red */
}

.brand-name .eg {
  color: #ffd800; /* yellow */
}

.brand-name .gae {
  color: #00c853; /* green */
}

.brand-name .pixel {
  color: #ffffff; /* white */
}

/* registered symbol smaller */
.brand-name sup {
  font-size: 10px;
  vertical-align: super;
  margin-left: 2px;
  color: #fff;
}


/* ===============================
   NAVIGATION
================================ */
.nav {
  display: flex;
  align-items: center;
  gap: 26px;               
  justify-content: flex-end; 
  padding-right: 50px;       
  margin-left: 30%;
}

/* nav links */
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.25s ease;
}

/* hover effect */
.nav a:hover {
  color: #ffd800;
  transform: scale(1.15);
}

/* active page underline */
.nav a.active {
  text-decoration: underline;
  text-underline-offset: 6px;
}


/* ===============================
   CART ICON
================================ */
.cart {
  position: relative;
  margin-left: 12px;
  cursor: pointer;
}

.cart img {
  width: 26px;
  height: 26px;
}

/* cart number badge */
.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #ffd800;
  color: #000;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 30px;
  width: 90%;
  max-width: 400px;
  color: white;
  text-align: center;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #FFD700;
}

input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: none;
  border-radius: 8px;
  outline: none;
}

.password-wrapper {
  position: relative;
}

.eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: black;
}

button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(45deg, red, yellow, green);
  color: black;
  font-weight: bold;
  cursor: pointer;
}

button.secondary {
  background: rgba(255,255,255,0.2);
  color: white;
}

.links {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
}

.links a {
  color: #FFD700;
  font-size: 14px;
}

.close-btn {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 20px;
  cursor: pointer;
}

.alert {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 15px 20px;
  border-left: 5px solid red;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.hidden {
  display: none;
}

/* OVERLAY */
#cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);

  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;

  z-index: 9998;
}

#cart-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* SIDE CART */
#side-cart {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100%;

  background: #0a0a0a;
  color: white;

  display: flex;
  flex-direction: column;

  transition: right 0.35s ease;
  z-index: 9999;

  box-shadow: -5px 0 25px rgba(0,0,0,0.6);
}

#side-cart.active {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cart-header h2 {
  font-size: 18px;
  color: #FFD700;
  flex: 1;
  margin: 0;
}

#cart-close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  padding-left: 10px;
  width: 50px;
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.cart-item {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border-radius: 10px;

  margin-bottom: 10px;

  border-left: 3px solid #00c853;
}

.cart-footer {
  padding: 15px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.promo-input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: none;
  margin-bottom: 10px;
  background: #111;
  color: white;
}

.cart-total {
  font-weight: bold;
  color: #FFD700;
  margin-bottom: 10px;
}

.cart-item-price {
  color: #FFD700;
}

.cart-item-price,
.cart-total {
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.checkout-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;

  background: linear-gradient(90deg, #00c853, #FFD700);
  border: none;
  border-radius: 8px;
}

.empty-cart-btn {
  width: 100%;
  padding: 10px;

  background: #ff3b3b;
  border: none;
  border-radius: 8px;
  color: white;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0; /* prevents squishing */
}

/* TEXT WRAP FIX */
.cart-item-info {
  flex: 1;
  min-width: 0; /* 🔥 critical for preventing overflow */
}

/* PREVENT TEXT FROM BREAKING LAYOUT */
.cart-item-name {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-qty {
  font-size: 13px;
}

.cart-delete {
  width: 12%;
  background: none;
}

.cart-icon-wrapper {
  position: relative;
  width: 28px;
  height: 28px;
}

/* CART ICON */
.cart-icon-img {
  width: 100%;
  height: 100%;
  display: block;
}

/* SPINNER (hidden by default) */
.cart-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  border: 3px solid transparent;
  border-top: 3px solid red;
  border-right: 3px solid yellow;
  border-bottom: 3px solid green;
  border-radius: 50%;

  animation: spin 0.8s linear infinite;

  display: none;
}

/* SPIN ANIMATION */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cart.loading .cart-icon-img {
  display: none;
}

.cart.loading .cart-spinner {
  display: block;
}

.cart-loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 999;

  background: conic-gradient(
    red,
    yellow,
    green,
    red
  );

  -webkit-mask: radial-gradient(circle 60% at center, transparent 60%, black 61%);
          mask: radial-gradient(circle 60% at center, transparent 60%, black 61%);

  animation: spinCartLoader 0.8s linear infinite;
}

@keyframes spinCartLoader {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===============================
   MOBILE HEADER (NO HAMBURGER)
   DOES NOT AFFECT DESKTOP
================================ */
@media (max-width: 768px) {

  .site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    height: auto;
    gap: 8px;
  }

  /* =========================
     TOP ROW STRUCTURE
  ========================= */

  .logo-img {
    flex: 1;
    display: flex;
    justify-content: flex-start;
  }

  .logo-img img {
    height: 40px;
  }

  .brand {
    flex: 2;
    position: static !important;
    transform: none !important;
    text-align: center;
  }

  .brand-name {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .cart {
    flex: 1;
    display: flex;
    justify-content: flex-end;
  }

  .cart img {
    width: 22px;
    height: 22px;
  }

  /* =========================
     NAVIGATION ROW (BELOW)
  ========================= */

  .nav {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 14px;
    padding: 8px 0 0 0;
    overflow-x: auto;
    white-space: nowrap;
    margin-left: 10%;
  }

  .nav a {
    font-size: 12px;
    padding: 4px 6px;
    flex-shrink: 0;
  }

  /* optional: hide cart inside nav row if duplicated */
  .nav .cart {
    display: none;
  }

  /* remove hover scaling on mobile (prevents jitter) */
  .nav a:hover {
    transform: none;
  }

  /* CLEAN SCROLLBAR */
  .nav::-webkit-scrollbar {
    display: none;
  }

  /* FORCE TOP ROW ELEMENTS */
  .logo-img,
  .brand,
  .cart {
    flex: 1 1 33%;
    display: flex;
    align-items: center;
  }

  .logo-img {
    justify-content: flex-start;
  }

  .brand {
    justify-content: center;
    position: static !important;
    transform: none !important;
    text-align: center;
  }

  .cart {
    justify-content: flex-end;
    order: 3; /* ensures it stays top row */
  }

  /* FORCE NAV TO SECOND ROW */
  .nav {
    flex: 0 0 100%;
    order: 4;

    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 14px;
    margin-left: 1%;
    padding: 8px 0;
  }
    .modal-content {
    padding: 20px;
  }
}
