/**
 * ClubFitness Checkout Styling
 * 
 * These styles enhance the WooCommerce block-based checkout
 * while maintaining the existing layout structure and floating labels.
 *
 * The selectors target the exact HTML structure from the checkout page.
 */

/* Overall checkout container - maintain width but add spacing */
.wp-block-woocommerce-checkout.alignwide {
    margin-bottom: 40px;
    /* Using standard container width from main.css */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Maintain two-column layout but with proper spacing */
.wc-block-components-sidebar-layout.wc-block-checkout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* Left side - form fields */
.wc-block-components-main.wc-block-checkout__main {
    flex: 3;
    min-width: 0;
}

/* Right side - order summary */
.wc-block-components-sidebar.wc-block-checkout__sidebar {
    flex: 1;
    min-width: 300px;
    /* Add styling to make it stand out */
    background: #f8f8f8;
    border-radius: 8px;
    padding: 20px;
    align-self: flex-start;
}

/* Form field styling with proper selectors - preserving floating label functionality */
.wc-block-components-text-input input {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    transition: all 0.3s ease;
    width: 100%;
}

/* Enhanced focus states while preserving floating behavior */
.wc-block-components-text-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(255, 87, 34, 0.2);
    outline: none;
}

/* Dropdown styling using exact selector from HTML */
.wc-blocks-components-select__select {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    height: auto; /* Override default height */
    transition: all 0.3s ease;
    width: 100%;
    background-color: white;
}

/* Label styling that preserves floating behavior */
.wc-block-components-text-input label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
}

/* Country/state dropdown labels */
.wc-blocks-components-select__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

/* Each checkout step with proper spacing */
fieldset.wc-block-components-checkout-step {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    /* Remove default fieldset styling */
    border: none;
    padding: 0 0 24px 0;
}

/* Step titles with consistent styling */
.wc-block-components-title.wc-block-components-checkout-step__title {
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--secondary-color);
    font-size: 18px;
}

/* Step content container */
.wc-block-components-checkout-step__container {
    margin-top: 12px;
}

/* Step content */
.wc-block-components-checkout-step__content {
    margin-top: 16px;
}

/* Order summary styling */
.wc-block-components-order-summary {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 16px;
}

.wc-block-components-order-summary-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.wc-block-components-order-summary-item:last-child {
    border-bottom: none;
}

/* Make sure validation errors are clearly visible */
.wc-block-components-validation-error {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Style the place order button to match site's other buttons */
button.wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    width: auto !important; /* Prevent button from stretching */
}

button.wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button:hover {
    background-color: var(--secondary-color) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Style the button text */
.wc-block-components-checkout-place-order-button__text {
    font-weight: 600 !important;
}

/* Return to cart link styling */
.wc-block-components-checkout-return-to-cart-button {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.wc-block-components-checkout-return-to-cart-button:hover {
    color: var(--secondary-color);
}

/* Checkout actions row */
.wc-block-checkout__actions_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* Error notice styling */
.wc-block-components-notice-banner.is-error {
    background-color: #ffeaea;
    border-left: 4px solid var(--primary-color);
    color: #d32f2f;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Total amount emphasis */
.wc-block-components-totals-footer-item {
    font-weight: 700;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wc-block-components-sidebar-layout {
        flex-direction: column;
    }
    
    .wc-block-components-main {
        padding-right: 0;
        margin-bottom: 30px;
    }
}
