/* ============================================
   1. VARIABLES & RESET
   ============================================ */
:root {
  --primary-navy: #0b2341;
  --accent-orange: #ff9900;
  --teal-btn: #169084;
  --border-light: #eeeeee;
  --text-muted: #888888;
  --bg-faint: #fcfcfc;
  --transition: all 0.3s ease;
}

.cart-wrapper {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #fff;
}

/* ============================================
   2. PAGE HEADER / HERO
   ============================================ */
.cart-page-title {
  background-color: var(--primary-navy);
  color: #ffffff;
  padding: 60px 0;
  text-align: center;
  margin-bottom: 50px;
}

.cart-page-title h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0 0 10px 0;
  text-transform: uppercase;
}

.breadcrumbs {
  font-size: 13px;
  color: #bbbbbb;
}

.breadcrumbs a {
  color: #ffffff;
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumbs a:hover {
  color: var(--accent-orange);
}

/* ============================================
   3. DESKTOP TABLE STYLING
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.table-responsive {
  width: 100%;
  margin-bottom: 30px;
  overflow-x: auto;
}

.cart-table-main {
  width: 100%;
  border-collapse: collapse;
}

.cart-table-main th {
  background: #f8f9fa;
  padding: 15px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-light);
}

.cart-table-main td {
  padding: 25px 15px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

/* Remove Icon */
.td-remove a {
  color: #dddddd;
  font-size: 22px;
  transition: var(--transition);
}

.td-remove a:hover {
  color: #e74c3c;
}

/* Product Info Cell */
.product-info-flex {
  display: flex;
  align-items: center;
  gap: 20px;
}

.product-info-flex img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background-color: #f9f9f9;
  border: 1px solid #f1f1f1;
  border-radius: 4px;
}

.product-info-flex span {
  font-weight: 700;
  color: var(--primary-navy);
  font-size: 15px;
}

/* Price & Total Columns */
.td-price,
.td-total {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary-navy);
}

.td-total {
  color: #000;
}

/* Quantity Box Controls */
.qty-box {
  display: inline-flex;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.qty-box button {
  background: #f8f8f8;
  border: none;
  width: 35px;
  height: 38px;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  transition: var(--transition);
}

.qty-box button:hover {
  background: #eee;
  color: #000;
}

.qty-box input {
  width: 45px;
  height: 38px;
  text-align: center;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  font-weight: 700;
  font-size: 14px;
  outline: none;
}

/* ============================================
   4. CART ACTIONS (Buttons)
   ============================================ */
.cart-actions {
  display: flex;
  justify-content: space-between;
  padding: 30px 0 60px;
}

.btn-outline-black {
  border: 2px solid #222;
  padding: 12px 28px;
  font-size: 12px;
  font-weight: 800;
  color: #222;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
}

.btn-outline-black:hover {
  background: #222;
  color: #fff;
}

.btn-grey-update {
  background-color: #f4f4f4;
  border: none;
  padding: 12px 30px;
  color: #888;
  font-weight: 800;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
}

.btn-grey-update:hover {
  background-color: #e0e0e0;
  color: #333;
}

/* ============================================
   5. BOTTOM LAYOUT (Instructions & Totals)
   ============================================ */
.cart-bottom-row {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 50px;
  margin-bottom: 100px;
}

.instructions-col h4,
.totals-box-inner h4 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: 1px;
  color: var(--primary-navy);
}

.instructions-col textarea {
  width: 100%;
  height: 180px;
  border: 1px solid var(--border-light);
  padding: 20px;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.totals-box-inner {
  background-color: var(--bg-faint);
  padding: 40px;
  border: 1px solid #f1f1f1;
}

.total-row-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 14px;
}

.total-row-item.grand-total {
  border-top: 1px solid #ddd;
  padding-top: 20px;
  margin-top: 20px;
  font-weight: 900;
  font-size: 18px;
}

.val-big {
  font-size: 24px;
  color: #000;
}

/* Terms Checkbox */
.terms-area {
  margin: 25px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #666;
}

.terms-area input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-btn);
  cursor: pointer;
}

/* Checkout Button */
.btn-proceed-checkout {
  display: block;
  background-color: var(--teal-btn);
  color: #fff;
  text-align: center;
  padding: 18px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
}

.btn-proceed-checkout:hover {
  background-color: var(--primary-navy);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================
   6. MOBILE RESPONSIVE (STACKED TABLE)
   ============================================ */
@media (max-width: 991px) {
  .cart-bottom-row {
    grid-template-columns: 1fr;
  }
  .totals-col {
    order: -1; /* Totals box above instructions on tablets */
  }
}

@media (max-width: 768px) {
  /* Hide desktop headers */
  .cart-table-main thead {
    display: none;
  }

  /* Make table elements block for stacking */
  .cart-table-main,
  .cart-table-main tbody,
  .cart-table-main tr,
  .cart-table-main td {
    display: block;
    width: 100%;
  }

  .cart-table-main tr {
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
    position: relative;
    background: #fff;
  }

  .cart-table-main td {
    text-align: right;
    padding: 12px 10px;
    border-bottom: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .cart-table-main td:last-child {
    border-bottom: none;
  }

  /* Create labels using the data-label attribute */
  .cart-table-main td::before {
    content: attr(data-label);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--text-muted);
    flex: 1;
    text-align: left;
  }

  /* Position Remove Icon at top left of the card */
  .td-remove {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
    border: none !important;
    width: auto !important;
  }

  .td-remove::before {
    display: none !important;
  }

  /* Product info alignment */
  .product-info-flex {
    justify-content: flex-end;
    flex: 2;
  }

  .product-info-flex img {
    width: 60px;
    height: 60px;
  }

  /* Actions button layout */
  .cart-actions {
    flex-direction: column;
    gap: 15px;
  }

  .btn-outline-black,
  .btn-grey-update {
    width: 100%;
    text-align: center;
  }
}

/* Empty State */
.empty-text {
  padding: 100px 0;
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
}

.btn-auth-return {
  display: inline-block;
  background-color: var(--primary-navy);
  color: #fff;
  padding: 12px 30px;
  text-decoration: none;
  font-weight: 700;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-auth-return:hover {
  background-color: var(--accent-orange);
}
