/**
 * Irmanha Checkout Pay Module CSS
 */

/* General Container */
.irmanha-checkout-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0;
    font-family: inherit;
    color: #010101;
}

/* =============================================
   ERROR MESSAGES CONTAINER
   ============================================= */

.irmanha-checkout-errors {
    max-width: 1300px;
    margin: 0 auto var(--irmanha-space-6) auto;
}

.irmanha-checkout-errors .woocommerce-error,
.irmanha-checkout-errors .woocommerce-message,
.irmanha-checkout-errors .woocommerce-info {
    margin: 0 0 var(--irmanha-space-4) 0;
    background-color: #fff5f5;
    border-left: 4px solid #e74c3c;
    list-style: none;
    font-size: var(--irmanha-body);
    color: var(--irmanha-black);
}

.irmanha-checkout-errors .woocommerce-message {
    background-color: #f0f9ff;
    border-left-color: #3b82f6;
}

.irmanha-checkout-errors .woocommerce-info {
    background-color: #fef3c7;
    border-left-color: #f59e0b;
}

.irmanha-checkout-errors .woocommerce-error li,
.irmanha-checkout-errors .woocommerce-message li,
.irmanha-checkout-errors .woocommerce-info li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Hide errors inside the form */
form.checkout .woocommerce-error,
form.checkout .woocommerce-message,
form.checkout .woocommerce-info {
    display: none !important;
}

/* =============================================
   PROGRESS BAR
   ============================================= */

.irmanha-checkout-progress {
    max-width: 500px;
    margin: 0 auto var(--irmanha-space-12) auto;
}

.irmanha-checkout-progress__container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--irmanha-space-16);
}

.irmanha-checkout-progress__step {
    display: flex;
    align-items: center;
    gap: var(--irmanha-space-2);
}

.irmanha-checkout-progress__number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--irmanha-body);
    font-weight: var(--irmanha-font-weight-medium);
    background-color: #e1d5cc;
    border: 1px solid #e1d5cc;
    color: var(--irmanha-black);
    transition: var(--irmanha-transition-fast);
}

.irmanha-checkout-progress__step--active .irmanha-checkout-progress__number {
    background-color: var(--irmanha-beige);
    border-color: var(--irmanha-beige);
    color: var(--irmanha-black);
}

.irmanha-checkout-progress__step--complete .irmanha-checkout-progress__number {
    background-color: #e1d5cc;
    border-color: #e1d5cc;
    color: var(--irmanha-black);
}

.irmanha-checkout-progress__label {
    font-size: var(--irmanha-body);
    color: var(--irmanha-black);
    font-weight: var(--irmanha-font-weight-normal);
}

.irmanha-checkout-progress__step--active .irmanha-checkout-progress__label {
    color: var(--irmanha-black);
}

