/* ------------------------------
   GLOBAL VARIABLES
------------------------------ */
:root {
  --primary: #2c3e50;
  --secondary: #3498db;
  --accent: #e74c3c;
  --light: #f8fafc;
  --gray: #94a3b8;
  --dark-gray: #64748b;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --spacing: 1rem;
  --section-gap: 1.5rem;
  --font-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ------------------------------
   RESET & BASE
------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-base);
}

body {
  background-color: #f5f7fa;
  color: #334155;
  line-height: 1.6;
  padding: var(--spacing);
}

/* ------------------------------
   CONTAINER
------------------------------ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  background: white;
  padding: 1.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ------------------------------
   HEADER & COMPANY
------------------------------ */
.company-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--section-gap);
}

.company-logo img {
  width: 65px;
  height: auto;
}

.company-logo h1 {
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 600;
}

/* ------------------------------
   ALERTS
------------------------------ */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #d1fae5;
  color: #065f46;
  padding: 0.85rem;
  border-radius: var(--radius);
  margin-bottom: var(--section-gap);
  font-size: 0.9rem;
}

.alert i {
  font-size: 1.1rem;
}

/* ------------------------------
   CART HEADER
------------------------------ */
.cart-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: var(--section-gap);
}

.cart-header h2 {
  color: var(--primary);
  font-size: 1.4rem;
  border-bottom: 3px solid var(--secondary);
  display: inline-block;
  padding-bottom: 0.3rem;
}

/* ------------------------------
   BUTTONS
------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: rgba(44, 62, 80, 0.08);
}

.btn-danger {
  background: var(--accent);
  color: white;
}
.btn-danger:hover {
  background: #c0392b;
}

.checkout-btn {
  width: 100%;
  text-align: center;
  background: var(--secondary);
  color: white;
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
   text-decoration: none; /* ✅ Fix underline */
  margin-top: 1rem;
}
.checkout-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

/* ------------------------------
   EMPTY CART
------------------------------ */
.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: #f9f9f9;
  border-radius: var(--radius);
  margin-bottom: var(--section-gap);
}
.cart-empty i {
  font-size: 3rem;
  color: var(--gray);
  margin-bottom: 1rem;
}
.cart-empty p {
  color: var(--dark-gray);
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* ------------------------------
   CART GRID (MOBILE-FIRST)
------------------------------ */
.cart-grid {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  margin-top: var(--section-gap);
}

/* ------------------------------
   CART ITEMS TABLE
------------------------------ */
.cart-items {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  padding-bottom: 0.5rem;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* scrollable on small screens */
}

.cart-table th {
  background: var(--primary);
  color: white;
  padding: 0.85rem;
  text-align: left;
  font-weight: 500;
  font-size: 0.9rem;
}

.cart-table td {
  padding: 1rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  font-size: 0.9rem;
}

.cart-table tr:hover {
  background: rgba(52, 152, 219, 0.05);
}

/* PRODUCT DETAILS */
.product-cell {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.product-image,
.product-image-placeholder {
  width: 70px;
  height: 70px;
  border-radius: 5px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.product-info {
  flex: 1;
}

.product-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.spec-item,
.spec-text,
.no-specs {
  font-size: 0.7rem;
  color: var(--dark-gray);
  line-height: 1.3;
}

/* QUANTITY CONTROL */
.quantity-control {
  display: flex;
  align-items: center;
  margin-top: 0.4rem;
}
.quantity-btn {
  width: 30px;
  height: 30px;
  background: #f1f5f9;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
}
.quantity-btn:hover {
  background: #e2e8f0;
}
.quantity-input {
  width: 45px;
  height: 30px;
  text-align: center;
  border: 1px solid #ddd;
  margin: 0 6px;
  font-size: 0.9rem;
}

/* REMOVE BUTTON */
.remove-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.3rem;
}
.remove-btn:hover {
  color: #b91c1c;
  transform: scale(1.1);
}

/* ------------------------------
   CART SUMMARY
------------------------------ */
.cart-summary {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin-top: var(--section-gap);
}

.summary-title {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.total-row {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
}

/* PAYMENT METHODS */
.payment-methods {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
}
.payment-methods p {
  font-size: 0.8rem;
  color: var(--dark-gray);
  margin-bottom: 0.5rem;
}
.payment-icons {
  display: flex;
  gap: 10px;
}
.payment-icons i {
  font-size: 1.3rem;
  color: var(--dark-gray);
  transition: var(--transition);
}
.payment-icons i:hover {
  color: var(--primary);
}

/* ------------------------------
   TABLET & DESKTOP BREAKPOINTS
------------------------------ */
@media (min-width: 768px) {
  .cart-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
  }
  .cart-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .container {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  body {
    padding: 2rem;
  }
  .product-image {
    width: 80px;
    height: 80px;
  }
}
