/* ==========================================================================
   TRENDSPICK CHECKOUT & SHOPPING CART STYLESHEET (MOBILE-FIRST)
   Strict Image Dimensions, 2-Column Responsive Desktop Grid,
   Step Progress Bar, Branded Address Cards, Tabular Price Breakdown
   ========================================================================== */

/* ==================== 1. SHOPPING CART PAGE STYLES ==================== */
.tp-cart-heading {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.tp-checkout-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
}

@media (min-width: 992px) {
  .tp-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-6);
    align-items: start;
  }
}

.tp-checkout-main-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.tp-checkout-side-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: static;
}

@media (min-width: 992px) {
  .tp-checkout-side-col {
    position: sticky;
    top: 140px;
  }
}

/* Card Container */
.tp-card {
  background-color: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.tp-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand-dark);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--brand-border);
  margin-bottom: var(--space-4);
}

/* Cart Item Row */
.cart-page-item-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--brand-border);
}

.cart-page-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-page-item-row:first-child {
  padding-top: 0;
}

/* Strict Image Constraining - Prevents Full-Resolution Overflow */
.cart-item-img {
  width: 88px !important;
  height: 88px !important;
  min-width: 88px !important;
  min-height: 88px !important;
  max-width: 88px !important;
  max-height: 88px !important;
  object-fit: contain !important;
  background-color: #F8FAFC;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

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

/* Item Details */
.cart-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.35;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.cart-item-title:hover {
  color: var(--brand-primary);
}

.cart-item-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cart-selling-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.cart-mrp {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Actions Row: Qty Controller + Remove */
.cart-item-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.tp-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  background-color: #FFF;
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F8FAFC;
  border: none;
  font-weight: 800;
  font-size: 1rem;
  color: var(--brand-dark);
  cursor: pointer;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background-color: #E2E8F0;
}

.qty-val {
  min-width: 36px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.tp-link-btn.text-danger {
  color: #DC2626 !important;
  font-size: 0.82rem;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
}

.tp-link-btn.text-danger:hover {
  text-decoration: underline;
}

/* Price Breakdown Table */
.tp-price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
}

.price-row-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1.5px solid var(--brand-border);
  padding-top: 14px;
  margin-top: 6px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brand-dark);
}

.tp-total-amt {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--brand-primary);
}

.text-success {
  color: #16A34A !important;
  font-weight: 700;
}

.text-muted {
  color: #94A3B8 !important;
}

/* ==================== 2. CHECKOUT 3-STEP FLOW STYLES ==================== */
.tp-checkout-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-4) 0 var(--space-12) 0;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .tp-checkout-layout {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: var(--space-8);
    align-items: start;
  }
}

/* Step Progress Bar */
.tp-step-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  grid-column: 1 / -1;
  box-shadow: var(--shadow-xs);
}

.tp-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tp-step-item.active {
  color: var(--brand-primary);
}

.tp-step-item.completed {
  color: #16A34A;
}

.tp-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #F1F5F9;
  color: var(--text-secondary);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.tp-step-item.active .tp-step-number {
  background-color: var(--brand-primary);
  color: #FFF;
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.tp-step-item.completed .tp-step-number {
  background-color: #16A34A;
  color: #FFF;
}

.tp-step-divider {
  flex: 1;
  height: 2px;
  background-color: #E2E8F0;
  margin: 0 12px;
}

@media (max-width: 576px) {
  .tp-step-item span {
    display: none;
  }
}

/* Checkout Card & Addresses */
.tp-checkout-card {
  background-color: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--space-4);
}

.tp-checkout-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--brand-border);
}

.tp-checkout-card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-address-card-option {
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s ease;
}

.tp-address-card-option:hover, .tp-address-card-option.selected {
  border-color: var(--brand-primary);
  background-color: #FFF7ED;
}

/* Compact Product Items in Checkout Summary */
.tp-checkout-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tp-checkout-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
}

.tp-checkout-item-img {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  min-height: 68px !important;
  max-width: 68px !important;
  max-height: 68px !important;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-border);
  object-fit: contain !important;
  background-color: #F8FAFC;
  padding: 4px;
  flex-shrink: 0;
}

.tp-checkout-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tp-checkout-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-checkout-item-qty {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tp-checkout-item-price {
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand-dark);
  flex-shrink: 0;
}

/* Payment Choice Cards */
.tp-payment-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-4);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tp-payment-choice-card:hover, .tp-payment-choice-card.selected {
  border-color: var(--brand-primary);
  background-color: #FFF7ED;
}
