/**
Theme Name: Versatile FX
Author: Max Cereceda
Author URI: https://www.vexel-code.com
Description: \"Versatile FX: El tema hijo definitivo para llevar Astra al siguiente nivel. Diseñado para marcas que buscan una estética tecnológica y elegante, este paquete transforma el checkout estándar de WooCommerce en una experiencia fluida, oscura y premium. Incluye lógica avanzada en PHP para la gestión de cupones y edición de carrito en tiempo real, todo manteniendo la velocidad y ligereza características de Astra.\"
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: versatile-fx
Template: astra
*/

/* START EDITING FROM HERE */

/* ======================================================
   1. CONTAINERS (BLUISH BLACK CARD STYLE)
   ====================================================== */
/* Card background and rounded borders */
/* Standard containers (Billing) */
.woocommerce-checkout #customer_details {
  background-color: #0f1115 !important;
  border: 1px solid #333333 !important;
  border-radius: 16px !important;
  padding: 40px !important;
  margin-bottom: 40px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* 3-CARD LAYOUT FOR RIGHT COLUMN (Order, Coupon, Payment) */

/* 1. RESET MAIN CONTAINER */
.woocommerce-checkout #order_review,
.woocommerce-checkout .woocommerce-checkout-review-order {
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
}

/* 2. CARD 1: YOUR ORDER (Heading + Table) */
h3#order_review_heading {
  background-color: #0f1115 !important;
  border: 1px solid #333333 !important;
  border-bottom: none !important;
  border-radius: 16px 16px 0 0 !important;
  padding: 40px 40px 25px 40px !important;
  margin: 0 !important;
  position: relative !important;
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 600 !important;
}

h3#order_review_heading::after {
  content: "" !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 40px !important;
  right: 40px !important;
  height: 1px !important;
  background-color: #333333 !important;
}

