/**
 * EasyBooking Irish — Frontend Styles
 *
 * Customer-facing booking widget, voucher widget, and service list.
 * Mobile-first, theme-agnostic, modern design.
 */

/* ── Widget Base ── */
.ebi-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1e293b;
    max-width: 640px;
    margin: 0 auto;
}

.ebi-widget * {
    box-sizing: border-box;
}

/* ── Progress Steps ── */
.ebi-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.ebi-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 100px;
}

.ebi-progress-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: #e2e8f0;
    color: #94a3b8;
    transition: all 0.3s;
}

.ebi-progress-step.active .ebi-progress-num {
    background: #2e7d32;
    color: #fff;
}

.ebi-progress-step.done .ebi-progress-num {
    background: #16a34a;
    color: #fff;
}

.ebi-progress-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
}

.ebi-progress-step.active .ebi-progress-label {
    color: #2e7d32;
}

/* ── Step Titles ── */
.ebi-step-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 20px;
}

/* ── Service Selection ── */
.ebi-service-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ebi-service-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.ebi-service-option:hover {
    border-color: #2e7d32;
    background: #f0fdf4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ebi-service-info h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
}

.ebi-service-info p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.ebi-service-price {
    text-align: right;
}

.ebi-price {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
}

.ebi-duration {
    font-size: 12px;
    color: #94a3b8;
}

