/* ======================================
   CART – ADVANCED PREMIUM (SYSTEM MODE)
====================================== */

/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ======================================
   THEME VARIABLES – LIGHT (DEFAULT)
====================================== */
:root {
  --bg-page: #F5F6F8;
  --bg-card: #FFFFFF;
  --bg-soft: #FAFAFA;

  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #8A8A8A;

  --border: #E6E6E6;
  --danger: #D93025;

  /* BUTTON SYSTEM */
  --btn-bg: #111111;
  --btn-text: #FFFFFF;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 18px 45px rgba(0,0,0,0.08);
  --shadow-hover: 0 28px 65px rgba(0,0,0,0.12);
}

/* ======================================
   SYSTEM DARK MODE
====================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #0E0E0E;
    --bg-card: #161616;
    --bg-soft: #1C1C1C;

    --text-primary: #F1F1F1;
    --text-secondary: #B5B5B5;
    --text-muted: #8A8A8A;

    --border: rgba(255,255,255,0.08);

    /* BUTTON SYSTEM */
    --btn-bg: #FFFFFF;
    --btn-text: #111111;

    --shadow-card: 0 20px 55px rgba(0,0,0,0.85);
    --shadow-hover: 0 30px 75px rgba(0,0,0,0.95);
  }
}

/* ======================================
   BODY
====================================== */
body {
  background: var(--bg-page);
  color: var(--text-primary);
}

/* ======================================
   CONTAINER
====================================== */
.cart-container {
  max-width: 1200px;
  margin: auto;
  padding: 40px 20px 70px;
}

.cart-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

/* ======================================
   EMPTY CART
====================================== */
.empty-cart {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 64px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.empty-cart p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

/* ======================================
   BUTTONS – SINGLE SOURCE OF TRUTH
====================================== */
.btn-primary,
.btn-checkout {
  display: inline-block;
  width: 100%;

  background: var(--btn-bg);
  color: var(--btn-text);

  padding: 15px;
  border-radius: var(--radius-sm);

  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-align: center;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.btn-primary:hover,
.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ======================================
   CART GRID
====================================== */
.cart-grid {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 30px;
}

/* ======================================
   CART ITEMS
====================================== */
.cart-items {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.cart-item {
  display: grid;
  grid-template-columns: 90px 1fr 90px 90px 40px;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

/* IMAGE */
.item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg-soft);
}

/* INFO */
.item-info h4 {
  font-size: 16px;
  font-weight: 600;
}

.item-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* QUANTITY */
.item-qty input {
  width: 68px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-primary);
  text-align: center;
}

.item-qty input:focus {
  outline: none;
  border-color: var(--btn-bg);
}

/* PRICE */
.item-price {
  font-weight: 600;
  font-size: 15px;
}

/* REMOVE */
.remove-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.remove-btn:hover {
  color: var(--danger);
}

/* ======================================
   SUMMARY
====================================== */
.cart-summary {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 20px;
  box-shadow: var(--shadow-card);
}

.cart-summary h3 {
  font-size: 18px;
  margin-bottom: 22px;
}

/* SUMMARY ROW */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 14px 0;
  margin-bottom: 26px;

  font-size: 18px;
  font-weight: 700;

  border-bottom: 1px solid var(--border);
}

/* ======================================
   NAVBAR & FOOTER
====================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--btn-bg);
}

.navbar a {
  color: var(--btn-text);
  text-decoration: none;
  font-weight: 500;
}

.footer {
  text-align: center;
  padding: 22px;
  margin-top: 60px;
  color: var(--text-muted);
}

/* ======================================
   RESPONSIVE
====================================== */
@media (max-width: 900px) {
  .cart-grid {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 600px) {
  .cart-title {
    font-size: 22px;
  }

  .cart-item {
    grid-template-columns: 70px 1fr;
    row-gap: 12px;
  }

  .item-qty,
  .item-price,
  .remove-btn {
    grid-column: 2;
  }

  .remove-btn {
    justify-self: flex-end;
  }
}
@media (max-width: 600px) {

  .cart-container {
    padding: 24px 14px 60px;
  }

  .cart-title {
    font-size: 22px;
    text-align: center;
  }

  /* STACK ITEMS CLEANLY */
  .cart-item {
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto auto;
    row-gap: 10px;
    padding: 16px 0;
  }

  /* IMAGE */
  .item-img {
    grid-row: span 3;
    width: 70px;
    height: 70px;
  }

  /* INFO */
  .item-info h4 {
    font-size: 15px;
  }

  .item-info p {
    font-size: 12px;
  }

  /* QUANTITY + PRICE ROW */
  .item-qty,
  .item-price {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  .item-qty input {
    width: 60px;
    padding: 6px;
  }

  .item-price {
    font-size: 14px;
  }

  /* REMOVE BUTTON */
  .remove-btn {
    grid-column: 2;
    justify-self: flex-end;
    font-size: 20px;
  }

  /* SUMMARY */
  .cart-summary {
    margin-top: 24px;
    position: static;
  }

  .btn-checkout {
    padding: 14px;
    font-size: 15px;
  }
}