.vfx-order-table-card {
  background-color: #0f1115 !important;
  border: 1px solid #333333 !important;
  border-top: none !important;
  border-radius: 0 0 16px 16px !important;
  padding: 10px 40px 40px 40px !important;
  margin-bottom: 25px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* 3. CARD 2: COUPON SECTION */
.vfx-coupon-card {
  background-color: #0f1115 !important;
  border: 1px solid #333333 !important;
  border-radius: 16px !important;
  padding: 10px 40px !important;
  margin-bottom: 25px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Global hide for default coupon toggle to prevent Sonner flicker */
.woocommerce-form-coupon-toggle {
  display: none !important;
}

/* Show ONLY the one we manually placed in our card */
.vfx-coupon-card .vfx-stable-toggle {
  display: block !important;
}

/* Hide any info notice in the toast wrapper (coupon reminders) */
.woocommerce-notices-wrapper .woocommerce-info {
  display: none !important;
}

.woocommerce-checkout .woocommerce-form-coupon-toggle {
  background-color: transparent !important;
  border: none !important;
  padding: 20px 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  text-align: left !important;
}

.woocommerce-checkout .woocommerce-info .vfx-promo-text {
  color: #cccccc !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.woocommerce-checkout .showcoupon {
  color: #007bff !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  margin-left: 5px !important;
  cursor: pointer !important;
}

.woocommerce-checkout form.checkout_coupon,
.woocommerce-checkout form.woocommerce-form-coupon,
.woocommerce-checkout .woocommerce-form-coupon-toggle + p,
.woocommerce-checkout .woocommerce-form-coupon-toggle + p + p {
  display: none !important; /* Force initial hidden state */
  background-color: transparent !important;
  border: none !important;
  padding: 15px 0 20px 0 !important;
  margin: 0 !important;
}

/* Ensure the div clear or any other fields are also hidden */
.woocommerce-checkout .woocommerce-form-coupon-toggle + p + p + .clear {
  display: none !important;
}

/* Reduce coupon button size to not compete with the main one */
.woocommerce-checkout .woocommerce-form-coupon button[name="apply_coupon"] {
  height: 48px !important;
  font-size: 14px !important;
  padding: 0 25px !important;
  border-radius: 8px !important;
  float: right !important;
}

/* Style for applied coupon in the summary table */
.cart-discount th {
  text-transform: uppercase !important;
  font-size: 12px !important;
  letter-spacing: 1px !important;
}

.cart-discount td .amount {
  color: #2ecc71 !important; /* Vibrant Green */
  font-weight: bold !important;
}

.woocommerce-remove-coupon {
  color: #ff4d4d !important;
  text-transform: none !important;
  font-size: 11px !important;
  margin-left: 10px !important;
  text-decoration: none !important;
}

.woocommerce-remove-coupon:hover {
  text-decoration: underline !important;
}

/* PREMIUM FLOATING TOASTS (SONNER STYLE) */
.woocommerce-notices-wrapper {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 999999 !important;
  width: auto !important;
  max-width: 400px !important;
  pointer-events: none !important;
}

.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error {
  pointer-events: auto !important;
  background-color: #1a1f35 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 16px 45px 16px 20px !important; /* Space for X */
  margin-bottom: 12px !important;
  border-radius: 12px !important;
  line-height: 1.4 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: fit-content !important;
  min-width: 300px !important;
  animation: vfx-toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  text-align: left !important;
  border-left: 4px solid #007bff !important;
  cursor: pointer !important;
  position: relative !important;
}

/* Close icon (X) */
.woocommerce-notices-wrapper .woocommerce-info::after,
.woocommerce-notices-wrapper .woocommerce-message::after,
.woocommerce-notices-wrapper .woocommerce-error::after {
  content: "×" !important;
  position: absolute !important;
  right: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 22px !important;
  color: rgba(255, 255, 255, 0.4) !important;
  line-height: 1 !important;
  transition: color 0.2s ease !important;
}

.woocommerce-info:hover::after,
.woocommerce-message:hover::after,
.woocommerce-error:hover::after {
  color: #ffffff !important;
}

/* Exit animation class */
.vfx-toast-out {
  animation: vfx-toast-out 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Specific colors for types */
.woocommerce-notices-wrapper .woocommerce-message {
  border-left-color: #2ecc71 !important;
}
.woocommerce-notices-wrapper .woocommerce-error {
  border-left-color: #ff4d4d !important;
}

@keyframes vfx-toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes vfx-toast-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Hide icons and buttons */
.woocommerce-info::before,
.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-message .button.wc-forward {
  display: none !important;
}

/* Keep the empty cart message inline and centered - Minimalist */
.wc-empty-cart-message {
  width: 100% !important;
  text-align: center !important;
  display: block !important;
  clear: both !important;
}

.wc-empty-cart-message .woocommerce-info {
  position: relative !important;
  margin: 80px auto 20px auto !important;
  width: 100% !important;
  max-width: 100% !important;
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 28px !important;
  font-weight: 500 !important;
  text-align: center !important;
  box-shadow: none !important;
  display: block !important;
}

.wc-empty-cart-message .woocommerce-info::after {
  display: none !important;
}

/* Center Return to shop button - Minimalist */
.return-to-shop {
  text-align: center !important;
  margin: 0 auto 60px auto !important;
  width: 100% !important;
  display: block !important;
}

.return-to-shop .button {
  background-color: #007bff !important;
  color: #ffffff !important;
  border-radius: 50px !important;
  padding: 14px 32px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  display: inline-block !important;
  float: none !important;
  text-transform: none !important;
  /* Remove any effects */
  box-shadow: none !important;
  transition: none !important;
  border: none !important;
}

.return-to-shop .button:hover,
.return-to-shop .button:focus,
.return-to-shop .button:active {
  background-color: #007bff !important; /* No change on hover */
  color: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Style for "Undo?" links in toasts */
.woocommerce-message .restore-item {
  color: #2ecc71 !important;
  font-weight: bold !important;
  text-decoration: underline !important;
  margin-left: 10px !important;
}

/* Section titles with internal dividing line */
.woocommerce-checkout h3 {
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid #333333 !important;
  padding-bottom: 25px !important;
  margin-bottom: 35px !important;
  background: transparent !important;
  letter-spacing: 0.5px;
}

/* ======================================================
   2. INPUTS AND SELECTS (MINIMAL STYLE - ONLY BOTTOM LINE)
   ====================================================== */
/* Apply to all input fields */
.woocommerce-checkout .input-text,
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout textarea,
.woocommerce-checkout select,
.select2-container--default .select2-selection--single {
  background-color: transparent !important; /* Transparent */
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid #333333 !important; /* Bottom line only */
  border-radius: 0 !important;
  padding: 12px 0 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  width: 100%;
  transition: border-color 0.3s ease;
}

/* Fix for Browser Autofill (Light blue/white background) */
.woocommerce-checkout input:-webkit-autofill,
.woocommerce-checkout input:-webkit-autofill:hover,
.woocommerce-checkout input:-webkit-autofill:focus,
.woocommerce-checkout input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #0f1115 inset !important;
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Specific style for Select2 dropdown (State/Province) */
.select2-container--default .select2-selection--single {
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #ffffff !important;
  padding-left: 0 !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  right: 0 !important;
}

/* Focus Effect (When user clicks) */
.woocommerce-checkout .input-text:focus,
.woocommerce-checkout input:focus,
.select2-container--default.select2-container--focus
  .select2-selection--single {
  border-bottom-color: #007bff !important; /* Your primary blue */
  outline: none !important;
}

/* ======================================================
   3. STYLES FOR SELECT2 DROPDOWN (DARK MODE)
   ====================================================== */
/* Dropdown container */
.select2-dropdown {
  background-color: #0f1115 !important;
  border: 1px solid #333333 !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  z-index: 9999 !important;
}

/* Search field inside dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: #1a1d23 !important;
  border: 1px solid #333333 !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  padding: 8px !important;
}

/* List options */
.select2-results__option {
  background-color: transparent !important;
  color: #ffffff !important;
  padding: 10px 15px !important;
}

/* Highlighted option (Hover) */
.select2-container--default
  .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: #007bff !important;
  color: #ffffff !important;
}

/* FIX FOR COUNTRY AND STATE SELECTORS VISIBILITY */
#billing_country_field,
#shipping_country_field,
#billing_state_field,
#shipping_state_field {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.select2-container .select2-selection--single {
  background-color: transparent !important;
  border: none !important;
  border-bottom: 1px solid #333333 !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #ffffff !important;
  padding-left: 0 !important;
}

.select2-dropdown {
  background-color: #1a1d23 !important; /* Slightly lighter for contrast */
  border: 1px solid #333333 !important;
  z-index: 99999 !important;
}

/* "No results found" message */
.select2-results__message {
  color: #666666 !important;
}

/* FEATURE: Dark scrollbar for the dropdown */
.select2-results__options::-webkit-scrollbar {
  width: 8px !important;
}

.select2-results__options::-webkit-scrollbar-track {
  background: #0f1115 !important;
  border-radius: 0 8px 8px 0 !important;
}

.select2-results__options::-webkit-scrollbar-thumb {
  background: #333333 !important;
  border-radius: 10px !important;
  border: 2px solid #0f1115 !important; /* Space around for a thinner look */
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
  background: #444444 !important;
}

/* Placeholder text color */
.woocommerce-checkout ::placeholder {
  color: #666666 !important;
  font-size: 14px;
}

/* Labels */
.woocommerce-checkout label {
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  margin-bottom: 12px !important; /* Increased margin for more space */
  display: block;
}

/* ======================================================
   3. ORDER SUMMARY TABLE
   ====================================================== */
.woocommerce-checkout-review-order-table {
  border: none !important;
}

.woocommerce-checkout-review-order-table,
.woocommerce-checkout-review-order-table tr,
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
  border: none !important; /* Removed all lines */
  padding: 15px 0 !important;
  color: #ffffff !important;
  background: transparent !important;
}

/* Remove white background and extra borders from table */
.shop_table.woocommerce-checkout-review-order-table,
.shop_table.woocommerce-checkout-review-order-table thead,
.shop_table.woocommerce-checkout-review-order-table tbody,
.shop_table.woocommerce-checkout-review-order-table tfoot {
  background-color: transparent !important;
}

/* Remove double border Astra sometimes adds */
.woocommerce-checkout-review-order-table {
  border-collapse: collapse !important;
}

/* 4. CARD 3: PAYMENT SECTION */
.vfx-payment-card {
  background-color: #0f1115 !important;
  border: 1px solid #333333 !important;
  border-radius: 16px !important;
  padding: 40px !important;
  margin-bottom: 40px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.vfx-payment-card #payment {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* Payment method box */
.woocommerce-checkout #payment div.payment_box {
  background-color: #161b22 !important;
  border: 1px solid #2d333b !important;
  border-radius: 12px !important;
  color: #cccccc !important;
  margin-top: 15px !important;
}

/* Hide the triangle/arrow on top of payment box */
.woocommerce-checkout #payment div.payment_box::before {
  display: none !important;
}

