/* ========================================
   Modern Floating Labels for WooCommerce
   v3.2.1 - Complete Module Coverage Fix
   ======================================== */

/* Universal Wrapper - FORCE position relative */
.woocommerce form .form-row,
.module-checkout-billing .form-row,
.module-checkout-shipping .form-row,
.module-checkout-information .form-row,
.fooevents-attendee .form-row {
    position: relative !important;
    margin-bottom: 18px !important;
    padding-top: 8px !important;
}

/* Section Headings */
.woocommerce form.checkout h3,
.module-checkout-billing h3,
.module-checkout-shipping h3 {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 20px 0 !important;
    padding: 0 0 12px 0 !important;
    border-bottom: 3px solid #f59e0b;
}

/* Input Base Styling */
.woocommerce form .form-row .input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea,
.woocommerce form .form-row input[type="text"],
.woocommerce form .form-row input[type="email"],
.woocommerce form .form-row input[type="tel"],
.woocommerce form .form-row input[type="number"],
.module-checkout-billing .form-row input,
.module-checkout-billing .form-row select,
.module-checkout-billing .form-row textarea,
.module-checkout-shipping .form-row input,
.module-checkout-shipping .form-row select,
.module-checkout-shipping .form-row textarea,
.module-checkout-information .form-row input,
.module-checkout-information .form-row select,
.module-checkout-information .form-row textarea,
.fooevents-attendee .form-row input,
.fooevents-attendee .form-row textarea {
    height: 52px !important;
    padding: 18px 14px 6px 14px !important;
    border: 2px solid #d1d5db;
    border-radius: 6px !important;
    background-color: #ffffff;
    font-size: 15px;
    color: #000000;
    box-shadow: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    width: 100% !important;
    outline: none !important;
    line-height: 1.5;
}

/* Textarea height */
.woocommerce form .form-row textarea,
.module-checkout-billing .form-row textarea,
.module-checkout-shipping .form-row textarea,
.module-checkout-information .form-row textarea,
.fooevents-attendee .form-row textarea {
    height: auto !important;
    min-height: 90px !important;
    padding-top: 22px !important;
    resize: vertical !important;
}

/* Select2 dropdown styling */
.woocommerce form .form-row .select2-container .select2-selection {
    height: 52px !important;
    padding: 18px 14px 6px 14px !important;
    border: 2px solid #d1d5db;
    border-radius: 6px !important;
    background-color: #ffffff;
    font-size: 15px;
}

/* Focus state */
.woocommerce form .form-row.is-focused .input-text,
.woocommerce form .form-row.is-focused select,
.woocommerce form .form-row.is-focused textarea,
.woocommerce form .form-row.is-focused .select2-selection,
.module-checkout-billing .form-row.is-focused input,
.module-checkout-billing .form-row.is-focused select,
.module-checkout-billing .form-row.is-focused textarea,
.module-checkout-shipping .form-row.is-focused input,
.module-checkout-shipping .form-row.is-focused select,
.module-checkout-shipping .form-row.is-focused textarea,
.module-checkout-information .form-row.is-focused input,
.module-checkout-information .form-row.is-focused select,
.module-checkout-information .form-row.is-focused textarea,
.fooevents-attendee .form-row.is-focused input,
.fooevents-attendee .form-row.is-focused textarea {
    border-color: #dc2626;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Label Base Styling - High Specificity */
.woocommerce form .form-row label,
.module-checkout-billing .form-row label,
.module-checkout-shipping .form-row label,
.module-checkout-information .form-row label,
.fooevents-attendee .form-row label {
    position: absolute !important;
    top: 26px !important; /* Matches calc(8px + 18px) */
    left: 14px !important;
    font-size: 15px;
    font-weight: 400;
    color: #9ca3af;
    background: transparent !important;
    padding: 0 4px !important;
    margin: 0 !important;
    pointer-events: none !important;
    z-index: 5 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: left center !important;
    line-height: 1;
    display: block !important;
    width: auto !important;
    max-width: calc(100% - 28px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Label Float Animation - The Critical Part */
/* Removed :where() to force these rules to win over theme defaults */
.woocommerce form .form-row.is-focused label,
.woocommerce form .form-row.has-value label,
.module-checkout-billing .form-row.is-focused label,
.module-checkout-billing .form-row.has-value label,
.module-checkout-shipping .form-row.is-focused label,
.module-checkout-shipping .form-row.has-value label,
.module-checkout-information .form-row.is-focused label,
.module-checkout-information .form-row.has-value label,
.fooevents-attendee .form-row.is-focused label,
.fooevents-attendee .form-row.has-value label {
    top: 0 !important;
    left: 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #dc2626;
    background: #ffffff !important;
    padding: 0 6px !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    transform: translateY(0) !important;
}

/* Grey label when valid but not focused */
.woocommerce form .form-row.has-value:not(.is-focused) label,
.module-checkout-billing .form-row.has-value:not(.is-focused) label,
.module-checkout-shipping .form-row.has-value:not(.is-focused) label,
.module-checkout-information .form-row.has-value:not(.is-focused) label,
.fooevents-attendee .form-row.has-value:not(.is-focused) label {
    color: #6b7280;
}

/* Required asterisk styling */
.woocommerce form .form-row label .required {
    color: #ef4444;
    text-decoration: none !important;
    font-weight: 700 !important;
    margin-left: 2px !important;
}

/* Hide native placeholders */
.woocommerce form .form-row input::placeholder,
.woocommerce form .form-row textarea::placeholder {
    opacity: 0 !important;
    color: transparent !important;
}

/* Hide Select2 placeholders/rendered selection when empty/initial */
.woocommerce form .form-row:not(.has-value):not(.is-focused) .select2-selection__rendered {
    opacity: 0 !important;
}

/* Select2 Specific Styling */
.woocommerce form .form-row .select2-container .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.5;
    color: #000000;
}

.woocommerce form .form-row .select2-container .select2-selection__arrow {
    height: 52px !important;
    top: 0 !important;
    right: 10px !important;
}

/* Checkbox and Radio Button Forms - Prevent floating label behavior */
.woocommerce form .form-row.woocommerce-form-row--wide.create-account,
.woocommerce-terms-and-conditions-wrapper,
.woocommerce form .form-row.form-row-wide.create-account {
    padding-top: 0 !important;
}

.woocommerce form .form-row label.checkbox,
.woocommerce form .form-row label.woocommerce-form__label,
.woocommerce form .form-row.create-account label {
    position: static !important;
    padding-left: 0 !important;
    font-size: 14px;
    color: #000000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    font-weight: 400;
    text-transform: none !important;
    letter-spacing: normal !important;
    top: auto !important;
    left: auto !important;
    background: transparent !important;
    margin-left: 5px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .woocommerce form .form-row label {
        font-size: 14px;
    }
    
    .woocommerce form .form-row.is-focused label,
    .woocommerce form .form-row.has-value label {
        font-size: 10px !important;
    }
}
