/* ===== Coherent with main design ===== */
:root {
  --primary: #111111; /* neutralized */
  --primary-dark: #000000;
  --dark: #121212;
  --darker: #0A0A0A;
  --light: #F8F9FA;
  --lighter: #FFFFFF;
  --accent: #555555; /* neutral accent */
  --gray: #2D2D2D;
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.16);
}

/* ===== Viewport clamps to prevent horizontal overflow on mobile ===== */
@media (max-width: 640px) {
  .main-container,
  .cart-grid,
  .cart-row,
  .summary-card,
  .checkout-btn { max-width: 100vw; overflow-x: hidden; }
  .navbar { padding-left: 12px; padding-right: 12px; overflow-x: hidden; }
}

/* ===== Layout safety resets ===== */
*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; display: block; }


/* Mobile: show larger cards but fewer per viewport width */
@media (max-width: 768px) {
  .reco-grid { gap: 12px; margin-left: 0; margin-right: 0; padding-left: 12px; padding-right: 12px; }
  .reco-grid .reco-card { flex-basis: 72vw; width: 72vw; }
  .main-container { padding: 0 12px; max-width: 100vw; overflow-x: hidden; }
}

/* ===== Base & Reset ===== */
html, body { overflow-x: hidden; width: 100%; }
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #FFFFFF;
  color: #111111;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

/* ===== Navbar - Consistent with main page ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  color: #111111;
  padding: 1.2rem 3rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.navbar .logo img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  margin-left: auto;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.nav-links a {
  color: #111111;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  position: relative;
  padding: 0.5rem 0;
  opacity: 0.9;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a:hover::after {
  width: 100%;
}

/* ===== Main Content ===== */
.main-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  overflow-x: hidden; /* clamp to viewport; internal scrollers manage their own overflow */
}

/* ===== New Cart Grid (items + summary) ===== */
.cart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  overflow-x: hidden; /* prevent inner content from widening page */
  min-width: 0; max-width: 100%;
}

/* ===== Empty state already defined; reuse .empty-cart ===== */

/* ===== Cart rows (list style, like reference) ===== */
.cart-row {
  display: grid;
  grid-template-columns: 120px 1fr 120px 120px 120px;
  align-items: center;
  gap: 1rem;
  min-width: 0; max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfbfb, #f3f4f6);
  box-shadow: 0 8px 24px rgba(0,0,0,.06), 0 1px 0 rgba(255,255,255,.85) inset;
}
.cart-row > * { min-width: 0; }

.cart-media img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-info h3 { margin: 0 0 .25rem 0; overflow-wrap: anywhere; word-break: break-word; }
.cart-info { min-width: 0; }
.cart-info .muted { color: #666; font-size: .95rem; margin: .25rem 0; overflow-wrap: anywhere; word-break: break-word; }
.cart-info .link { background: none; border: none; color: #d00; cursor: pointer; padding: 0; }
.cart-info .link.danger { color: #E63946; }

.cart-qty input[type="number"] {
  width: 80px;
  height: 38px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  text-align: center;
}

.cart-price, .cart-total {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: #111111;
  font-size: 18px;
}

/* ===== Summary card ===== */
.summary-card {
  position: sticky;
  top: 90px;
  border: none;
  border-radius: 14px;
  padding: 1.25rem;
  height: fit-content;
  background: linear-gradient(180deg, #fbfbfb, #f3f4f6);
  box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.85) inset;
  width: 100%;
  max-width: 100%;
}
.summary-card h3 {
  margin-top: 0;
  margin-bottom: .75rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: #111111;
  font-size: 18px;
}
.summary-line, .summary-total { display: flex; justify-content: space-between; padding: .6rem 0; }
.summary-card .summary-line span,
.summary-card .summary-total span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.summary-line { box-shadow: 0 1px 0 rgba(0,0,0,.06) inset; }
.summary-total {
  margin-top: .6rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: #111111;
  font-size: 18px;
}
.checkout-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: center;
  margin-top: 1rem;
  height: 48px;
  line-height: 48px;
  background: #111;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  box-sizing: border-box;
}

/* ===== Favorites & recommendations ===== */
.favorites-block, .reco-block { margin-top: 2rem; }
.reco-block { overflow-x: hidden; }
.reco-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;           /* keep on one line */
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  padding-bottom: .5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; /* smooth iOS */
  overscroll-behavior-x: contain;    /* keep scroll local */
  touch-action: pan-x;               /* ensure horizontal swipe scrolls */
  scrollbar-gutter: stable both-edges; /* avoid layout shift when scrollbar appears */
}
.reco-grid::-webkit-scrollbar { height: 8px; }
.reco-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
.reco-grid > * { min-width: 0; }
.reco-grid .reco-card { flex: 0 0 240px; width: 240px; border: none; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #ffffff, #f5f6f8); box-shadow: 0 8px 20px rgba(0,0,0,.08); scroll-snap-align: start; }
.reco-grid .reco-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.reco-grid .reco-card .reco-info { padding: .5rem .75rem; font-size: .95rem; }

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .cart-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .navbar { padding: 1rem 1.5rem; }
}

@media (max-width: 768px) {
  .cart-row { grid-template-columns: 80px 1fr; }
  .cart-media img { height: 80px; }
  .cart-qty, .cart-price, .cart-total { grid-column: 1 / -1; }
  .cart-grid { gap: 1rem; }
  .cart-qty input[type="number"] { width: 64px; }
}

@media (max-width: 560px) {
  .cart-row { grid-template-columns: 80px 1fr; grid-auto-rows: auto; }
  .cart-qty, .cart-price, .cart-total { justify-self: start; }
  .cart-qty { margin-top: .5rem; }
  .cart-price, .cart-total { margin-top: .25rem; }
  .cart-media img { height: 72px; }
}

/* XS phones: final clamps */
@media (max-width: 375px) {
  .navbar { padding: 12px; }
  .cart-grid { gap: 10px; }
  .cart-row {
    grid-template-columns: 72px 1fr;
    gap: 10px;
    padding: 12px;
  }
  .cart-qty input[type="number"] { width: 56px; }
  .summary-card { padding: 14px; }
}

/* ===== Cart Title ===== */
.cart-title {
  text-align: center;
  margin: 3rem 0 2rem;
  font-size: 2.2rem;
  font-weight: 800;
  color: #111111;
}

/* ===== Empty Cart ===== */
.empty-cart {
  text-align: center;
  padding: 3rem;
  background: linear-gradient(180deg, #fafafa, #f1f5f9);
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 26px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.85) inset;
  margin: 2rem 0;
}

.empty-cart p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: rgba(0, 0, 0, 0.7);
}