/* Layout Grid */
.checkout.woocommerce-checkout {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.irmanha-checkout-left {
    flex: 7;
    min-width: 300px;
}

.irmanha-checkout-summary {
    flex: 3;
    min-width: 300px;
}


.woocommerce-billing-fields__field-wrapper,
.woocommerce-additional-fields__field-wrapper,
.irmanha-checkout-fields__wrapper {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 20px; /* This guarantees even spacing */
}

/* Reset standard woo styling */
.woocommerce form .form-row {
    float: none;
    margin: 0;
    width: auto;
    padding: 0;
}

/* Grid Classes */
.irm-span-10, 
.form-row-wide, 
.notes { grid-column: span 10; } /* Full Width */

.irm-span-5 { grid-column: span 5; } /* 50% */
.irm-span-7 { grid-column: span 7; } /* 70% */
.irm-span-3 { grid-column: span 3; } /* 30% */

/* =============================================
   INPUT STYLING
   ============================================= */
.woocommerce form .form-row label {
    font-size: var(--irmanha-body-sm);
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
    text-transform: none;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row input[type="text"],
.woocommerce form .form-row input[type="email"],
.woocommerce form .form-row input[type="tel"],
.irmanha-checkout-fields__wrapper input[type="text"],
.irmanha-checkout-fields__wrapper input[type="email"],
.irmanha-checkout-fields__wrapper input[type="tel"],
.irmanha-checkout-fields__wrapper input.input-text,
.woocommerce form .form-row textarea {
    background: #ffffff;
    border: none;
    padding: 12px 15px;
    height: 34px;
    font-size: var(--irmanha-body);
    width: 100%;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    outline: none;
    box-sizing: border-box;
}

/* Order Notes Textarea */
.woocommerce-additional-fields {
    margin-top: 30px; /* Space between billing and notes */
}
.woocommerce-additional-fields h3 {
    font-family: 'Playfair Display', serif;
    font-size: var(--irmanha-h3);
    font-weight: 400;
    margin-bottom: 15px;
}
.woocommerce form .form-row textarea {
    height: 120px;
    resize: vertical;
}

/* =============================================
   RIGHT COLUMN: CARD & COUPON
   ============================================= */
#order_review {
    background: #ffffff;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

/* Remove default "Have a coupon?" text link style */
.woocommerce-form-coupon-toggle .woocommerce-info {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 0 15px 0;
    font-size: 0; /* Hide default text */
}

/* Style the link as a clean dropdown button */
.woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon {
    display: block;
    font-size: var(--irmanha-body);
    color: #111;
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
    text-decoration: none;
    position: relative;
    cursor: pointer;
    font-weight: 500;
}

/* Add an arrow */
.woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon:after {
    content: '▼';
    position: absolute;
    right: 0;
    font-size: var(--irmanha-body-sm);
}

/* The Coupon Form itself */
.checkout_coupon {
    padding: 15px;
    background: #f9f9f9;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

/* =============================================
   PAYMENT & PRIVACY
   ============================================= */
#payment {
    background: transparent;
    padding: 0;
}

.irmanha-payment-section__divider {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.3);
    margin: var(--irmanha-space-4) 0;
}

.irmanha-payment-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: var(--irmanha-body);
    font-weight: var(--irmanha-font-weight-semibold);
    margin-bottom: var(--irmanha-space-4);
    color: var(--irmanha-black);
}

.privacy-row {
    margin: 20px 0 !important;
}

.privacy-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--irmanha-body-sm);
    font-weight: 400 !important;
    text-transform: none;
    line-height: 1.4;
    cursor: pointer;
}

.privacy-row input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    margin: 0;
}

/* Place Order Button */
#place_order {
    background-color: #D3C1B0; /* Beige */
    color: #000;
    width: 100%;
    padding: 15px;
    font-weight: 600;
    text-transform: uppercase;
    border: none;
    margin-top: 10px;
    cursor: pointer;
}
#place_order:hover {
    background-color: #111;
    color: #fff;
}

/* =============================================
   RESPONSIVE
   ============================================= */
/* =============================================
   BACK LINK
   ============================================= */

.irmanha-checkout-back {
    max-width: 1300px;
    margin: var(--irmanha-space-8) auto 0;
    padding: 0 var(--irmanha-space-4);
}

.irmanha-checkout-back__link {
    display: inline-flex;
    align-items: center;
    gap: var(--irmanha-space-2);
    color: var(--irmanha-black);
    text-decoration: none;
    font-size: var(--irmanha-body);
    transition: var(--irmanha-transition-fast);
}

.irmanha-checkout-back__link:hover {
    opacity: 0.7;
}

.irmanha-checkout-back__arrow {
    font-size: 1.2em; /* Relative to parent, keep as em */
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
    .irmanha-checkout-grid form.checkout {
        grid-template-columns: 1fr; /* Stack vertically */
    }
    
    /* On mobile, make everything full width */
    .irm-span-5, .irm-span-7, .irm-span-3 {
        grid-column: span 10; 
    }
}


/* Payment Methods - Inside order summary */
.irmanha-checkout-summary .wc_payment_methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.irmanha-checkout-summary .wc_payment_methods li {
    margin-bottom: var(--irmanha-space-3);
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: var(--irmanha-space-3);
    background: transparent;
}

.irmanha-checkout-summary .wc_payment_methods li:last-child {
    margin-bottom: 0;
}

