/* EP Tickets — checkout.css */

.ept-checkout {
    max-width: 680px;
    margin: 0 auto;
    font-family: inherit;
}

/* Ticket type rows */
.ept-ticket-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.ept-ticket-type {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s;
}

.ept-ticket-type:not(.ept-sold-out):hover {
    border-color: var(--color-primary, #e8177d);
}

.ept-ticket-type.ept-sold-out {
    opacity: 0.55;
}

.ept-ticket-info {
    flex: 1;
    min-width: 0;
}

.ept-ticket-name {
    font-weight: 600;
    font-size: 1rem;
    color: #111;
}

.ept-ticket-desc {
    font-size: 0.875rem;
    color: #555;
    margin-top: 2px;
}

.ept-ticket-urgency {
    font-size: 0.8rem;
    font-weight: 600;
    color: #dc2626;
    margin-top: 4px;
}

.ept-ticket-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.ept-ticket-price {
    font-weight: 700;
    font-size: 1.05rem;
}

.ept-badge-sold-out {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71717a;
    border: 1px solid #d4d4d8;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Quantity stepper */
.ept-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    overflow: hidden;
}

.ept-qty-btn {
    width: 36px;
    height: 36px;
    background: #f4f4f5;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ept-qty-btn:hover {
    background: #e4e4e7;
}

.ept-qty {
    width: 48px;
    text-align: center;
    border: none;
    border-left: 1px solid #d4d4d8;
    border-right: 1px solid #d4d4d8;
    height: 36px;
    font-size: 1rem;
    font-weight: 600;
    appearance: textfield;
    -moz-appearance: textfield;
}

.ept-qty::-webkit-inner-spin-button,
.ept-qty::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Desktop: lay the ticket types out as a grid instead of a single stack.
   Events run 3+ ticket types as a rule, so a stack pushes the totals and the
   rest of the checkout a long way down the page.

   Only the ticket list widens. .ept-checkout's 680px cap is lifted at the
   breakpoint and reapplied to the form's other direct child — which is
   .ept-checkout-card, the wrapper holding every post-selection step from the
   totals down to the pay button — and to the confirmation panel. Wide form
   fields and a wide payment element are harder to scan, not easier.
   The theme has to give us the room too — the homepage section wrapper caps
   its own width (see sections/homepage/tickets.blade.php); without that this
   media query changes nothing, since a parent's max-width still wins. */
@media (min-width: 768px) {
    .ept-ticket-types {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    /* The row card becomes a vertical card: name/description on top, price
       and stepper on their own line at the foot. .ept-ticket-info keeps
       flex: 1, which in column direction is what pushes the price row to the
       bottom, so cards in a row stay aligned however long the copy runs. */
    .ept-ticket-type {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .ept-ticket-right {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

@media (min-width: 1024px) {
    .ept-checkout {
        max-width: 1120px;
    }

    .ept-ticket-types {
        grid-template-columns: repeat(3, 1fr);
    }

    #ept-ticket-form > :not(.ept-ticket-types),
    .ept-confirmation {
        max-width: 680px;
        margin-inline: auto;
    }
}

/* Total bar */
/* Wrap total + form in the same card style as ticket types */
.ept-checkout-card {
    background: #ffffff;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    padding: 24px;
    margin-top: 12px;
}

.ept-total-bar {
    background: #f4f4f5;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    overflow: hidden;
}

.ept-total-breakdown {
    padding: 12px 20px 8px;
    border-bottom: 1px solid #e4e4e7;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ept-total-row {
    display: flex;
    justify-content: space-between;
    color: #52525b;
}

.ept-total-grand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    font-size: 1rem;
}

.ept-total-grand strong {
    font-size: 1.2rem;
}

/* Buyer details */
.ept-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e4e4e7;
}

.ept-buyer-details,
.ept-payment-section {
    margin-bottom: 24px;
}

.ept-field {
    margin-bottom: 16px;
}

.ept-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.ept-field .ept-radio-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 0;
}

.ept-radio-label input[type="radio"] {
    width: auto !important;
    flex-shrink: 0;
}

.ept-field label span[aria-hidden] {
    color: #dc2626;
}

.ept-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.ept-field input:focus {
    outline: none;
    border-color: var(--color-primary, #e8177d);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #e8177d) 15%, transparent);
}

/* Custom questions */
.ept-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ept-field textarea:focus {
    outline: none;
    border-color: var(--color-primary, #e8177d);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #e8177d) 15%, transparent);
}

.ept-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.ept-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
}

/* Discount code */
.ept-discount-wrap {
    margin-bottom: 20px;
}

.ept-discount-input-row {
    display: flex;
    gap: 8px;
}

.ept-discount-input-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.ept-discount-input-row input:focus {
    outline: none;
    border-color: var(--color-primary, #e8177d);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #e8177d) 15%, transparent);
}

.ept-discount-input-row input:disabled {
    background: #f4f4f5;
    color: #52525b;
}

.ept-btn-secondary {
    padding: 10px 18px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s;
}

.ept-btn-secondary:hover:not(:disabled) {
    background: #f4f4f5;
    border-color: #a1a1aa;
}

.ept-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ept-discount-msg {
    margin-top: 6px;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.ept-discount-msg--success {
    color: #16a34a;
}

.ept-discount-msg--error {
    color: #dc2626;
}

/* Errors */
.ept-errors {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-top: 12px;
}

/* T&C acceptance */
.ept-tc-wrap {
    margin-bottom: 12px;
    padding: 14px 0;
}

.ept-tc-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
    font-size: 0.875rem;
    color: #52525b;
    cursor: pointer;
    font-weight: 400 !important;
}

.ept-tc-label input[type="checkbox"] {
    width: auto !important;
    flex-shrink: 0;
    margin-top: 3px;
}

.ept-tc-text {
    line-height: 1.5;
}

.ept-tc-label a,
.ept-tc-label a:visited {
    display: inline !important;
    color: var(--color-primary, #e8177d);
    text-decoration: underline;
    white-space: nowrap;
}

/* Submit button */
.ept-actions {
    margin-top: 8px;
}

.ept-btn-pay {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    background: var(--color-primary, #e8177d);
    color: var(--color-primary-fg, #fff);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}

.ept-btn-pay:hover {
    opacity: 0.9;
}

.ept-btn-pay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#ept-spinner {
    animation: ept-spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes ept-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Notice */
.ept-notice {
    padding: 20px;
    background: #f4f4f5;
    border-radius: 8px;
    text-align: center;
    color: #52525b;
}

/* Confirmation */
.ept-confirmation {
    text-align: center;
    padding: 24px;
}

.ept-confirmation-inner {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 40px 32px;
}

.ept-confirmation-inner svg {
    color: #16a34a;
    margin: 0 auto 16px;
    display: block;
}

.ept-confirmation-inner h2 {
    font-size: 1.5rem;
    margin: 0 0 12px;
}

.ept-confirmation-inner p {
    color: #444;
    margin: 0 0 8px;
}

.ept-conf-ref {
    font-size: 0.875rem;
    color: #71717a;
}

/* Responsive */
@media (max-width: 520px) {
    .ept-ticket-type {
        flex-wrap: wrap;
    }

    .ept-ticket-right {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: space-between;
    }

    .ept-checkout-card {
        padding: 16px;
    }

    .ept-total-breakdown {
        padding: 10px 14px 8px;
    }

    .ept-total-grand {
        padding: 10px 14px;
    }

    .ept-discount-input-row input {
        font-size: 0.85rem;
    }

    .ept-confirmation-inner {
        padding: 28px 20px;
    }
}

/* -------------------------------------------------------------------------
   Attendee repeater
   ------------------------------------------------------------------------- */

.ept-attendees-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e4e4e7;
}

.ept-attendees-optional {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #71717a;
}

.ept-attendees-hint {
    font-size: 0.875rem;
    color: #71717a;
    margin: -8px 0 16px;
}

.ept-attendee-row {
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fafafa;
}

.ept-attendee-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ept-attendee-num {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
}

.ept-attendee-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #71717a;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.ept-attendee-remove:hover {
    color: #dc2626;
}

.ept-attendee-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ept-attendee-fields .ept-field {
    margin-bottom: 0;
}

.ept-attendee-fields input,
.ept-attendee-fields select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ept-attendee-fields input:focus,
.ept-attendee-fields select:focus {
    outline: none;
    border-color: var(--color-primary, #e8177d);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #e8177d) 15%, transparent);
}

.ept-attendees-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
}

.ept-attendees-count {
    font-size: 0.8125rem;
    color: #71717a;
}

@media (max-width: 520px) {
    .ept-attendee-fields {
        grid-template-columns: 1fr;
    }
}