/* ── Selected Service Banner ── */
.ebi-selected-service {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.ebi-selected-service span {
    color: #64748b;
}

/* ── Calendar ── */
.ebi-calendar {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ebi-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ebi-cal-title {
    font-size: 16px;
    font-weight: 700;
}

.ebi-cal-nav {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ebi-cal-nav:hover {
    background: #f1f5f9;
}

.ebi-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.ebi-cal-day-label {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px 0;
}

.ebi-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ebi-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: default;
    transition: all 0.2s;
}

.ebi-cal-empty {
    visibility: hidden;
}

.ebi-cal-disabled {
    color: #cbd5e1;
}

.ebi-cal-available {
    cursor: pointer;
    color: #1e293b;
    background: #f0fdf4;
}

.ebi-cal-available:hover {
    background: #2e7d32;
    color: #fff;
    transform: scale(1.1);
}

.ebi-cal-selected {
    background: #2e7d32 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

/* ── Time Slots ── */
.ebi-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.ebi-time-slot {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.ebi-time-slot:hover {
    border-color: #2e7d32;
    background: #f0fdf4;
}

.ebi-time-slot.selected {
    border-color: #2e7d32;
    background: #2e7d32;
    color: #fff;
}

.ebi-no-slots {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

/* ── Customer Form ── */
.ebi-customer-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.ebi-widget .ebi-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ebi-widget .ebi-field label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.ebi-widget .ebi-input {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border 0.2s;
    width: 100%;
}

.ebi-widget .ebi-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.ebi-widget .ebi-textarea {
    resize: vertical;
}

/* ── Booking Summary ── */
.ebi-booking-summary {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.ebi-booking-summary .ebi-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.ebi-booking-summary .ebi-summary-row span {
    color: #64748b;
}

/* ── Book Now Button ── */
.ebi-book-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
}

.ebi-book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.ebi-book-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ebi-back-btn {
    display: block;
    margin: 16px auto 0;
    padding: 8px 16px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.ebi-back-btn:hover {
    color: #334155;
}

/* ── Success State ── */
.ebi-success {
    text-align: center;
    padding: 40px 20px;
}

.ebi-success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ebi-success h2 {
    font-size: 24px;
    color: #2e7d32;
    margin: 0 0 8px;
}

.ebi-success p {
    color: #64748b;
    font-size: 15px;
}

/* ── Error ── */
.ebi-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── Loading ── */
.ebi-loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.ebi-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #2e7d32;
    border-radius: 50%;
    animation: ebi-spin 0.8s linear infinite;
}

@keyframes ebi-spin {
    to {
        transform: rotate(360deg);
    }
}

.ebi-empty-msg {
    text-align: center;
    color: #64748b;
    padding: 40px;
}

/* ── Voucher Widget ── */
.ebi-voucher-header {
    text-align: center;
    margin-bottom: 24px;
}

.ebi-voucher-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
}

.ebi-voucher-header p {
    color: #64748b;
    margin: 0;
}

.ebi-voucher-amounts {
    margin-bottom: 24px;
}

.ebi-voucher-amounts h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #475569;
}

.ebi-amount-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ebi-amount-btn {
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ebi-amount-btn:hover {
    border-color: #2e7d32;
}

.ebi-amount-btn.selected {
    border-color: #2e7d32;
    background: #2e7d32;
    color: #fff;
}

.ebi-amount-custom {
    font-size: 14px;
    font-weight: 500;
}

.ebi-gift-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.ebi-widget .ebi-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ebi-widget .ebi-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ebi-widget .ebi-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.ebi-widget .ebi-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.ebi-widget .ebi-toggle input:checked+.ebi-toggle-slider {
    background: #2e7d32;
}

.ebi-widget .ebi-toggle input:checked+.ebi-toggle-slider::before {
    transform: translateX(20px);
}

.ebi-gift-fields {
    margin-top: 16px;
}

.ebi-gift-fields h3 {
    font-size: 15px;
    margin: 0 0 12px;
}

.ebi-voucher-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 20px;
    border-top: 2px solid #f1f5f9;
    font-size: 18px;
}

.ebi-voucher-total strong {
    font-size: 24px;
    color: #2e7d32;
}

.ebi-voucher-success {
    text-align: center;
    padding: 40px 20px;
}

.ebi-voucher-success h2 {
    font-size: 24px;
    color: #2e7d32;
    margin: 0 0 8px;
}

.ebi-voucher-code-display {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    background: #f0fdf4;
    border: 2px dashed #2e7d32;
    padding: 20px 32px;
    border-radius: 12px;
    margin-top: 20px;
}

.ebi-voucher-code-display span {
    font-size: 13px;
    color: #64748b;
}

.ebi-voucher-code-display strong {
    font-size: 28px;
    font-family: monospace;
    letter-spacing: 3px;
    color: #2e7d32;
}

/* ── Services List (Shortcode) ── */
.ebi-services-list {
    display: grid;
    gap: 16px;
}

.ebi-services-list[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.ebi-services-list[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.ebi-services-list[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Block Editor Preview ── */
.ebi-block-preview {
    padding: 20px;
    border: 2px dashed #2e7d32;
    border-radius: 12px;
    background: #f0fdf4;
}

.ebi-block-placeholder {
    text-align: center;
    color: #2e7d32;
}

.ebi-block-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

.ebi-block-placeholder h3 {
    margin: 0 0 4px;
}

.ebi-block-placeholder p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

/* ── Category Tabs (ARIA tab switcher) ── */
.ebi-category-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    margin-bottom: 20px;
    background: #f1f5f9;
    border-radius: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ebi-category-tabs::-webkit-scrollbar {
    display: none;
}

.ebi-category-tab {
    flex-shrink: 0;
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ebi-category-tab:hover {
    background: #e2e8f0;
    color: #334155;
}

.ebi-category-tab.active {
    background: #fff;
    color: #2e7d32;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Category Panels (ARIA tabpanel) ── */
.ebi-category-panel {
    animation: ebi-fade-in 0.2s ease;
}

.ebi-category-panel[hidden] {
    display: none;
}

@keyframes ebi-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .ebi-widget {
        max-width: 100%;
        padding: 0 8px;
    }

    .ebi-amount-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ebi-time-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ebi-services-list {
        grid-template-columns: 1fr !important;
    }

    .ebi-service-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ebi-service-price {
        text-align: left;
    }

    .ebi-category-tabs {
        padding: 0 4px 12px;
    }

    .ebi-category-tab {
        padding: 6px 14px;
        font-size: 13px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   WooCommerce Checkout Overrides
   High-specificity selectors to override WC core + theme styles.
   ══════════════════════════════════════════════════════════════════ */

/* ── Layout / Container ── */
body.woocommerce-checkout .woocommerce {
    max-width: 680px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
}

body.woocommerce-checkout .woocommerce .col2-set,
body.woocommerce-checkout .woocommerce .col2-set .col-1,
body.woocommerce-checkout .woocommerce .col2-set .col-2 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ── Heading ── */
body.woocommerce-checkout .woocommerce h3,
body.woocommerce-checkout .woocommerce h3#order_review_heading {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 24px 0 16px !important;
    padding: 0 !important;
    border: none !important;
}

/* ── Notices ── */
body.woocommerce-checkout .woocommerce .woocommerce-NoticeGroup,
body.woocommerce-checkout .woocommerce .woocommerce-info {
    border-radius: 8px !important;
    border-left-color: #2e7d32 !important;
}

/* ── Form Fields ── */
body.woocommerce-checkout .woocommerce form .form-row {
    padding: 0 !important;
    margin: 0 0 14px !important;
    float: none !important;
    width: 100% !important;
}

body.woocommerce-checkout .woocommerce form .form-row-first,
body.woocommerce-checkout .woocommerce form .form-row-last {
    width: 100% !important;
    float: none !important;
}

body.woocommerce-checkout .woocommerce form .form-row label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 4px !important;
    display: block !important;
}

body.woocommerce-checkout .woocommerce form .form-row label .optional {
    font-weight: 400 !important;
    color: #94a3b8 !important;
}

body.woocommerce-checkout .woocommerce form .form-row .woocommerce-input-wrapper {
    width: 100% !important;
}

body.woocommerce-checkout .woocommerce form .form-row input.input-text,
body.woocommerce-checkout .woocommerce form .form-row textarea,
body.woocommerce-checkout .woocommerce form .form-row select,
body.woocommerce-checkout .woocommerce form .form-row .select2-container .select2-selection {
    padding: 12px 14px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    transition: border 0.2s !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    height: auto !important;
    line-height: 1.4 !important;
}

body.woocommerce-checkout .woocommerce form .form-row input.input-text:focus,
body.woocommerce-checkout .woocommerce form .form-row textarea:focus,
body.woocommerce-checkout .woocommerce form .form-row select:focus {
    outline: none !important;
    border-color: #2e7d32 !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1) !important;
}

/* ── Place Order Button ── */
body.woocommerce-checkout .woocommerce #payment #place_order,
body.woocommerce-checkout .woocommerce button#place_order {
    width: 100% !important;
    padding: 16px 24px !important;
    background: linear-gradient(135deg, #2e7d32, #43a047) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
    margin-top: 16px !important;
}

body.woocommerce-checkout .woocommerce #payment #place_order:hover,
body.woocommerce-checkout .woocommerce button#place_order:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4) !important;
    background: linear-gradient(135deg, #1b5e20, #2e7d32) !important;
}

/* ── Order Review Table ── */
body.woocommerce-checkout .woocommerce table.shop_table {
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
}

body.woocommerce-checkout .woocommerce table.shop_table th {
    background: #f8fafc !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.woocommerce-checkout .woocommerce table.shop_table td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 14px !important;
    color: #334155 !important;
}

body.woocommerce-checkout .woocommerce table.shop_table tr:last-child td {
    border-bottom: none !important;
}

body.woocommerce-checkout .woocommerce table.shop_table .order-total .amount {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #2e7d32 !important;
}

/* ── Hide elements not needed for EBI checkout ── */
body.woocommerce-checkout .woocommerce .woocommerce-shipping-fields,
body.woocommerce-checkout .woocommerce .woocommerce-additional-fields,
body.woocommerce-checkout .woocommerce #order_comments_field,
body.woocommerce-checkout .woocommerce .woocommerce-form-coupon-toggle,
body.woocommerce-checkout .woocommerce .woocommerce-form-login-toggle {
    display: none !important;
}

/* ── Payment Methods Section ── */
body.woocommerce-checkout .woocommerce #payment {
    background: #fff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 20px !important;
    margin-top: 20px !important;
}

body.woocommerce-checkout .woocommerce #payment ul.payment_methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
    border: none !important;
}

body.woocommerce-checkout .woocommerce #payment ul.payment_methods li {
    padding: 14px 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    margin-bottom: 8px !important;
    transition: border-color 0.2s !important;
    background: #fff !important;
}

body.woocommerce-checkout .woocommerce #payment ul.payment_methods li:hover {
    border-color: #2e7d32 !important;
}

body.woocommerce-checkout .woocommerce #payment ul.payment_methods li label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
}

body.woocommerce-checkout .woocommerce #payment div.payment_box {
    background: #f8fafc !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-top: 8px !important;
    color: #64748b !important;
    font-size: 13px !important;
}

body.woocommerce-checkout .woocommerce #payment div.payment_box::before {
    display: none !important;
}

/* ── Privacy / Terms ── */
body.woocommerce-checkout .woocommerce .woocommerce-privacy-policy-text {
    font-size: 12px !important;
    color: #94a3b8 !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    body.woocommerce-checkout .woocommerce {
        padding: 12px !important;
    }

    body.woocommerce-checkout .woocommerce table.shop_table td,
    body.woocommerce-checkout .woocommerce table.shop_table th {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }

    body.woocommerce-checkout .woocommerce #payment {
        padding: 14px !important;
    }
}

/* ── Merchant Logo (Book Now page) ── */
.ebi-merchant-logo-wrap {
    text-align: center;
    padding: 16px 0 24px;
}

.ebi-merchant-logo {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.ebi-merchant-name {
    font-size: 20px;
    font-weight: 700;
    color: #64748b;
    margin: 0;
    text-align: center;
}

@media (max-width: 640px) {
    .ebi-merchant-logo {
        max-width: 140px;
    }
}