.irmanha-checkout-summary .wc_payment_methods li label {
    cursor: pointer;
    font-weight: var(--irmanha-font-weight-normal);
    display: flex;
    align-items: center;
    gap: var(--irmanha-space-2);
    font-size: var(--irmanha-body);
    color: var(--irmanha-black);
}

.irmanha-checkout-summary .payment_box {
    margin-top: var(--irmanha-space-2);
    padding: var(--irmanha-space-2);
    background: var(--irmanha-grey);
    font-size: var(--irmanha-body-sm);
    color: var(--irmanha-black);
}

/* Order Summary Card - Match cart summary exactly */
.irmanha-checkout-summary .irmanha-cart-summary__card {
    background-color: #ffffff !important;
    background: #ffffff !important;
    background-image: none !important;
    padding: var(--irmanha-space-8);
    overflow: hidden;
}

.irmanha-checkout-summary .irmanha-cart-summary__title {
    font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
    font-size: var(--irmanha-h3);
    font-weight: var(--irmanha-font-weight-bold) !important;
    color: var(--irmanha-black);
    margin: 0 0 var(--irmanha-space-6) 0;
    text-align: center;
    line-height: var(--irmanha-leading-snug);
}

.irmanha-checkout-summary .irmanha-cart-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--irmanha-space-2) 0;
}

.irmanha-checkout-summary .irmanha-cart-summary__label {
    font-size: var(--irmanha-body);
    color: var(--irmanha-black);
    font-weight: var(--irmanha-font-weight-normal);
}

.irmanha-checkout-summary .irmanha-cart-summary__value {
    font-size: var(--irmanha-body);
    color: var(--irmanha-black);
    text-align: right;
    font-weight: var(--irmanha-font-weight-normal);
}

.irmanha-checkout-summary .irmanha-cart-summary__value--shipping {
    font-size: var(--irmanha-body);
    color: var(--irmanha-black);
}

.irmanha-checkout-summary .woocommerce-Price-amount bdi,
.irmanha-cart-summary .woocommerce-Price-amount bdi {
    font-size: 0.9em;
}

.irmanha-checkout-summary .irmanha-cart-summary__divider {
    width: 100%;
    height: 1px;
    background-color: #000000;
    opacity: 0.5;
    margin: var(--irmanha-space-4) 0;
}

.irmanha-checkout-summary .irmanha-cart-summary__row--total .irmanha-cart-summary__label,
.irmanha-checkout-summary .irmanha-cart-summary__row--total .irmanha-cart-summary__value {
    font-size: var(--irmanha-body);
    font-weight: var(--irmanha-font-weight-semibold);
}

/* Coupon Section - Match cart exactly */
.irmanha-checkout-summary .irmanha-cart-coupon {
    margin-top: var(--irmanha-space-4);
    border-top: 1px solid rgba(0, 0, 0, 0.3);
    padding-top: var(--irmanha-space-4);
}

.irmanha-checkout-summary .irmanha-cart-coupon__toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    padding: var(--irmanha-space-2) 0;
    font-size: var(--irmanha-body) !important;
    color: var(--irmanha-black);
    font-weight: var(--irmanha-font-weight-normal);
    cursor: pointer;
    text-align: left;
    outline: none;
    box-shadow: none;
}

.irmanha-checkout-summary .irmanha-cart-coupon__toggle span {
    font-size: inherit !important;
}

.irmanha-checkout-summary .irmanha-cart-coupon__toggle:hover,
.irmanha-checkout-summary .irmanha-cart-coupon__toggle:focus,
.irmanha-checkout-summary .irmanha-cart-coupon__toggle:active,
.irmanha-checkout-summary .irmanha-cart-coupon__toggle:focus-visible {
    background: transparent;
    color: var(--irmanha-black);
    outline: none !important;
    box-shadow: none !important;
    border: none;
}

.irmanha-checkout-summary .irmanha-cart-coupon__chevron {
    transition: transform var(--irmanha-transition-fast);
}

.irmanha-checkout-summary .irmanha-cart-coupon__toggle--open .irmanha-cart-coupon__chevron {
    transform: rotate(180deg);
}

