/* ============================================
   TechStore - Cart & Checkout Styles (REDESIGN)
   Midnight Indigo Design System
   ============================================ */

/* ============================================
   Cart Section
   ============================================ */
.cart-section {
  padding: var(--spacing-xl) 0 var(--spacing-2xl);
  min-height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
}

.cart-section .page-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--spacing-xl);
  text-align: center;
  color: var(--text-primary);
}

.cart-section .page-title i {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ============================================
   Steps Progress
   ============================================ */
.cart-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--spacing-2xl);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-light);
  transition: var(--transition-base);
}

.step.active .step-number {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: scale(1.1);
}

.step.completed .step-number {
  background: linear-gradient(135deg, var(--success-color), #059669);
  border-color: transparent;
  color: white;
}

.step-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
  transition: var(--transition-base);
}

.step.active .step-label {
  color: var(--primary-color);
}

.step.completed .step-label {
  color: var(--success-color);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  min-width: 80px;
  max-width: 160px;
  margin-bottom: 1.5rem;
  transition: var(--transition-base);
  position: relative;
}

.step-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--success-color), var(--success-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.step-line.completed::after {
  transform: scaleX(1);
}

/* ============================================
   Empty Cart
   ============================================ */
.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  text-align: center;
  min-height: 500px;
}

.empty-cart-icon {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(34, 211, 238, 0.08));
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius-full);
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
  opacity: 0.7;
}

.empty-cart-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-cart-text {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: var(--spacing-xl);
  line-height: 1.7;
}

.empty-cart-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================
   Cart Layout
   ============================================ */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--spacing-xl);
  align-items: start;
}

/* ============================================
   Cart Items Panel
   ============================================ */
.cart-items {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.cart-items-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.btn-clear-cart {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-clear-cart:hover {
  border-color: var(--danger-color);
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.05);
}

/* ============================================
   Cart Item
   ============================================ */
.cart-items-list {
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.cart-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
  position: relative;
}

.cart-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
  background: var(--bg-primary);
}

.cart-item-image {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  transition: transform 0.3s ease;
}

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

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.cart-item-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1.4;
}

.cart-item-name a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.cart-item-name a:hover {
  color: var(--primary-color);
}

.cart-item-category {
  font-size: var(--font-size-xs);
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cart-item-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  width: fit-content;
}

.cart-item-status.in-stock {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.cart-item-status.out-of-stock {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.cart-item-price-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  align-items: stretch;
  justify-content: flex-start;
  min-width: 240px;
}

.cart-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

.cart-item-price {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}

.cart-item-price .price-current {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--primary-color);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.cart-item-price .price-per-item {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

.cart-item-price .price-old {
  font-size: var(--font-size-sm);
  color: var(--text-light);
  text-decoration: line-through;
}

.cart-quantity {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-primary);
}

.qty-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 1rem;
}

.qty-btn:hover {
  background: var(--primary-color);
  color: white;
}

.qty-value {
  width: 48px;
  height: 36px;
  border: none;
  text-align: center;
  font-weight: 700;
  font-size: var(--font-size-base);
  background: transparent;
  color: var(--text-primary);
}

.btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--border-color);
  color: var(--text-light);
  background: transparent;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-base);
  flex-shrink: 0;
}

.btn-remove:hover {
  border-color: var(--danger-color);
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.05);
}

.cart-item-total {
  text-align: right;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.cart-item-total strong {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  font-weight: 700;
}

/* Cart Actions Bottom */
.cart-actions {
  display: flex;
  justify-content: flex-start;
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   Cart Summary
   ============================================ */
.cart-summary {
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-md));
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.summary-title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: var(--spacing-md) var(--spacing-lg);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
}

.summary-row span:first-child {
  color: var(--text-secondary);
}

.summary-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.summary-row .discount {
  color: var(--success-color);
}

.summary-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

.summary-total {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(34, 211, 238, 0.05));
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-total span:first-child {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
}

.summary-total span:last-child {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--primary-color);
}

/* Promo Code */
.promo-code {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

.promo-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.promo-input-group {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.promo-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  transition: var(--transition-base);
  box-sizing: border-box;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.promo-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
}

.promo-message {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  display: none;
}

.promo-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  display: block;
}

.promo-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  display: block;
}

