/* ========== GLOBAL STYLES ========== */
.product_link {
  text-decoration: none;
  color: #111;
  transition: color 0.2s ease;
}

.product_link:hover {
  color: #007bff;
}

.disabled-link {
  pointer-events: none;
  color: #ccc;
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== CART CONTAINER ========== */
.cart-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0 auto;
  max-width: 1200px;
  padding: 16px;
  min-height: 400px;
}

/* ========== CART ITEMS SECTION ========== */
.cart-items-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  min-height: 500px;
}

.cart-items-section h3 {
  margin: 0;
  padding: 20px 24px 16px 24px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #111;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.cart-item-row {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #f0f0f0;
  padding: 24px auto;
  transition: background-color 0.2s ease;
  position: relative;
  min-height: 120px;
  width: 500px;

    /* New dashed border */
  border: 1px dashed #ccc;
  border-radius: 8px;
  margin-bottom: 16px; /* spacing between products */
}

.cart-item-row:hover {
  background-color: #fafafa;
}

/* ========== PRODUCT IMAGE ========== */
.cart-thumb-link {
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.cart-thumb {
  width: 175px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  transition: transform 0.2s ease;
}

.cart-thumb:hover {
  transform: scale(1.02);
}

/* ========== PRODUCT INFO ========== */
.cart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #111;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-desc {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.price {
  font-weight: 700;
  color: #111;
  font-size: 1.1rem;
  margin: 0;
}

/* ========== QUANTITY ========== */
.cart-qty {
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  min-width: 80px;
  text-align: right;
  background: #f8f9fa;  
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

/* ========== CART CONTROLS BUTTONS ========== */

.cart-actions-row{
  max-width: 175px;
  margin: 0 0 0 0;
  .cart-controls{
  margin-left: 0px;
}
}

.delete-form{
  max-width: 50px;
  background-color: #ff6b6b;
  color: white ;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}
.delete-btn{
  height: 30px;
  font-size: 16px;
  text-align: center;
  color: white;
  background-color:#dddddd00;
  border-color: #00000000;
}
.delete_icon{
  width: 100%;
  height: 100%;
}
.cart-controls-conainer-cartpage .cart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background-color: #a3e9d0;
}

.cart-controls-conainer-cartpage .cart-controls button {
  /* background: linear-gradient(135deg, #00b894, #00a085); */
  border: none;
  background-color: transparent;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  /* box-shadow: 0 2px 6px rgba(0, 184, 148, 0.3); */
}

.cart-controls-conainer-cartpage .cart-controls span {
  font-size: 16px;
  font-weight: 600;
  color: white;
  min-width: 24px;
  text-align: center;
  display: inline-block;
}

/* "Add to Cart" button (when qty = 0) */
/* .cart-controls .addBtn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #00b894, #00a085);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 184, 148, 0.3);
} */

/* ========== BILL SECTION ========== */
.bill-section {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
}

.bill-section h4 {
  margin: 0 0 20px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  font-size: 0.95rem;
}

.bill-row:last-of-type:not(.total) {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.total {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 0;
  border-top: 2px solid #f0f0f0;
  margin-top: 8px;
}

.total span:last-child {
  color: #e74c3c;
  font-weight: 700;
}

/* ========== CHECKOUT BUTTON ========== */
.checkout-btn-container {
  width: 100%;
  /* background: linear-gradient(135deg, #a3e9d0 0%, #8dd3c7 100%); */
  background-color: rgba(0, 184, 148, 0.25);
  border: none;
  border-radius: 8px;
  margin-top: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(163, 233, 208, 0.3);
}

.checkout-btn-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(163, 233, 208, 0.4);
}

.checkout-btn-container:active {
  transform: translateY(0);
}

#checkout-link {
  text-decoration: none;
  color: #111;
  display: block;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 24px;
  transition: color 0.2s ease;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Small phones (≤480px) */
@media (max-width: 480px) {
  .cart-container {
    padding: 12px;
    gap: 16px;
  }
  .product-title{
    font-size: 1.14rem;
    font-weight: 600;
    color:#111;
    line-height: 50px;
  }
  
  .cart-item-row {
    padding: 12px;
    gap: 12px;
    flex-wrap: none;
    width: auto;
  }
  
  .cart-thumb {
    width: 150px;
    height: 175px;
  }
  
  .product-desc {
    font-size: 0.8rem;
  }
  
  .price {
    font-size: 0.95rem;
  }
  
  .bill-section {
    padding: 16px;
  }
  
  .bill-section h4 {
    font-size: 1.1rem;
  }
  
  #checkout-link {
    font-size: 1rem;
    padding: 12px 20px;
  }
  .cart-controls-conainer-cartpage .cart-controls {
    padding: 2px;
    gap: 4px;
    width: 80%;
    justify-content: center;
  }
}

/* Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .cart-container {
    padding: 20px;
  }
  
  .cart-thumb {
    width: 90px;
    height: 90px;
  }
  
  .cart-item-row {
    padding: 16px;
    width: auto;
  }
}

/* Desktop (≥769px) */
@media (min-width: 769px) {
  .cart-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    padding: 24px;
  }

  .cart-items-section {
    flex: 0 0 50%;
    width: 100%;
    padding-right: 24px;
    box-sizing: border-box;
  }

  .bill-section {
    flex: 0 0 50%;
    width: 50%;
    position: sticky;
    top: 24px;
    align-self: flex-start;
    margin: 0;
  }

  .cart-thumb {
    width: 175px;
    height: 125px;
  }
  
  .product-title {
    font-size: 1.1rem;
  }
  
  .price {
    font-size: 1.05rem;
  }
  
  .cart-item-row {
    padding: 20px;
  }
  
  .bill-section {
    padding: 28px;
  }
}

/* Large desktop (≥1200px) */
@media (min-width: 1200px) {
  .cart-container {
    gap: 40px;
  }
  
  .cart-thumb {
    width: 175px;
    height: 125px;
  }
  
  .product-title {
    font-size: 1.15rem;
  }
}

.section{
  margin: 0 20px auto;
}

.product-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 16px;
    padding-top: 5px;
    scroll-behavior: smooth;
}

.product-card {
    flex-shrink: 0;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: justify;
    gap: 14px;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
}

.product-info {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    color: #000000;
}
.product-link {
    text-decoration: none;
    color: inherit;
}

.product-card {
    flex-shrink: 0;
    width: 270px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    border-radius: 16px 16px 0 0;
}

.product-details {
    padding: 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-size: 20px;
    font-weight: 600;
    text-align: left;
    color: #000;
    line-height: 1.4;
}

.product-meta {
    font-size: 15px;
    color: #777;
}

.product-price {
    font-size: 18px;
    font-weight: 500;
    color: #1e1e1e;
}
/* --- Modal Overlay --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* translucent */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  display: none; /* hidden by default */
}

/* --- Modal Box --- */
.modal-box {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Heading */
.modal-box h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #e53935;
}

/* Message */
.modal-box p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #333;
}

/* Button */
.modal-btn {
  background: #e53935;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.modal-btn:hover {
  background: #c62828;
}