* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta solicitada */
    --primary: rgba(29, 29, 37, 1);
    /* color principal */
    --btn: rgba(243, 146, 0, 1);
    /* color botones */
    --btn-light: rgba(246, 170, 79, 1);
    --btn-dark: rgba(220, 120, 0, 1);
    --accent-white: rgba(255, 255, 255, 1);
    /* 'otros' */

    /* Superficies y tarjetas: nunca usar blanco como fondo */
    --surface: rgba(37, 42, 50, 1);
    --card: rgba(43, 48, 56, 1);
    --input-bg: rgba(255, 255, 255, 0.03);

    /* Grises adaptados a modo oscuro (texto y matices claros sobre fondo oscuro) */
    --gray-900: rgba(255, 255, 255, 0.95);
    --gray-800: rgba(235, 235, 235, 0.85);
    --gray-700: rgba(210, 210, 210, 0.75);
    --gray-600: rgba(190, 190, 190, 0.65);
    --gray-500: rgba(160, 160, 160, 0.55);
    --gray-400: rgba(120, 120, 120, 0.45);
    --gray-300: rgba(90, 90, 90, 0.35);
    --gray-200: rgba(70, 70, 70, 0.25);
    --gray-100: rgba(50, 50, 50, 0.15);

    --white: rgba(255, 255, 255, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -2px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.45);
}

body {
    font-family: 'Inter', sans-serif;
    /* Fondo oscuro suave en lugar de blanco */
    background: linear-gradient(135deg, rgba(23, 25, 30, 1) 0%, rgba(29, 29, 37, 1) 100%);
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
    overflow-x: hidden;
    color: var(--gray-900);
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: linear-gradient(135deg, var(--btn) 0%, var(--btn-light) 100%);
    clip-path: ellipse(100% 100% at 50% 0%);
    z-index: -1;
    opacity: 0.1;
}

.container {
    background: linear-gradient(180deg, var(--surface), var(--card));
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.version {
    position: fixed;
    right: 20px;
    bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
}

.container.expanded {
    max-width: 800px;
    max-height: 85vh;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 2px;
    opacity: 0;
    background: linear-gradient(90deg, transparent, var(--btn), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), rgba(40, 45, 52, 1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.logo-image {
    width: 60px;
}

.logo:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.logo i {
    font-size: 32px;
    color: var(--white);
}

.company-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.company-subtitle {
    font-size: 16px;
    color: var(--gray-500);
    font-weight: 400;
}

.form-section {
    margin-bottom: 12px;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: var(--input-bg);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-input:focus {
    border-color: var(--btn);
    box-shadow: 0 0 0 6px rgba(243, 146, 0, 0.12);
    transform: translateY(-2px);
}

.form-input:focus+.form-label {
    color: var(--btn);
}

.form-input::placeholder {
    color: var(--gray-500);
}

.btn-primary {
    width: 100%;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--surface);
    background: linear-gradient(135deg, var(--btn), var(--btn-light));
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--btn-dark), var(--btn));
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary.loading {
    pointer-events: none;
}

.btn-primary .btn-text {
    transition: opacity 0.3s ease;
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

/* Loader Animation */
.loader {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary.loading .loader {
    opacity: 1;
}

.loader::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--surface);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Results Section */
.results-section {
    display: none;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    overflow: hidden;
    flex-direction: row;
    color: var(--gray-900);
}

.results-section.show {
    display: flex;
}

.results-section-left {
    flex: 1;
    padding-right: 16px;
    border-right: 1px solid var(--gray-200);
}

.results-section-right {
    max-width: 400px;
    flex: 1;
}

.results-header {
    text-align: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.results-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 24px;
    overflow: hidden;
}

.products-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.products-header {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.products-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.products-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

.results-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.results-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
    max-height: calc(85% - 180px);
}
.product-list:only-child,
.product-list:has(.product-item:only-child) {
    justify-content: center;
}

.product-list .product-item:only-child {
    max-width: 320px;
    width: 48%;
    margin: 0 auto;
}
/* Layout para Desktop */
@media (min-width: 768px) {
    .results-content {
        flex-direction: row;
        gap: 32px;
        align-items: flex-start;
    }

    .products-section {
        flex: 2;
        max-width: none;
    }

    .purchase-summary {
        flex: 0 0 320px;
        margin-top: 0;
        position: sticky;
        top: 0;
        overflow-y: auto;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--btn);
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--btn-dark);
}

.product-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: fit-content;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--btn);
}

.product-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--btn);
    opacity: 0.7;
}

.product-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: white;
}

.product-image img {
    width: auto;
    height: 120%;
    margin: 0 auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.8;
    z-index: 1;
}

.product-image i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: var(--white);
    z-index: 2;
}

