/* ============================================
   IGNITE — Checkout Page Styles
   Identidade: Dark-Tech / Red Accent
   ============================================ */

:root {
    --bg-checkout: #0a0a0a;
    --bg-card: #141414;
    --accent-primary: #ff0b55;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #999999;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body.checkout-page {
    background: var(--bg-checkout);
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.checkout-header {
    height: 80px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.checkout-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.checkout-header .logo {
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #fff;
    margin-left: -10px;
}

.checkout-header .logo-dot {
    color: var(--accent-primary);
}

.checkout-header .logo img {
    height: 58px;
    width: auto;
    display: block;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.badge svg {
    color: var(--accent-primary);
}

/* Main Grid */
.checkout-main {
    padding: 40px 0 80px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 1024px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Cards */
.checkout-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 24px;
}

.card-title {
    margin: 0 0 30px;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #000;
    font-weight: 800;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: -20px;
    margin-bottom: 30px;
}

/* Form Groups */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Adjust row when containing only one full-width item */
.form-row .form-group[style*="grid-column: span 2"] {
    grid-column: span 2;
}

.form-group input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px 16px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 11, 85, 0.02);
    box-shadow: 0 0 15px rgba(255, 11, 85, 0.1);
}

.form-group input[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.01);
}

.form-group input[readonly]:focus {
    border-color: var(--border-subtle);
    box-shadow: none;
}

.form-group.small {
    grid-column: span 1;
}

.form-group.grow {
    grid-column: span 1;
}

.form-group.x-small {
    width: 80px;
}

/* CEP Logic */
.cep-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cep-loading {
    position: absolute;
    right: 15px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.hidden {
    display: block !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.address-details {
    display: block;
    max-height: 1200px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
}

.loading-opacity {
    opacity: 0.5;
    pointer-events: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Payment Options */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    gap: 15px;
}

.payment-option input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
}

.payment-option.active {
    border-color: var(--accent-primary);
    background: rgba(255, 11, 85, 0.05);
}

.payment-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.payment-label {
    font-weight: 700;
    font-size: 1rem;
}

.payment-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.payment-icon {
    color: var(--text-muted);
}

.payment-option.active .payment-icon {
    color: var(--accent-primary);
}

/* Submit Button */
.btn-checkout-submit {
    width: 100%;
    background: var(--accent-primary);
    color: #000;
    border: none;
    padding: 20px;
    border-radius: 50px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.btn-checkout-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(255, 11, 85, 0.4);
}

.terms-text {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.terms-text a {
    color: var(--text-main);
    text-decoration: underline;
}

/* Summary Card */
.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 30px;
    position: sticky;
    top: 120px;
}

.summary-title {
    margin: 0 0 25px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.cart-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.item-img {
    width: 60px;
    height: 60px;
    background: #0d0d0d;
    border-radius: 8px;
    padding: 5px;
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.item-flavor {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.qty-stepper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 2px;
}

.qty-stepper button {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: 0.2s;
}

.qty-stepper button:hover {
    color: var(--accent-primary);
}

.qty-stepper span {
    padding: 0 8px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.btn-remove-checkout {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    transition: 0.2s;
}

.btn-remove-checkout:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Coupon */
.coupon-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.coupon-box input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px;
    font-family: var(--font-body);
}

.coupon-box button {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Totals */
.summary-totals {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.total-line.main {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
}

.total-line .shipping-value {
    transition: color 0.3s;
}

.total-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 15px 0;
}

/* Footer */
.checkout-mini-footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.checkout-mini-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.secure-logos {
    display: flex;
    gap: 15px;
    opacity: 0.5;
}

.secure-logos img {
    height: 24px;
}

/* Payment Modal Styles */
.payment-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.payment-modal.active {
    display: flex;
}

.modal-content {
    background: #111118;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover {
    color: var(--accent-primary);
}

.modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 11, 85, 0.1);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.modal-ready h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.qr-container {
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    width: fit-content;
    margin: 0 auto 30px;
}

.qr-container img {
    display: block;
    width: 200px;
    height: 200px;
}

.pix-copy-box {
    text-align: left;
    margin-bottom: 30px;
}

.pix-copy-box label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.copy-input-group {
    display: flex;
    gap: 10px;
}

.copy-input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 15px;
    color: #fff;
    font-size: 0.9rem;
    font-family: monospace;
}

.copy-input-group button {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.copy-input-group button:hover {
    background: #ff2d6e;
    transform: translateY(-2px);
}

.modal-footer-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
}

.btn-simulation-only {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 20px;
    width: 100%;
}

.btn-simulation-only:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    color: #fff;
}

#pix-payment-details {
    transition: all 0.5s ease;
}

#pix-payment-details.hidden {
    display: none;
}

.modal-ready h3.confirmed {
    color: #00ff88;
    transform: scale(1.1);
    transition: all 0.3s ease;
}