/**
 * Enhanced Checkout Styles - Tailwind CSS Style
 * Modern, clean design for WooCommerce checkout
 */

/* =================================
   CUSTOMER DETAILS SECTIONS
   ================================= */

.woocommerce-billing-fields {
  border-top: none !important;
  padding-top: 0px !important;
}

/* Hide billing details header */
.woocommerce-billing-fields h3,
.woocommerce-billing-fields .form-row h3 {
  display: none !important;
}

/* Hide coupon notice */
.woocommerce-form-coupon-toggle,
.checkout_coupon {
  display: none !important;
}

.tp-checkout-section {
  background: white;
  border-radius: 5px;
  margin-bottom: 2rem;
  box-shadow: var(--tp-shadow-md);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tp-section-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.tp-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  padding-top: 0px !important;
}

.tp-section-icon {
  font-size: 1rem;
  color: #ef4444;
}

.tp-section-content {
  padding: 1rem;
}

/* =================================
   ORDER SUMMARY - USING THEME COLORS
   ================================= */
.checkout-sidebar {
  background-color: var(--white);
  border-radius: 5px;
  box-shadow: var(--tp-shadow-md);
  width: 100%;
  overflow: hidden;
  position: relative;
}

.sidebar-section:not(:last-of-type) {
  border-bottom: 1px solid var(--tp-gray-200);
}

.sidebar-section-inner {
  padding: 1rem;
}
.sidebar-section-button {
  padding: 0 1rem 1rem 1rem;
}

.sidebar-title {
  font-size: 1.25rem; /* text-xl */
  font-weight: 600; /* font-semibold */
  color: var(--tp-gray-900);
  margin: 0;
  margin-bottom: 1rem;
}

/* --- Danh s�ch s�n ph�m --- */
.product-list > *:not(:last-child) {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tp-gray-100);
}

.product-item {
  display: flex;
  align-items: center;
  gap: 1rem; /* gap-4 */
}

.product-image-container {
  flex-shrink: 0;
  width: 64px; /* w-16 */
  height: 64px; /* h-16 */
  border-radius: 5px; /* rounded-lg */
  background-color: var(--tp-gray-100);
  overflow: hidden;
  border: 1px solid var(--tp-gray-200);
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder for products without image */
.product-image-container:empty::before,
.product-image-container img[src=""]::after,
.product-image-container img:not([src])::after {
  content: "\f1c5"; /* fa-file-image-o */
  font-family: "Font Awesome 5 Free";
  font-weight: 400;
  font-size: 24px;
  color: var(--tp-gray-400);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-container {
  position: relative;
}

.product-item-details {
  flex-grow: 1;
}

.product-item-details p {
  margin: 0;
}

.product-name {
  font-weight: 600;
  color: var(--tp-gray-700);
  line-height: 1.4;
  font-size: 14px;
}
@media (max-width: 468px) {
  .product-name {
    font-size: 12px;
  }
}

.product-quantity {
  all: unset;
  font-size: 0.875rem; /* text-sm */
  color: var(--tp-gray-500);
  margin-top: 0.25rem;
  text-align: left;
}

.product-price {
  font-weight: 600; /* font-semibold */
  color: var(--tp-gray-900);
  white-space: nowrap;
}

/* --- M� gi�m gi� --- */
.discount-section {
  display: flex;
  gap: 0.5rem;
}

.discount-input {
  flex-grow: 1;
  border: 1px solid var(--tp-gray-200);
  border-radius: 5px;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}
.discount-button {
  border: 1px solid var(--tp-gray-200);
  background-color: var(--tp-primary);
  color: white;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 5px;
  text-transform: capitalize;
  cursor: pointer;
  min-width: 150px;
  transition: background-color 0.2s ease;
}

.discount-button:hover {
  background-color: var(--primary-dark);
}

/* Coupon message styling */
.coupon-message {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--tp-radius);
  font-size: 0.875rem;
}

.coupon-message.woocommerce-message {
  background-color: #d1f2eb;
  color: #0c5733;
  border-left: 4px solid #28a745;
}

.coupon-message.woocommerce-error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

/* =================================
   COUPON STYLES MOVED TO DEDICATED FILE
   ================================= */
/* Coupon section styles moved to: /assets/css/coupon-slider.css */

.order-summary > *:not(:first-child) {
  margin-top: 0.75rem; /* space-y-3 */
}

.summary-row {
  display: flex;
  justify-content: space-between;
  color: var(--tp-gray-600);
}

.summary-row .value {
  font-weight: 500;
  color: var(--tp-gray-900);
}

.summary-row .value.free-shipping {
  font-weight: 500;
}

.summary-row.total {
  font-size: 18px; /* text-lg */
  font-weight: 600; /* font-bold */
  color: var(--tp-gray-900);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--tp-gray-200);
}

