/**
Theme Name: Funded Markets
Author: Max Cereceda
Author URI: https://www.vexel-code.com
Description: "Funded Markets: 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: funded-markets
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;
}

/* Merger of Title and Content of "Your order" */
/* Merger of Title and Content of "Your order" to match Billing exactly */
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; /* Required for the indented line */
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 600 !important;
}

/* The indented line (not edge-to-edge) */
h3#order_review_heading::after {
  content: "" !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 40px !important; /* Matches card padding */
  right: 40px !important; /* Matches card padding */
  height: 1px !important;
  background-color: #333333 !important;
}

.woocommerce-checkout #order_review,
.woocommerce-checkout .woocommerce-checkout-review-order {
  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; /* Reduced top padding as the h3 has the main gap */
  margin-bottom: 40px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* New Integrated Coupon Design */
.woocommerce-checkout .woocommerce-form-coupon-toggle {
  background-color: transparent !important;
  border: none !important;
  padding: 25px 0 10px 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;
}

/* Remove internal message margins that could cause gaps */
.woocommerce-checkout .woocommerce-info {
  margin-top: 0 !important;
  margin-bottom: 0 !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;
}

.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. PAYMENT SECTION (CRYPTOCLOUD) AND BUTTON
   ====================================================== */
/* 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;
}