.empty-cart a {
  display: inline-block;
  background: #111111;
  color: #FFFFFF;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

/* ===== Cart Items Grid ===== */
#cartItems {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* ===== Cart Item Card ===== */
.cart-item {
  display: flex;
  gap: 1.5rem;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cart-item img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
}

.cart-item-content {
  flex: 1;
}

.cart-item h3 {
  margin-bottom: 0.5rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: #111111;
  font-size: 18px;
}

.cart-item p {
  margin: 0.3rem 0;
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.95rem;
}

.cart-item strong {
  font-weight: 600;
  color: #111111;
}

.cart-item .quantity {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 0.9rem;
}

.cart-item .item-total {
  font-weight: 700;
  font-size: 1.1rem;
  color: #111111;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

.cart-item button {
  background: transparent;
  color: #E63946;
  border: none;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  font-weight: 600;
  box-shadow: none;
}

.cart-item button i {
  font-size: 0.9rem;
}

/* ===== Client Form ===== */
.client-form {
  background: linear-gradient(180deg, #fafafa, #f1f5f9);
  border-radius: 16px;
  padding: 2rem;
  border: none;
  box-shadow: 0 10px 26px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.85) inset;
  margin-top: 3rem;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #111111;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: #111111;
  border-radius: 3px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #111111;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 1rem;
  background: #ffffff;
  border: none;
  border-radius: 10px;
  color: #111111;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: 0 1px 0 rgba(0,0,0,.06) inset, 0 4px 14px rgba(0,0,0,.06);
}

input[type="text"],
textarea:focus {
  outline: none;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.08);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* ===== Submit Button ===== */
button[onclick="validateOrder()"],
button {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 2rem auto 0;
  background: #111111;
  color: #FFFFFF;
  border: none;
  padding: 1rem;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

button[onclick="validateOrder()"] ::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.6s;
}

button[onclick="validateOrder()"] :hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

button[onclick="validateOrder()"] ::before {
  left: 100%;
}

/* pop up */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-content {
  background: linear-gradient(180deg, #fbfbfb, #f3f4f6);
  padding: 32px 28px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.9) inset;
  max-width: 92%;
  width: 440px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.popup-content h2 {
  color: #111111;
  font-weight: 700;
  font-size: 2rem;
  margin: 0 0 10px 0;
}

.popup-content p{
  color: #374151;
  font-weight: 400; /* Regular */
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 6px 0;
}
.popup-content button {
  margin-top: 16px;
  padding: 12px 20px;
  background: #111111;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
}
.popup-content button:hover {
  background: #1f2328;
}


/* ===== Responsive Design ===== */
@media (max-width: 992px) {
  .navbar {
    padding: 1rem 2rem;
  }
  
  .cart-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .cart-item {
    flex-direction: column;
  }
  
  .cart-item img {
    width: 100%;
    height: auto;
    max-height: 200px;
  }
  
  .cart-item-actions {
    flex-direction: row;
    justify-content: flex-start;
    margin-top: 1rem;
    width: 100%;
  }
  
  .client-form {
    padding: 1.5rem;
  }
  .popup-content { width: 92%; padding: 24px 18px; border-radius: 14px; }
  .popup-content h2 { font-size: 1.6rem; }
  .popup-content p { font-size: 1.02rem; }
  .popup-content button { width: 100%; font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
  }
  .navbar .logo img { height: 32px; }
  .nav-links {
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
  }
  
  .cart-title {
    font-size: 1.8rem;
  }
  
  .submit-btn {
    width: 100%;
  }
}