.product-image-color ::before {
    background: linear-gradient(135deg, var(--btn), var(--btn-light));
}

.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--btn);
}

.product-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--btn);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.product-item:hover::before {
    transform: scaleY(1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.4;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--btn);
}

.product-description {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 12px;
    line-height: 1.5;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--gray-500);
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    align-self: flex-start;
}

.back-btn:hover {
    color: var(--btn);
    border-color: var(--btn);
    background: rgba(243, 146, 0, 0.06);
}

/* Purchase Summary */
.purchase-summary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 12px;
    padding-bottom: 10px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    /* para que las pestañas puedan posicionarse y animarse dentro */
    overflow: hidden;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.summary-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1px;
}

.selected-count {
    background: var(--btn);
    color: var(--surface);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 12px;
}

.summary-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    min-height: 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0px 5px 0px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item-name {
    color: var(--gray-800);
    flex: 1;
    margin-right: 11px;
}

.summary-item-price {
    color: var(--white);
    font-weight: 500;
}

.summary-details {
    border-top: 1px solid var(--gray-200);
    padding-top: 16px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.summary-options {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.summary-line:last-child {
    margin-bottom: 0;
}

.summary-line.subtotal .summary-text {
    color: var(--gray-800);
    font-weight: 500;
}

.summary-line-discount-text {
    color: var(--btn);
    font-weight: 500;
}

.summary-line-discount-value {
    color: var(--btn);
    font-weight: 600;
}

.summary-line.tax .summary-text {
    color: var(--gray-800);
}

.summary-line.total {
    border-top: 2px solid var(--btn);
    padding-top: 12px;
    margin-top: 16px;
    margin-bottom: 0;
}

.summary-line.total .summary-text {
    font-size: 16px;
    font-weight: 700;
    color: #fff !important;
}

.summary-line.total .summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--btn);
}

.summary-text {
    color: var(--gray-700) !important;
    font-size: 14px;
}

.summary-value {
    color: var(--gray-900);
    font-weight: 600;
}

.pay-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--surface);
    background: linear-gradient(135deg, var(--btn), var(--btn-light));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0.5;
    flex-shrink: 0;
    margin-top: auto;
}

.pay-btn:not(:disabled) {
    opacity: 1;
}

.pay-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--btn-dark), var(--btn));
}

.pay-btn:disabled {
    cursor: not-allowed;
}

.pay-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.pay-btn:not(:disabled):hover::before {
    left: 100%;
}

.pay-btn.loading {
    pointer-events: none;
}

.pay-btn .btn-text {
    transition: opacity 0.3s ease;
}

.pay-btn.loading .btn-text {
    opacity: 0;
}

.pay-btn .btn-loader {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pay-btn.loading .btn-loader {
    opacity: 1;
}

.pay-btn .btn-loader::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Product Selection State - REMOVED FOR INFORMATIONAL DISPLAY ONLY */

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.fade-out {
    animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Responsive Design */
@media (max-width: 767px) {
    .container.expanded {
        max-width: 95vw;
        max-height: 90vh;
        margin: 10px;
    }

    .results-content {
        flex-direction: column;
    }

    .products-section {
        order: 1;
    }

    .purchase-summary {
        order: 2;
        margin-top: 24px;
        position: static;
        flex: none;
        height: auto;
        min-height: 400px;
        display: flex;
        flex-direction: column;
    }

    .product-list {
        grid-template-columns: 1fr;
        max-height: calc(90vh - 280px);
    }

    .summary-items {
        max-height: 150px;
        flex: 1;
    }

    .results-section-left {
        display: none;
    }

    .selected-count {
        font-size: 11px;
    }

    .summary-header-back {
        display: flex !important;
    }
}

@media (min-width: 768px) {
    .container.expanded {
        max-width: 95vw;
        max-height: 85vh;
    }

    .results-content {
        flex-direction: row;
        gap: 32px;
        align-items: stretch;
        height: 100%;
    }

    .products-section {
        flex: 2;
        max-width: none;
        display: flex;
        flex-direction: column;
    }

    .product-list {
        max-height: calc(85% - 180px);
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .purchase-summary {
        flex: 0 0 350px;
        margin-top: 0;
        height: 100%;
        max-height: none;
    }

    .results-section-left {
        display: block;
    }

    .selected-count {
        font-size: 11px;
    }

    .summary-header-back {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 24px;
        margin: 10px;
    }

    .container.expanded {
        padding: 20px;
    }

    .company-name {
        font-size: 28px;
    }

    .form-input,
    .btn-primary {
        padding: 14px 16px;
    }

    .product-item {
        padding: 16px;
        min-height: 180px;
    }

    .product-image {
        height: 100px;
    }

    .purchase-summary {
        padding: 0px;
    }

    .summary-items {
        max-height: 50vh;
    }

    .results-section-left {
        display: none;
    }

    .summary-item-name {
        font-size: 12px !important;
    }

    .summary-header-back {
        display: flex !important;
    }

    .selected-count {
        font-size: 11px;
    }
}

@media (min-width: 1200px) {
    .container.expanded {
        max-width: 1200px;
    }

    .product-list {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }

    .purchase-summary {
        flex: 0 0 380px;
        height: 100%;
    }

    .results-section-left {
        display: block;
    }
}

/* Success Animation */
.success-check {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--btn);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: successPulse 0.6s ease;
}

.success-check i {
    color: var(--white);
    font-size: 24px;
}

.purchase-summary-tab {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    background: rgba(28, 33, 38, 1);
    padding: 25px 20px 25px 25px;
}

/* Estados iniciales: detalles en el centro, formulario oculto a la derecha */
#purchaseSummaryTabDetails {
    transform: translateX(0);
    z-index: 2;
}

#purchaseSummaryTabForm {
    transform: translateX(100%);
    z-index: 1;
}

