/* Shared checkout layout/styles (mirrors event.ejs checkout) — marketplace scope */

.mp-subpage--checkout {
    background: #fff;
}

.mp-subpage--checkout .checkout-section {
    flex: 1;
    display: block;
    background: #fff;
    min-height: auto;
    padding-top: 1rem;
    padding-bottom: 2.5rem;
    overflow-x: clip;
}

.mp-subpage--checkout .checkout-main {
    background: #fff;
    min-height: auto;
    padding-top: 0;
    padding-bottom: 0;
}

.mp-subpage--checkout .checkout-container {
    max-width: 1572px;
    margin: 0 auto;
    padding: 0 1rem;
}

.mp-subpage--checkout .checkout-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    min-height: auto;
    width: 100%;
}

.mp-subpage--checkout .checkout-form-section {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 0.75rem 0;
}

.mp-subpage--checkout .checkout-form {
    max-width: 100%;
    width: 100%;
}

.mp-subpage--checkout .form-section {
    margin-bottom: 0;
}

.mp-subpage--checkout .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.mp-subpage--checkout .form-field__input-wrap {
    min-width: 0;
    width: 100%;
}

.mp-subpage--checkout .form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    min-width: 0;
}

.mp-subpage--checkout .form-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
    letter-spacing: 0.025em;
    font-family: var(--font-roobert);
    margin: 0;
}

.mp-subpage--checkout .payment-methods {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.mp-subpage--checkout .payment-methods img {
    height: auto;
    max-height: 24px;
    width: auto;
    object-fit: contain;
}

.mp-subpage--checkout .section-title {
    display: flex;
    align-items: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: #000;
    margin-bottom: 1.25rem;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .contact-info-subtitle {
    font-size: 0.8125rem;
    color: rgba(0, 0, 0, 0.6);
    margin: -0.5rem 0 1.25rem;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mp-subpage--checkout .field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    min-width: 0;
}

.mp-subpage--checkout .field-row--single {
    grid-template-columns: 1fr !important;
}

.mp-subpage--checkout .form-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #000;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .form-field input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    font-size: 0.875rem;
    color: #000;
    font-family: var(--font-roobert);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mp-subpage--checkout .form-field input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.mp-subpage--checkout .form-field input:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.mp-subpage--checkout .form-field input:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.4);
}

.mp-subpage--checkout .form-field--has-icon .form-field__input-wrap {
    display: block;
}

.mp-subpage--checkout .form-field--has-icon .form-field__icon {
    display: none;
}

.mp-subpage--checkout .checkout-form-error {
    color: #dc2626;
    font-size: 0.875rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .form-submit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}

