/* ========================================================================
   -TH 22.11.2026: Purchase-flow styling.
   GARAGE-SHOP PURCHASE JOURNEY STYLING
   Conversion-optimized, clean, and modern design
   ======================================================================== */

/* ========================================================================
   1. HEADER - SHOPPING CART BUTTON
   ======================================================================== */

/* ========================================================================
   GARAGE-SHOP PURCHASE JOURNEY - SHOPPING CART BUTTON BADGE
   Dynamic cart item counter badge
   ======================================================================== */

#headerShortcuts .ui-button {
  position: relative;
}

/* Add data-cart-count attribute to button for badge display */
#headerShortcuts a[href*="shopping_cart"].ui-button::after {
  content: attr(data-cart-count);
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: badgePulse 0.3s ease;
}

@keyframes badgePulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Hide badge if no items in cart */
#headerShortcuts a[href*="shopping_cart"]:not([data-cart-count]) .ui-button::after,
#headerShortcuts a[href*="shopping_cart"][data-cart-count="0"].ui-button::after {
  display: none;
}

/* ========================================================================
   2. SHOPPING CART PAGE STYLING
   ======================================================================== */

.productListTable2 {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin: 20px 0;
}

.ui-widget-header_keski {
  background: #fff !important;
  color: #2c3e50 !important;
  padding: 20px !important;
  border-radius: 8px 8px 0 0 !important;
  border-bottom: 2px solid #ecf0f1 !important;
}

.ui-widget-header_keski h1 {
  margin: 0 !important;
  font-size: 28px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  color: #2c3e50 !important;
}

/* Shopping cart table styling */
.productListTable2 table {
  width: 100% !important;
  border-collapse: collapse;
  margin: 0;
}

.productListTable2 table tr {
  border-bottom: 1px solid #ecf0f1;
  transition: background-color 0.2s ease;
}

.productListTable2 table tr:hover {
  background-color: #f8f9fa;
}

.productListTable2 table td {
  padding: 20px !important;
  vertical-align: middle;
  font-size: 14px;
  color: #2c3e50;
}

.productListTable2 table td.right {
  text-align: right;
  font-weight: 500;
}

/* Product image in cart */
.productListTable2 table td img {
  max-width: 80px;
  height: auto;
  border-radius: 4px;
  display: block;
}

.productListTable2 table td a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.productListTable2 table td a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* Quantity input field */
.shopping-cart input[name="cart_quantity[]"][type="text"],
.shopping-cart input[name="cart_quantity[]"][type="number"] {
  width: 60px;
  padding: 8px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.shopping-cart input[name="cart_quantity[]"][type="text"]:focus,
.shopping-cart input[name="cart_quantity[]"][type="number"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Cart totals section */
.contentContainer {
  padding: 20px 20px !important;
}

.shoppingcart-totals {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shoppingcart-totals .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #2c3e50;
}

.shoppingcart-totals .row.total {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  border-top: 2px solid #bdc3c7;
  padding-top: 12px;
  margin-top: 8px;
}

.shoppingcart-totals .row.total::before {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  top: 0;
}

/* ========================================================================
   3. CHECKOUT BUTTONS & CTA
   ======================================================================== */

.checkout-button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
  align-items: center;
  justify-content: center;
}

.checkout-cta-primary {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  color: white !important;
  border: none;
  padding: 16px 40px !important;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-height: 50px;
  justify-content: center;
}

.checkout-cta-primary:hover {
  background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
  box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
  transform: translateY(-2px);
}

.checkout-cta-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.checkout-cta-secondary {
  background: white;
  color: #2c3e50 !important;
  border: 2px solid #bdc3c7;
  padding: 14px 32px !important;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-height: 48px;
  justify-content: center;
}

.checkout-cta-secondary:hover {
  border-color: #3498db;
  color: #3498db !important;
  background: #ecf0f1;
}

/* Continue shopping button */
.continue-shopping-btn {
  background: white;
  color: #2c3e50 !important;
  border: 2px solid #34495e;
  padding: 14px 32px !important;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.continue-shopping-btn:hover {
  background: #34495e;
  color: white !important;
  box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
}

/* ========================================================================
   4. CHECKOUT PAGE STYLING - PROGRESS INDICATOR
   ======================================================================== */

.checkout-progress {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
  position: relative;
}

.checkout-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: #ecf0f1;
  z-index: 0;
}

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

.checkout-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ecf0f1;
  color: #7f8c8d;
  border: 2px solid #bdc3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.checkout-step.active .checkout-step-number {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border-color: #2980b9;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.checkout-step.completed .checkout-step-number {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  color: white;
  border-color: #229954;
}

.checkout-step.completed .checkout-step-number::after {
  content: '✓';
  font-size: 20px;
}

.checkout-step-label {
  font-size: 12px;
  font-weight: 600;
  color: #7f8c8d;
  text-align: center;
  letter-spacing: 0.5px;
}