.payment-methods-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--tp-gray-900);
  margin: 0;
  margin-bottom: 1rem;
}

/* WooCommerce default payment method styling */

.wc_payment_methods {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wc_payment_method {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem !important;
  border: 1px solid var(--tp-gray-200);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
  position: relative;
}

.wc_payment_method:hover {
  border-color: var(--tp-primary);
  background: var(--tp-gray-50);
}

.wc_payment_method:has(input:checked) {
  border-color: var(--tp-primary);
  background: rgba(239, 68, 68, 0.05);
  box-shadow: 0 0 0 1px var(--tp-primary);
}

.wc_payment_methods input {
  margin: 0;
  margin-top: 2px;
  accent-color: var(--tp-primary);
  display: inline !important;
  font-size: 16px !important;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.wc_payment_method label {
  margin-bottom: 0px;
  font-weight: 600;
  color: var(--tp-gray-800);
  font-size: 0.875rem;
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-grow: 1;
  line-height: 1.4;
}

.wc_payment_method label img {
  max-width: 35px !important;
  max-height: 25px !important;
  object-fit: contain;
  margin-left: auto;
}

/* Hide payment box descriptions completely */
.wc_payment_method .payment_box,
.payment_box {
  display: none !important;
}

/* Custom payment option styling */
.payment-option-input {
  display: none;
}

.payment-option-label {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--tp-gray-200);
  border-radius: var(--tp-radius);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.payment-option-input:checked + .payment-option-label {
  border-color: var(--tp-secondary);
  background-color: var(--tp-gray-50);
}

.payment-option-label .title {
  font-weight: 500;
  color: var(--tp-gray-700);
}

/* --- N�t �t h�ng --- */
.place-order-section {
  margin-top: 1.5rem;
}

.place-order-button {
  width: 100%;
  background-color: var(--tp-secondary);
  color: var(--white);
  font-weight: 600; /* font-semibold */
  padding: 0.875rem 1rem; /* py-3.5 */
  border: none;
  border-radius: var(--tp-radius);
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  display: block;
}

.place-order-button:hover {
  background-color: var(--secondary-dark);
}

/* Hide default WooCommerce place order button */
.checkout-sidebar
  .button.alt[name="woocommerce_checkout_place_order"]:not(
    .place-order-button
  ) {
  display: none !important;
}

/* =================================
   FORM STYLING
   ================================= */
.tp-enhanced-checkout .form-row {
  margin-bottom: 1.5rem;
}

.tp-enhanced-checkout .form-row label {
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
}

.tp-enhanced-checkout .form-row input[type="text"],
.tp-enhanced-checkout .form-row input[type="email"],
.tp-enhanced-checkout .form-row input[type="tel"],
.tp-enhanced-checkout .form-row input[type="password"],
.tp-enhanced-checkout .form-row select,
.tp-enhanced-checkout .form-row textarea {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background-color: white;
}

.tp-enhanced-checkout .form-row input:focus,
.tp-enhanced-checkout .form-row select:focus,
.tp-enhanced-checkout .form-row textarea:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.tp-enhanced-checkout .form-row .required {
  color: #ef4444;
}

/* =================================
   BUTTONS
   ================================= */
.tp-enhanced-checkout #place_order {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tp-enhanced-checkout #place_order:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15);
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */
@media (max-width: 768px) {
  .tp-checkout-progress {
    padding: 1.5rem 1rem;
  }

  .tp-progress-steps {
    padding: 0 1rem;
  }

  .tp-step-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .tp-step-label {
    font-size: 0.75rem;
  }

  .tp-section-header {
    padding: 1rem 1rem;
  }

  .tp-section-content {
    padding: 1.5rem;
  }

  /* Tablet coupon styles moved to: /assets/css/coupon-slider.css */
}

@media (max-width: 480px) {
  .tp-progress-steps {
    padding: 0 0.5rem;
  }

  .tp-step-circle {
    width: 35px;
    height: 35px;
    font-size: 0.875rem;
  }

  .tp-section-header {
    padding: 0.75rem 1rem;
  }

  .tp-section-content {
    padding: 1rem;
  }
}

/* =================================
   ANIMATIONS
   ================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-checkout-section {
  animation: fadeInUp 0.5s ease-out;
}

.checkout-sidebar {
  animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* =================================
   ACCESSIBILITY
   ================================= */
.tp-enhanced-checkout input:focus-visible,
.tp-enhanced-checkout select:focus-visible,
.tp-enhanced-checkout textarea:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tp-step-circle,
  .tp-enhanced-checkout #place_order,
  .tp-checkout-section {
    transition: none;
    animation: none;
  }

  .tp-progress-step.current .tp-step-circle,
  .tp-enhanced-checkout #place_order:hover {
    transform: none;
  }
}