/* Preview inicial fuera a la derecha (más allá del formulario) */
#purchaseSummaryTabPreview {
    transform: translateX(200%);
    z-index: 0;
}

/* Cuando la clase form-visible está activa, intercambiamos las pestañas con un slide (detalles <-, form center) */
#purchaseSummary.form-visible #purchaseSummaryTabDetails {
    transform: translateX(-100%);
    z-index: 1;
}

#purchaseSummary.form-visible #purchaseSummaryTabForm {
    transform: translateX(0);
    z-index: 2;
}

/* Cuando la clase preview-visible está activa, desplazamos todo para mostrar el preview en el centro */
#purchaseSummary.preview-visible #purchaseSummaryTabDetails {
    transform: translateX(-200%);
    z-index: 0;
}

#purchaseSummary.preview-visible #purchaseSummaryTabForm {
    transform: translateX(-100%);
    z-index: 1;
}

#purchaseSummary.preview-visible #purchaseSummaryTabPreview {
    transform: translateX(0);
    z-index: 3;
}

/* Estilos básicos para el formulario de facturación */
.billing-row {
    display: flex;
    gap: 12px;
}

.billing-field {
    flex: 1;
    margin-bottom: 12px;
    position: relative;
    /* necesario para posicionar el loader */
}

.billing-field label {
    display: block;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-weight: 600;
}

.billing-field input,
.billing-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-500);
    background: var(--input-bg);
    border-radius: 10px;
    font-size: 14px;
    color: #fff;
    outline: none;
}

.billing-field select option {
    color: #000;
}

.billing-field input:focus,
.billing-field select:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.06);
}

/* Loader pequeño dentro del campo de facturación */
.billing-field .input-loader {
    position: absolute;
    right: 10px;
    top: 41px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.billing-field.loading .input-loader {
    opacity: 1;
}

.billing-field .input-loader::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #222 inset !important;
    -webkit-text-fill-color: #fff !important;
    /* border: 1px solid #fff; */
}

/* Firefox maneja distinto, pero casi no mete color feo */
input:autofill {
    filter: none;
    background: white !important;
    color: #000 !important;
}

.summary-header-title {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.summary-header-back {
    border-radius: 50%;
    padding: 10px;
    margin-right: 7px;
    display: none;
}

/* ===== Pantalla final de confirmación (overlay a pantalla completa) ===== */
.final-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInUp 0.3s ease;
}

.final-card {
    width: min(520px, 92vw);
    background: linear-gradient(180deg, var(--surface), var(--card));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.final-check {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--btn), var(--btn-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(243,146,0,0.35);
    animation: successPulse 1.2s ease 1;
}

.final-check i { font-size: 28px; }

.final-title {
    color: var(--gray-900);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.final-subtitle {
    color: var(--gray-600);
    font-size: 15px;
    margin-bottom: 20px;
}

/* Detalles finales con icono y animación */
.final-details {
    display: grid;
    gap: 10px;
    margin: 12px 0 18px 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(6px);
    animation: detailFadeIn .45s ease forwards;
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--btn), var(--btn-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d1d25;
}

.detail-label {
    color: var(--gray-600);
    font-size: 12px;
    letter-spacing: .2px;
}

.detail-value {
    color: var(--gray-900);
    font-weight: 600;
    word-break: break-all;
}

@keyframes detailFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.final-back-btn {
    padding: 14px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--surface);
    background: linear-gradient(135deg, var(--btn), var(--btn-light));
    width: 100%;
    position: relative;
    overflow: hidden;
}

.final-back-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.final-back-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
    transition: left .6s ease;
}

.final-back-btn:hover::before { left: 100%; }

/* Canvas para confeti ocupando toda la tarjeta */
.confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}