.mp-subpage--checkout .btn-continue-payment {
    background: linear-gradient(135deg, #3d15ce 0%, #9046ea 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .btn-continue-payment:hover:not(:disabled) {
    filter: brightness(0.95);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.mp-subpage--checkout .btn-continue-payment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mp-subpage--checkout .cta-trust-line {
    display: none;
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    font-family: var(--font-roobert);
    font-weight: 400;
    text-align: center;
}

.mp-subpage--checkout .mobile-payment-methods {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    opacity: 0.4;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}

.mp-subpage--checkout .mobile-payment-methods img {
    max-height: 18px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%) brightness(1.2);
}

.mp-subpage--checkout .mobile-only {
    display: block;
}

.mp-subpage--checkout .order-summary-section {
    width: 100%;
    min-width: 0;
    padding: 1rem 0;
    border-left: none;
    box-sizing: border-box;
}

.mp-subpage--checkout .order-summary {
    position: static;
    margin-bottom: 1.5rem;
    padding: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

.mp-subpage--checkout .event-summary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.mp-subpage--checkout .event-image-container {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
}

.mp-subpage--checkout .event-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mp-subpage--checkout .event-image.loaded {
    opacity: 1;
}

.mp-subpage--checkout .event-image-ph {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 2rem;
    opacity: 0.6;
}

.mp-subpage--checkout .event-details {
    flex: 1;
    min-width: 0;
}

.mp-subpage--checkout .event-name {
    font-size: 1.125rem;
    font-weight: 900;
    color: #000;
    margin: 0 0 0.5rem;
    font-family: var(--font-roobert);
    line-height: 1.25;
}

.mp-subpage--checkout .event-date,
.mp-subpage--checkout .event-location {
    font-size: 0.875rem;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 0.25rem;
    font-family: var(--font-roobert);
    line-height: 1.3;
}

.mp-subpage--checkout .event-location {
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 0;
}

.mp-subpage--checkout .order-summary-section-label {
    margin: 0 0 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .checkout-tickets-section {
    margin-top: 1.25rem;
}

.mp-subpage--checkout .checkout-tickets-cards {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.mp-subpage--checkout .checkout-ticket-card {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 14px;
    padding: 14px 16px;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .checkout-ticket-card__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.mp-subpage--checkout .checkout-ticket-card__title {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
}

.mp-subpage--checkout .checkout-ticket-card__price {
    flex-shrink: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
    text-align: right;
    white-space: nowrap;
}

.mp-subpage--checkout .checkout-ticket-card__meta {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.4;
    color: #6b7280;
}

.mp-subpage--checkout .order-summary .event-summary {
    margin-bottom: 0;
    padding-bottom: 0;
}

.mp-subpage--checkout .price-breakdown {
    padding: 0;
    border: none;
    margin-top: 1.5rem;
    margin-bottom: 0;
}

/* Desglose: animación open/close (igual que event checkout) */
.mp-subpage--checkout #breakdownDetails {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    border-bottom: 0;
    padding: 0;
    margin: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding-bottom 0.3s ease, border-color 0.25s ease, visibility 0s linear 0.35s;
}

.mp-subpage--checkout #breakdownDetails:not(.open) .order-summary-section-label,
.mp-subpage--checkout #breakdownDetails:not(.open) .price-line {
    display: none;
}

.mp-subpage--checkout #breakdownDetails.open {
    max-height: 420px;
    opacity: 1;
    visibility: visible;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 1rem;
    margin-bottom: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding-bottom 0.3s ease, border-color 0.25s ease, visibility 0s;
}

.mp-subpage--checkout #breakdownDetails:not(.open) + .checkout-total-block {
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
    margin-top: 0;
}

.mp-subpage--checkout #breakdownDetails.open + .checkout-total-block {
    border-top: none;
    padding-top: 0;
    margin-top: 0.5rem;
}

.mp-subpage--checkout #breakdownDetails.open + .checkout-total-block .total-line {
    margin-top: 0.75rem;
}

.mp-subpage--checkout .checkout-total-block .total-line .checkout-total-footnote {
    margin: 0;
}

.mp-subpage--checkout .price-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .price-breakdown .price-line:not(.total-line) {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #6b7280;
}

.mp-subpage--checkout .price-breakdown .price-line:not(.total-line) > span:last-child {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #6b7280;
    flex-shrink: 0;
    text-align: right;
}

.mp-subpage--checkout .price-line:last-child {
    margin-bottom: 0;
}

.mp-subpage--checkout .total-line {
    padding-top: 0;
    margin-top: 0;
    margin-bottom: 0.25rem;
    border-top: 0;
    display: flex !important;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

.mp-subpage--checkout .total-line:hover,
.mp-subpage--checkout .total-line:active,
.mp-subpage--checkout .total-line:focus {
    text-decoration: none;
    outline: none;
}

.mp-subpage--checkout #toggleBreakdown:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
    border-radius: 8px;
}

.mp-subpage--checkout .total-line__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .checkout-total-block {
    display: block;
}

.mp-subpage--checkout .checkout-total-block__meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.mp-subpage--checkout .checkout-total-footnote {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #9ca3af;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .checkout-total-block .total-line #mpCheckoutTotal {
    margin-left: auto;
    text-align: right;
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.15;
    color: #111827;
    letter-spacing: -0.02em;
    font-family: var(--font-roobert);
}

/* Marketplace-only QR notice */
.mp-subpage--checkout .mp-checkout-qr-note {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 1.25rem 0 0;
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    font-size: 0.8125rem;
    color: #6d28d9;
    line-height: 1.45;
    font-family: var(--font-roobert);
}

.mp-subpage--checkout .mp-checkout-qr-note svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #7c3aed;
}