.checkout-step.active .checkout-step-label {
  color: #2c3e50;
  font-weight: 700;
}

.checkout-step.completed .checkout-step-label {
  color: #27ae60;
}

/* ========================================================================
   5. CHECKOUT FORM STYLING
   ======================================================================== */

.checkout-form-section {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #3498db;
}

.checkout-form-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkout-form-section h3::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background: #3498db;
  border-radius: 50%;
  color: white;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-group label .required {
  color: #e74c3c;
  margin-left: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  border: 1px solid #bdc3c7;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  color: #2c3e50;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #95a5a6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  background: #f8fbff;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

/* Radio buttons and checkboxes */
.form-group input[type="radio"],
.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
  cursor: pointer;
}

.form-group input[type="radio"] + label,
.form-group input[type="checkbox"] + label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

/* ========================================================================
   6. SHIPPING & PAYMENT METHOD SELECTION
   ======================================================================== */

.shipping-method-option,
.payment-method-option {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border: 2px solid #ecf0f1;
  border-radius: 6px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.shipping-method-option:hover,
.payment-method-option:hover {
  border-color: #bdc3c7;
  background: #f8f9fa;
}

.shipping-method-option input[type="radio"],
.payment-method-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: 16px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #3498db;
}

.shipping-method-option.selected,
.payment-method-option.selected {
  border-color: #3498db;
  background: #ecf0f1;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.shipping-method-info,
.payment-method-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.shipping-method-name,
.payment-method-name {
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.shipping-method-desc,
.payment-method-desc {
  font-size: 13px;
  color: #7f8c8d;
  margin-top: 4px;
}

.shipping-method-price,
.payment-method-fee {
  font-weight: 700;
  color: #27ae60;
  font-size: 15px;
  white-space: nowrap;
}

/* ========================================================================
   7. ORDER REVIEW & SUMMARY
   ======================================================================== */

.order-review-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0;
  border: 1px solid #ecf0f1;
}

.order-review-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 16px 0;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #ecf0f1;
  font-size: 14px;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item-name {
  color: #2c3e50;
  flex: 1;
}

.order-item-qty {
  color: #7f8c8d;
  margin: 0 12px;
}

.order-item-price {
  font-weight: 600;
  color: #2c3e50;
  min-width: 80px;
  text-align: right;
}

.order-summary-totals {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #bdc3c7;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 14px;
  color: #2c3e50;
}

.order-summary-row.total {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  margin-top: 12px;
}

/* ========================================================================
   8. ALERTS & MESSAGES
   ======================================================================== */

.checkout-alert {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkout-alert.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.checkout-alert.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.checkout-alert.info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

.checkout-alert.warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.checkout-alert::before {
  content: '';
  font-size: 18px;
  flex-shrink: 0;
}

.checkout-alert.success::before {
  content: '✓';
  color: #155724;
}

.checkout-alert.error::before {
  content: '✕';
  color: #721c24;
}

.checkout-alert.info::before {
  content: 'ℹ';
  color: #0c5460;
}

.checkout-alert.warning::before {
  content: '⚠';
  color: #856404;
}

/* ========================================================================
   9. MOBILE RESPONSIVE ADJUSTMENTS
   ======================================================================== */

@media screen and (max-width: 767px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .checkout-progress {
    margin: 20px 0;
  }

  .checkout-step-label {
    font-size: 11px;
  }

  .checkout-step-number {
    width: 36px;
    height: 36px;
    font-size: 14px;
    margin-bottom: 6px;
  }

  .checkout-form-section {
    padding: 16px;
    margin: 16px 0;
  }

  .checkout-cta-primary,
  .checkout-cta-secondary {
    width: 100%;
    padding: 14px 20px !important;
  }

  .checkout-button-group {
    flex-direction: column;
  }

  .shoppingcart-totals {
    padding: 16px;
    margin: 16px 0;
  }

  .order-review-section {
    padding: 16px;
  }

  .shipping-method-option,
  .payment-method-option {
    padding: 12px;
  }

  .checkout-alert {
    font-size: 13px;
  }
}

@media screen and (max-width: 480px) {
  .checkout-progress::before {
    top: 18px;
  }

  .checkout-step-number {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .checkout-form-section h3 {
    font-size: 16px;
  }

  .checkout-cta-primary,
  .checkout-cta-secondary {
    font-size: 14px;
    min-height: 44px;
  }
}

/* ========================================================================
   10. DESKTOP OPTIMIZATIONS
   ======================================================================== */

@media screen and (min-width: 1025px) {
  .checkout-button-group {
    justify-content: space-between;
    gap: 20px;
  }

  .checkout-cta-primary {
    flex: 1;
    min-width: 200px;
  }

  .form-row {
    gap: 32px;
  }

  .checkout-progress {
    margin: 40px 0;
  }

  .order-review-section {
    position: sticky;
    top: 100px;
  }
}