.irmanha-checkout-summary .irmanha-cart-coupon__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.irmanha-checkout-summary .irmanha-cart-coupon__content[aria-hidden="false"] {
    max-height: 200px !important;
}

.irmanha-checkout-summary .irmanha-cart-coupon__field {
    display: flex;
    gap: var(--irmanha-space-2);
    padding-top: var(--irmanha-space-3);
    align-items: stretch;
}

.irmanha-checkout-summary .irmanha-cart-coupon__input {
    flex: 1;
    padding: var(--irmanha-space-3) var(--irmanha-space-4);
    border: 1px solid rgba(0, 0, 0, 0.2);
    font-size: var(--irmanha-body);
    background-color: var(--irmanha-white);
    color: var(--irmanha-black);
    min-height: calc(var(--irmanha-space-10) + var(--irmanha-space-1));
    outline: none;
    box-shadow: none;
    border-radius: 0;
    font-family: inherit;
    box-sizing: border-box;
}

.irmanha-checkout-summary .irmanha-cart-coupon__input::placeholder {
    color: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

.irmanha-checkout-summary .irmanha-cart-coupon__input:focus,
.irmanha-checkout-summary .irmanha-cart-coupon__input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: var(--irmanha-black);
}

.irmanha-checkout-summary .irmanha-cart-coupon__apply {
    padding: var(--irmanha-space-3) var(--irmanha-space-6);
    background-color: var(--irmanha-black);
    color: var(--irmanha-white);
    border: none;
    font-family: inherit;
    font-size: var(--irmanha-body) !important;
    font-weight: var(--irmanha-font-weight-medium);
    cursor: pointer;
    transition: var(--irmanha-transition-fast);
    outline: none;
    box-shadow: none;
    min-height: calc(var(--irmanha-space-10) + var(--irmanha-space-1));
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 0;
    text-transform: none;
}

.irmanha-checkout-summary .irmanha-cart-coupon__apply:hover,
.irmanha-checkout-summary .irmanha-cart-coupon__apply:focus,
.irmanha-checkout-summary .irmanha-cart-coupon__apply:focus-visible {
    background-color: var(--irmanha-black);
    opacity: 0.9;
    outline: none !important;
    box-shadow: none !important;
    color: var(--irmanha-white);
}

.irmanha-checkout-summary .irmanha-cart-coupon__apply:active {
    opacity: 0.8;
}

.irmanha-checkout-summary .irmanha-cart-coupon__applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--irmanha-space-2) 0;
    font-size: var(--irmanha-body-sm);
}

.irmanha-checkout-summary .irmanha-cart-coupon__code {
    background-color: var(--irmanha-grey);
    padding: var(--irmanha-space-1) var(--irmanha-space-2);
    border-radius: var(--irmanha-radius-sm);
    font-family: monospace;
    font-size: var(--irmanha-body-sm);
}

.irmanha-checkout-summary .irmanha-cart-coupon__remove-coupon {
    color: var(--irmanha-grey);
    text-decoration: underline;
    font-size: var(--irmanha-body-sm);
}

.irmanha-checkout-summary .irmanha-cart-coupon__remove-coupon:hover {
    color: var(--irmanha-black);
}


/* Buttons */
.irmanha-checkout-summary #place_order {
    width: 100%;
    padding: var(--irmanha-space-4);
    margin-top: var(--irmanha-space-6);
    background-color: var(--irmanha-beige);
    color: var(--irmanha-black);
    text-align: center;
    text-decoration: none;
    font-size: var(--irmanha-body);
    font-weight: var(--irmanha-font-weight-medium);
    border: none;
    cursor: pointer;
    transition: var(--irmanha-transition-fast);
    text-transform: none;
}

.irmanha-checkout-summary #place_order:hover {
    background-color: var(--irmanha-beige);
    opacity: 0.9;
    color: var(--irmanha-black);
}


/* Order Received Page */
.irmanha-order-received-content {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.irmanha-order-received-main {
    flex: 7;
    background: #fff;
    padding: 40px;
    border: 1px solid #E8E8E8;
}

.irmanha-order-received-sidebar {
    flex: 3;
    background: #fff;
    padding: 30px;
    border: 1px solid #E8E8E8;
    height: fit-content;
}

.order-confirmation-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #E8E8E8;
    padding-bottom: 30px;
}