@media (min-width: 1024px) {
    .mp-subpage--checkout .mobile-only {
        display: none;
    }

    .mp-subpage--checkout .checkout-container {
        padding: 0 2.5rem;
    }

    .mp-subpage--checkout .checkout-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 2.5rem;
    }

    .mp-subpage--checkout .checkout-form-section {
        flex: 1 1 0;
        min-width: 0;
        padding-right: 0;
    }

    .mp-subpage--checkout .checkout-form .form-field__input-wrap {
        position: relative;
    }

    .mp-subpage--checkout .checkout-form .form-field--has-icon .form-field__icon {
        display: flex;
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        align-items: center;
        justify-content: center;
        color: #9ca3af;
        pointer-events: none;
        z-index: 1;
    }

    .mp-subpage--checkout .checkout-form .form-field--has-icon input {
        height: 54px;
        padding: 0 1rem 0 2.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #fff;
        font-size: 0.9375rem;
        color: #111827;
        box-sizing: border-box;
    }

    .mp-subpage--checkout .checkout-form .form-field--has-icon input:hover {
        border-color: #d1d5db;
    }

    .mp-subpage--checkout .checkout-form .form-field--has-icon input:focus {
        border-color: #a78bfa;
        box-shadow: 0 0 0 3px rgba(61, 21, 206, 0.12);
        outline: none;
    }

    .mp-subpage--checkout .form-submit {
        align-items: stretch;
        margin-top: 1.5rem;
    }

    .mp-subpage--checkout .cta-trust-line {
        display: block;
        text-align: center;
    }

    .mp-subpage--checkout .payment-methods img {
        filter: grayscale(100%) brightness(1.2);
    }

    .mp-subpage--checkout .order-summary-section {
        flex: 0 0 400px;
        width: 400px;
        max-width: 400px;
        border-left: 1px solid rgba(0, 0, 0, 0.1);
        padding-left: 2rem;
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .mp-subpage--checkout .event-summary {
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
        margin-bottom: 0;
    }

    .mp-subpage--checkout .order-summary {
        position: sticky;
        top: calc(62px + 1.5rem);
        margin-bottom: 0;
        width: 100%;
        padding-bottom: 420px;
        transition: padding-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mp-subpage--checkout .order-summary.breakdown-open {
        padding-bottom: 0;
    }

    .mp-subpage--checkout #toggleBreakdown {
        cursor: pointer;
    }

    .mp-subpage--checkout .order-summary .event-image-container {
        width: 122px;
        height: 122px;
        min-height: 0;
        aspect-ratio: 1;
        margin-bottom: 0;
        flex-shrink: 0;
        overflow: hidden;
    }

    .mp-subpage--checkout .order-summary .event-image,
    .mp-subpage--checkout .order-summary .event-image-ph {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 12px;
    }

    .mp-subpage--checkout .order-summary .event-name {
        font-size: 1.125rem;
        font-weight: 700;
        margin: 0 0 0.35rem;
    }

    .mp-subpage--checkout .order-summary .event-date,
    .mp-subpage--checkout .order-summary .event-location {
        font-size: 0.9375rem;
        font-weight: 400;
        margin-bottom: 0.15rem;
    }

    .mp-subpage--checkout .order-summary .checkout-tickets-section {
        margin-top: 1.5rem;
    }

    .mp-subpage--checkout .order-summary .checkout-tickets-section + .price-breakdown {
        margin-top: 1.5rem;
    }

    .mp-subpage--checkout .checkout-total-block .total-line {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .mp-subpage--checkout .checkout-total-block .total-line #mpCheckoutTotal {
        align-self: center;
        width: auto;
        font-size: 1.5rem;
    }

    .mp-subpage--checkout .mobile-payment-methods {
        display: none;
    }
}

@media (min-width: 1280px) {
    .mp-subpage--checkout .checkout-container {
        padding: 0 3.75rem;
    }

    .mp-subpage--checkout .field-row:not(.field-row--single) {
        grid-template-columns: 1fr 1fr;
    }

    .mp-subpage--checkout .order-summary-section {
        flex-basis: 440px;
        width: 440px;
        max-width: 440px;
    }
}

@media (max-width: 1023px) {
    .mp-subpage--checkout .checkout-form .form-header {
        display: none;
    }

    .mp-subpage--checkout .order-summary .event-summary {
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .mp-subpage--checkout .order-summary .event-image-container {
        width: 64px !important;
        min-width: 64px;
        max-width: 64px;
        height: 64px !important;
        min-height: 64px;
        max-height: 64px;
        flex-shrink: 0;
        overflow: hidden;
        border-radius: 8px;
        border: none;
        box-shadow: none;
    }

    .mp-subpage--checkout .order-summary .event-image,
    .mp-subpage--checkout .order-summary .event-image-ph {
        border-radius: 8px;
        border: none;
        box-shadow: none;
    }

    .mp-subpage--checkout .order-summary .event-name {
        font-size: 0.9375rem;
        font-weight: 900;
        margin: 0 0 0.125rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mp-subpage--checkout .order-summary .event-date,
    .mp-subpage--checkout .order-summary .event-location {
        font-size: 0.8rem;
    }
}