/* Delivery Info */
.delivery-info {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

.delivery-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.delivery-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.delivery-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

.delivery-text i {
  color: var(--primary-color);
}

.delivery-text strong {
  color: var(--primary-color);
}

/* Checkout Button */
.btn-checkout {
  width: calc(100% - var(--spacing-lg) * 2);
  margin: var(--spacing-sm) var(--spacing-lg);
  padding: 0.9rem;
  font-size: var(--font-size-base);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  color: white;
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

/* Payment Methods */
.payment-methods {
  text-align: center;
  padding: 0 var(--spacing-lg) var(--spacing-sm);
}

.payment-label {
  font-size: var(--font-size-xs);
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.payment-icons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  font-size: 1.75rem;
  color: var(--text-light);
}

/* Guarantees */
.cart-guarantees {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.guarantee-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.guarantee-item i {
  color: var(--success-color);
  width: 16px;
  flex-shrink: 0;
}

/* ============================================
   Checkout Page
   ============================================ */
.checkout-section {
  padding: var(--spacing-xl) 0 var(--spacing-2xl);
  background: var(--bg-secondary);
  min-height: calc(100vh - var(--header-height));
}

.checkout-section .page-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--spacing-xl);
  text-align: center;
}

.checkout-section .page-title i {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--spacing-xl);
  align-items: start;
}

/* Checkout Form */
.checkout-form {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.form-section {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: var(--spacing-md);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.section-title i {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(34, 211, 238, 0.12));
  color: var(--primary-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.required {
  color: var(--danger-color);
  margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  transition: var(--transition-base);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input.error {
  border-color: var(--danger-color);
}

.form-error {
  display: block;
  color: var(--danger-color);
  font-size: var(--font-size-xs);
  margin-top: 0.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

/* Delivery & Payment Options */
.delivery-options,
.payment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.delivery-option,
.payment-option {
  position: relative;
}

.delivery-option input[type="radio"],
.payment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-base);
  background: var(--bg-secondary);
  position: relative;
}

.option-content::before {
  content: '';
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
  background: var(--bg-primary);
}

.delivery-option input:checked + .option-content,
.payment-option input:checked + .option-content {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.04);
}

.delivery-option input:checked + .option-content::before,
.payment-option input:checked + .option-content::before {
  border-color: var(--primary-color);
  background: var(--primary-color);
  box-shadow: inset 0 0 0 3px var(--bg-primary);
}

.option-content:hover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.03);
}

.option-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(34, 211, 238, 0.1));
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.option-info {
  flex: 1;
  min-width: 0;
}

.option-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.option-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.option-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: var(--font-size-sm);
  margin-top: 0.25rem;
}

.option-price.free {
  color: var(--success-color);
}

/* Address Fields */
#addressFields {
  margin-top: var(--spacing-md);
}

/* Checkboxes */
.form-checkbox {
  margin-bottom: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

.checkbox-label a {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.btn-submit {
  min-width: 220px;
  padding: 0.875rem 2rem;
  font-size: var(--font-size-base);
  font-weight: 700;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  color: white;
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

/* ============================================
   Order Summary Sidebar (Checkout)
   ============================================ */
.order-summary-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-md));
}

.summary-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.summary-card .summary-title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.summary-items {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.75rem var(--spacing-md);
}

.summary-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.summary-item-image {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.summary-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.summary-item-info {
  flex: 1;
  min-width: 0;
}

.summary-item-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
}

.summary-item-quantity {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.summary-item-price {
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
  font-size: var(--font-size-sm);
  align-self: center;
  flex-shrink: 0;
}

.summary-card .summary-details {
  padding: 0.75rem var(--spacing-lg);
}

.summary-card .summary-total {
  padding: var(--spacing-sm) var(--spacing-lg);
}

.summary-guarantees {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 26, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  text-align: center;
  color: white;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl) var(--spacing-2xl);
  backdrop-filter: blur(10px);
}

.loading-spinner i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  color: var(--primary-color);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Order Success Page
   ============================================ */
.success-section {
  margin-top: var(--header-height);
  padding: var(--spacing-xl) 0 var(--spacing-2xl);
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: flex-start;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.success-section::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.success-content {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding-top: var(--spacing-md);
  position: relative;
  z-index: 1;
}

.success-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--success-color), #059669);
  border-radius: var(--radius-full);
  font-size: 3rem;
  color: white;
  animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

@keyframes successPop {
  from {
    transform: scale(0) rotate(-30deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.success-title {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideUp 0.5s ease 0.2s both;
}

.success-message {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  animation: slideUp 0.5s ease 0.3s both;
}

.success-message strong {
  color: var(--primary-color);
  font-weight: 700;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.success-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  animation: slideUp 0.5s ease 0.4s both;
}

.info-card {
  padding: var(--spacing-lg);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.info-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(34, 211, 238, 0.1));
  border-radius: var(--radius-md);
  font-size: 1.35rem;
  color: var(--primary-color);
}

.info-text h3 {
  font-size: var(--font-size-base);
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.info-text p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.order-summary {
  margin: 0 0 var(--spacing-xl);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  text-align: left;
  animation: slideUp 0.5s ease 0.5s both;
  box-shadow: var(--shadow-sm);
}

.order-summary h2 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  text-align: center;
  color: var(--text-primary);
}

.order-items {
  margin-bottom: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  font-size: var(--font-size-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.order-item span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.order-item-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.order-item-image {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.order-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  text-align: left;
}

.order-item-name {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-item-qty {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
}

.order-item-line-total {
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0.75rem;
  border-top: 1.5px solid var(--border-color);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.5rem;
}

.order-total strong {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--primary-color);
}

.success-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
  animation: slideUp 0.5s ease 0.6s both;
}

/* ============================================
   Favorites Section
   ============================================ */
.favorites-section {
  padding: var(--spacing-xl) 0 var(--spacing-2xl);
  min-height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.favorites-section .page-title,
.page-header .page-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--text-primary);
}

.favorites-section .page-title i,
.page-header .page-title i {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EF4444, #F59E0B);
  color: white;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.favorites-info {
  margin-bottom: var(--spacing-lg);
}

.favorites-count {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
}

.favorites-count strong {
  color: var(--primary-color);
  font-weight: 700;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  text-align: center;
  min-height: 500px;
}

.empty-icon {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.08));
  border: 2px dashed rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-full);
  font-size: 4rem;
  color: #EF4444;
  margin-bottom: var(--spacing-lg);
  opacity: 0.7;
}

