h2{ 
    text-align:center; 
    margin-top:5rem; 
    font-size: 2rem; 
}
.cart-container{ 
    max-width:800px; 
    margin:3rem auto; 
    background:#F2E8E5; 
    border-radius:10px; 
    padding:2rem; 
    box-shadow:0 4px 12px rgba(0,0,0,.2); 
    overflow-x:auto; 
}
#cart-table{ 
    width:100%; 
    border-collapse:collapse; 
    margin-bottom:2.5rem; 
}
#cart-table th:nth-child(2), 
#cart-table td:nth-child(2){ 
    width:10rem; 
    text-align:center; 
}
#cart-table th{ 
    text-align:center; 
    border-bottom:2px solid #ccc; 
    font-weight:bold; 
    padding:1rem 0; 
    font-size:1rem; 
}
#cart-table td{ 
    padding:1.5rem; 
    vertical-align:middle; 
}
.cart-item-info{ 
    display:flex; 
    align-items:flex-start; 
    gap:1rem; 
}
.cart-item-image{ 
    width:7rem; 
    height:auto; 
    border-radius:6px; 
}
.cart-item-details{ 
    display:flex; 
    flex-direction:column; 
    gap:0.7rem; 
}
.cart-item-name{ 
    font-weight:bold; 
    font-size:1rem; 
    color:#000; 
}
.cart-item-size, 
.cart-item-price{ 
    font-size:0.9rem; 
    color:#555; 
}
.remove-link{ 
    cursor:pointer; 
    color:#D9534F; 
    font-size:.9rem;
    text-decoration:underline; 
    margin-top:.5rem; 
    background:none;
    border:none;
    padding:0;
}
.remove-link:hover{ 
    color:#C9302C; 
    font-weight:bold; 
}
.quantity-controls{ 
    display:flex; 
    align-items:center; 
    gap:.5rem; 
    justify-content:center; 
}

.qty-btn-minus, 
.qty-btn-plus{ 
    width:2.2rem; 
    height:2.2rem; 
    border:1px solid #C49AA0; 
    border-radius:4px; background:#F2E8E5; 
    cursor:pointer; 
    font-size:1.3rem; 
    color:#444; 
    transition:background-color .2s ease; 
}
.qty-btn-minus:hover, 
.qty-btn-plus:hover{ 
    background:#E0D0C9; 
}
.qty-input{ 
    width:3rem; 
    height:2.2rem; 
    text-align:center; 
    border:1px solid #C49AA0; 
    background:#C49AA0; 
    border-radius:4px; font-size:1rem; 
    font-weight:bold; color:#000; 
    flex-shrink:0; 
}
/* Remove browser default arrows */
.qty-input[type=number]::-webkit-inner-spin-button,
.qty-input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.item-total{ 
    text-align:center; 
    font-weight:bold; 
    font-size:1rem; 
    color:#000; 
}
.subtotal{ 
    font-weight:bold; 
    font-size:1.2rem; 
}
#subtotal{ 
    text-align:center; 
    font-weight:bold; 
    font-size:1.2rem; 
}
tfoot td{ 
    border-top:2px solid #ccc; 
    padding-top:1rem; 
}
.cart-buttons{ 
    display:flex; 
    gap:1rem; 
    justify-content:center; 
    margin-top:1.5rem; 
}
#btn-continue{ 
    padding:.8rem 2rem; 
    border:2px solid #C49AA0; 
    background:#FFF; 
    border-radius:5px; 
    font-weight:bold; 
    cursor:pointer; 
    color:#C49AA0; 
}
#btn-continue:hover{ 
    background:#F0E6E6; 
}
#btn-checkout{ 
    padding:.8rem 4rem; 
    border:none; 
    background:#C49AA0; 
    border-radius:5px; 
    font-weight:bold; 
    cursor:pointer; 
    color:#FFF; 
}
#btn-checkout:hover{ 
    background:#A6787E; 
}
#btn-checkout:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.flash{ 
    max-width:800px; 
    margin:1rem auto 0; 
    color:#b00020; 
    text-align:center; 
}
/* Simple toast style */
#toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 1rem;
    position: fixed;
    z-index: 999;
    left: 50%;
    bottom: 30px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.5s, visibility 0.5s;
}
#toast.show {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 768px) {

  /* Stack image + details vertically with spacing */
  .cart-item-info {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
  }

  /* Slightly smaller image for compact layout */
  .cart-item-image {
    width: 90px;
    height: 90px;
    border-radius: 6px;
  }

  /* Reduce padding so items fit better on mobile */
  #cart-table td {
    padding: 0.75rem;
  }

  /* Make product name + text smaller for readability */
  .cart-item-name {
    font-size: 0.95rem;
  }
  .cart-item-size,
  .cart-item-price {
    font-size: 0.85rem;
  }

  /* Quantity controls compact version */
  .quantity-controls {
    gap: 0.35rem;
  }
  .qty-btn-minus,
  .qty-btn-plus {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1.1rem;
  }
  .qty-input {
    width: 2.5rem;
    height: 1.8rem;
    font-size: 0.9rem;
  }

  /* Cart buttons stacked full-width */
  .cart-buttons {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  #btn-continue,
  #btn-checkout {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
  }

  /* Center subtotal + adjust font size */
  .subtotal,
  #subtotal {
    text-align: center;
    font-size: 1rem;
  }

  /* Make table scroll horizontally if overflow */
  .cart-container {
    padding: 1rem;
    overflow-x: auto;
  }

  /* Prevent long product names from overflowing */
  .cart-item-name {
    word-break: break-word;
  }

  /* Reduce top margin for heading on mobile */
  h2 {
    margin-top: 2.5rem;
    font-size: 1.5rem;
  }
}