.order-confirmation-header i {
    font-size: var(--irmanha-icon-lg);
    color: #D9C2B0;
    margin-bottom: 20px;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.order-info-item h3 {
    font-size: var(--irmanha-body-sm);
    margin-bottom: 5px;
    color: #666;
}

.order-info-item p {
    font-size: var(--irmanha-body);
    margin: 0;
}

.continue-shopping {
    display: inline-block;
    padding: 15px 30px;
    background: #D9C2B0;
    color: #010101;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
}

/* Hide Default WooCommerce Coupon & Notices */
.woocommerce-form-coupon-toggle,
.woocommerce-info,
.showcoupon {
    display: none !important;
}

/* User specifically asked to hide "Have a coupon?" which is .woocommerce-info */
body.woocommerce-checkout .woocommerce-info {
    display: none !important;
}

/* =============================================
   CUSTOM DROPDOWN STYLING (No Select2)
   ============================================= */

/* Hide the native select but keep it functional */
.woocommerce form .form-row select,
.woocommerce form .form-row .country_select,
.woocommerce form .form-row .state_select {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    margin: -1px !important;
    padding: 0 !important;
    visibility: hidden !important;
}

/* Custom dropdown wrapper */
.irmanha-custom-select {
    position: relative;
    width: 100%;
    display: block;
}

/* Ensure the wrapper replaces the select in layout */
.woocommerce form .form-row .irmanha-custom-select {
    width: 100%;
    display: block;
}

.irmanha-custom-select__trigger {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    padding: 0 40px 0 15px;
    height: 34px;
    width: 100%;
    font-size: var(--irmanha-body);
    font-family: inherit;
    color: #111;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    
    /* Custom Arrow (SVG encoded) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    transition: var(--irmanha-transition-fast);
}

.irmanha-custom-select__trigger:hover {
    background-color: #ffffff;
}

.irmanha-custom-select__trigger--open {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='18 15 12 9 6 15'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Dropdown options container */
.irmanha-custom-select__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 2px;
}

.irmanha-custom-select__dropdown--open {
    display: block;
}

/* Individual option */
.irmanha-custom-select__option {
    padding: 12px 15px;
    font-size: var(--irmanha-body);
    color: #111;
    cursor: pointer;
    transition: background-color var(--irmanha-transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.irmanha-custom-select__option:hover,
.irmanha-custom-select__option--highlighted {
    background-color: #f5f5f5;
}

.irmanha-custom-select__option--selected {
    background-color: #D3C1B0;
    color: #000;
    font-weight: var(--irmanha-font-weight-medium);
}

/* Placeholder text styling */
.irmanha-custom-select__trigger--placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .checkout.woocommerce-checkout,
    .irmanha-order-received-content {
        flex-direction: column;
    }
    
    .form-row-first,
    .form-row-last {
        width: 100%;
    }

    .irmanha-checkout-progress {
        max-width: 100%;
        margin-top: var(--irmanha-space-6);
        margin-bottom: var(--irmanha-space-8);
    }

    .irmanha-checkout-progress__container {
        gap: var(--irmanha-space-8);
    }

    .irmanha-checkout-progress__label {
        font-size: var(--irmanha-text-mobile-lg);
    }

    .irmanha-checkout-progress__number {
        width: 32px;
        height: 32px;
        font-size: var(--irmanha-text-mobile-lg);
    }

    .woocommerce form .form-row input.input-text,
    .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 textarea,
    .irmanha-checkout-back__link,
    .irmanha-checkout-summary .irmanha-cart-summary__label,
    .irmanha-checkout-summary .irmanha-cart-summary__value,
    .irmanha-checkout-summary .irmanha-cart-coupon__toggle,
    .irmanha-checkout-summary .irmanha-cart-coupon__input,
    .irmanha-checkout-summary #place_order,
    .woocommerce form .form-row label,
    .irmanha-checkout-summary .wc_payment_methods li label,
    .irmanha-payment-section h3 {
        font-size: var(--irmanha-text-mobile-lg) !important;
    }
}