/* Place Order Button (App default style) */
#place_order {
  width: 100% !important;
  margin-top: 25px !important;
}

/* ======================================================
   5. EXTRA FIXES (CHECKBOX AND NOTES)
   ====================================================== */
/* Newsletter checkbox text color */
.hostinger-reach-optin label,
.woocommerce-form__label-for-checkbox span {
  color: #ffffff !important;
}

/* Style for success messages (Top Notices) */
.woocommerce-message {
  background-color: #0f1115 !important;
  border: 1px solid #333333 !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  padding: 20px 30px !important;
  margin-bottom: 40px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* "View Cart" button (Default style) */
.woocommerce-message .button {
  margin-left: auto !important;
}

/* Coupon info message must be transparent to not break its card */
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-notice {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}

/* Hide default WooCommerce icon in notices */
.woocommerce-message::before,
.woocommerce-info::before {
  display: none !important;
}

/* Fix for coupon link (ensure visibility and spacing) */
.woocommerce-info a {
  color: #007bff !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  margin-left: 0 !important; /* Remove margin if text already has space */
}

.woocommerce-info a:hover {
  text-decoration: underline !important;
}

/* ======================================================
   FIX FOR ERROR MESSAGES (DARK MODE)
   ===================================================== */

/* HIDE TOP ERROR BLOCK (Shown inline instead) */
.woocommerce-NoticeGroup-checkout,
.woocommerce-error {
  display: none !important;
}

/* STYLE FOR INPUTS WITH ERROR */
.woocommerce-invalid .input-text,
.woocommerce-invalid select,
.woocommerce-invalid .select2-selection {
  border-bottom-color: #ff4d4d !important; /* Red line */
  transition: border-color 0.3s ease;
}

/* ERROR MESSAGE DIRECTLY UNDER THE INPUT */
.checkout-inline-error-message {
  font-size: 0 !important; /* Hides original text with "Billing..." */
  margin-top: 8px !important;
  margin-bottom: 5px !important;
  display: block;
}

.checkout-inline-error-message::before {
  content: "This field is required"; /* New clean message */
  color: #ff4d4d !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  visibility: visible;
  display: block;
}

/* Ensure field container has space for the error */
.woocommerce-checkout .form-row.woocommerce-invalid {
  margin-bottom: 15px !important;
}

/* Remove old error styles */
.woocommerce-error li,
.woocommerce-error li a {
  display: none;
}

.woocommerce-error li a:hover {
  text-decoration: underline !important;
}

/* Error Icon or Bullet */
.woocommerce-error::before {
  color: #ff4d4d !important;
}

/* Correct color of bold texts inside error */
.woocommerce-error strong {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Remove product button in Checkout - Aggressive Reset */
.woocommerce-checkout a.remove.product-remove-checkout {
  display: inline-block !important;
  color: #ff0000 !important;
  font-size: 24px !important;
  font-weight: bold !important;
  text-decoration: none !important;
  border: none !important;
  border-width: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin-right: 12px !important;
  vertical-align: middle !important;
  transition: color 0.2s ease !important;
}

/* Hide any pseudo-elements that might create the circle/icon */
.woocommerce-checkout a.remove.product-remove-checkout::before,
.woocommerce-checkout a.remove.product-remove-checkout::after {
  content: none !important;
  display: none !important;
  border: none !important;
}

.woocommerce-checkout a.remove.product-remove-checkout:hover {
  color: #ff4d4d !important;
  background: transparent !important;
  border: none !important;
  text-decoration: none !important;
}

/* PREMIUM LOADING STATES */
.blockUI.blockOverlay {
  background: rgba(18, 22, 38, 0.1) !important;
  opacity: 1 !important;
  z-index: 99999 !important;
}

/* Hide Astra and WooCommerce default "white dots" or spinners */
.blockUI.blockOverlay::before,
.blockUI.blockOverlay::after,
.woocommerce .blockUI.blockOverlay::before,
#order_review.processing::before,
#order_review.processing::after,
.checkout.processing::before,
.checkout.processing::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

.blockUI.blockMsg {
  border: none !important;
  background: transparent !important;
  width: 60px !important;
  height: 60px !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  position: fixed !important;
  color: transparent !important;
  text-indent: -10000px !important;
  background-image: none !important;
  z-index: 100000 !important;
}

/* Aggressively hide any children of the loading message */
.blockUI.blockMsg * {
  display: none !important;
  opacity: 0 !important;
}

/* Custom premium spinner - The ONLY thing visible */
.blockUI.blockMsg::before {
  content: "" !important;
  display: block !important;
  width: 50px !important;
  height: 50px !important;
  border: 3px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 3px solid #007bff !important; /* Blue accent */
  border-radius: 50% !important;
  animation: vfx-spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite !important;
  box-shadow: 0 0 20px rgba(0, 123, 255, 0.4) !important;
  text-indent: 0 !important;
  visibility: visible !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

@keyframes vfx-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Button processing state */
button.button.processing::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: vfx-spin 0.6s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}