.empty-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(135deg, var(--text-primary), #EF4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-text {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: var(--spacing-xl);
  line-height: 1.7;
}

.empty-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================
   Recommended Section
   ============================================ */
.recommended-section {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary,
  .order-summary-sidebar {
    position: static;
  }

  .success-info {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .cart-steps {
    gap: 0;
    padding: var(--spacing-md);
  }

  .step-label {
    display: none;
  }

  .step-number {
    width: 38px;
    height: 38px;
    font-size: var(--font-size-sm);
  }

  .step-line {
    min-width: 40px;
    max-width: 80px;
    margin-bottom: 0;
  }

  .cart-item {
    grid-template-columns: 90px 1fr;
  }

  .cart-item-price-section {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    min-width: 0;
  }

  .cart-item-top {
    align-items: center;
  }

  .cart-item-bottom {
    align-items: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .btn-submit {
    min-width: auto;
    width: 100%;
  }

  .delivery-options,
  .payment-options {
    grid-template-columns: 1fr;
  }

  .success-info {
    grid-template-columns: 1fr;
  }

  .success-title {
    font-size: var(--font-size-3xl);
  }

  .order-item {
    align-items: flex-start;
  }

  .order-item-line-total {
    margin-top: 0.2rem;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cart-section .page-title,
  .checkout-section .page-title {
    font-size: var(--font-size-2xl);
  }

  .cart-header {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: stretch;
  }

  .btn-clear-cart {
    width: 100%;
    justify-content: center;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 0.75rem;
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
  }

  .promo-input-group {
    flex-direction: column;
  }

  .promo-input-group .btn {
    width: 100%;
    border-radius: var(--radius-full);
  }

  .success-icon {
    width: 80px;
    height: 80px;
    font-size: 2.25rem;
  }

  .success-title {
    font-size: var(--font-size-2xl);
  }

  .order-summary {
    padding: var(--spacing-md);
  }

  .order-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-item-line-total {
    align-self: flex-end;
  }
}

/* ============================================
   Dark Theme Support
   ============================================ */
[data-theme="dark"] .cart-items,
[data-theme="dark"] .cart-summary,
[data-theme="dark"] .checkout-form,
[data-theme="dark"] .summary-card {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .cart-header,
[data-theme="dark"] .summary-title,
[data-theme="dark"] .summary-card .summary-title,
[data-theme="dark"] .form-section:not(:last-child) {
  background: var(--bg-secondary);
}

[data-theme="dark"] .cart-item,
[data-theme="dark"] .summary-item,
[data-theme="dark"] .option-content {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .cart-item:hover,
[data-theme="dark"] .option-content:hover {
  background: rgba(99, 102, 241, 0.06);
}

[data-theme="dark"] .cart-item-image,
[data-theme="dark"] .summary-item-image {
  background: var(--bg-primary);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .promo-input {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .qty-value {
  background: transparent;
}

[data-theme="dark"] .cart-quantity {
  background: var(--bg-secondary);
}

[data-theme="dark"] .info-card,
[data-theme="dark"] .order-summary {
  background: var(--bg-primary);
}

[data-theme="dark"] .order-item {
  background: var(--bg-secondary);
}

[data-theme="dark"] .form-actions {
  background: var(--bg-secondary);
}

[data-theme="dark"] .success-section::before {
  background: radial-gradient(circle, rgba(129, 140, 248, 0.1) 0%, transparent 70%);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .cart-steps,
  .btn-clear-cart,
  .cart-item-actions,
  .promo-code,
  .delivery-info,
  .btn-checkout,
  .payment-methods,
  .cart-guarantees {
    display: none !important;
  }

  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Accessibility
   ============================================ */
.cart-item:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-checkout:focus,
.btn-remove:focus,
.btn-clear-cart:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cart-item,
  .option-content,
  .btn-checkout,
  .success-icon {
    transition: none;
    animation: none;
  }

  .delivery-progress-fill {
    transition: none;
  }
}
