/* Checkout Modal and Quantity Selector Styles */

/* Quantity Selector */
.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #000;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    transform: scale(1.1);
    background: #333;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-value {
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    color: #000;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: #1a1a1a;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: white;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
    text-align: center;
}

/* Checkout Form */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.form-group label {
    font-size: 0.9rem;
    color: #ccc;
    font-weight: 500;
}

.form-group input,
.form-group select {
    background: #2a2a2a;
    border: 1px solid #444;
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Payment Selection */
.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 5px 0;
}

.payment-option {
    position: relative;
}

.payment-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.payment-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #2a2a2a;
    min-height: 65px;
}

.payment-label img {
    max-height: 20px;
    margin-bottom: 8px;
}

.payment-label span {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

/* Step Transitions */
.checkout-step {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.checkout-step.hidden {
    display: none;
    opacity: 0;
    transform: translateX(20px);
}

.checkout-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Bank Info Box */
.bank-info-box {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a2a;
}

.bank-row:last-child {
    border-bottom: none;
}

.bank-label {
    color: #888;
    font-size: 0.8rem;
}

.bank-value {
    color: #fff;
    font-weight: 600;
    font-family: 'Inter', monospace;
}

.copy-btn {
    background: #333;
    border: none;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover {
    background: #444;
}

.copy-btn.copied {
    background: #10b981;
    color: white;
}

.btn-back {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
    font-weight: 600;
}

.btn-next {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
}

.bank-title {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* QR Visual Crop - Adjusted to show full image */
.qr-crop-container {
    width: 100%;
    max-width: 60px;
    height: auto;
    overflow: hidden;
    margin: 0 auto 5px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: white;
    padding: 2px;
    /* The QR itself needs white background to be scannable */
}

.qr-crop-container img {
    border: none;
    max-width: 100% !important;
    width: 100%;
    height: auto;
    margin: 0;
    display: block;
}

/* Summary Box */
.order-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px dashed #444;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.summary-total {
    border-top: 1px solid #444;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-light);
}

.btn-confirm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.btn-confirm:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(15, 76, 129, 0.4);
}

/* ==============================
   PAYMENT POLICY NOTICE
   ============================== */

.payment-notice {
    text-align: center;
}

.notice-icon {
    margin: 0 auto 10px;
    width: 64px;
    height: 64px;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4ade80;
}

.notice-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.notice-body {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    margin-bottom: 20px;
    border: 1px solid #444;
}

.notice-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 15px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.notice-text {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 18px;
}

.notice-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notice-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.step-num {
    min-width: 28px;
    height: 28px;
    background: var(--primary, #0f4c81);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.notice-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 10px;
    border: 1px solid #444;
    margin-bottom: 15px;
    transition: all 0.2s;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.notice-checkbox:hover {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

.notice-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #4ade80;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-aceptar-politica:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #555;
}

.btn-aceptar-politica:not(:disabled) {
    background: #4ade80;
    color: #000;
}

.btn-aceptar-politica:not(:disabled):hover {
    background: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 222, 128, 0.3);
}

/* Fullscreen QR Overlay */
.qr-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.qr-fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

.qr-fullscreen-content {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-fullscreen-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.qr-fullscreen-close {
    margin-top: 20px;
    background: white;
    color: #333;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ==============================
   CHECKOUT MOBILE RESPONSIVENESS
   ============================== */

@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        padding: 20px;
        border-radius: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-title {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 28px;
    }

    .quantity-control {
        gap: 10px;
        padding: 8px;
    }

    .payment-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .payment-label {
        padding: 10px 8px;
        min-height: 55px;
    }

    .payment-label span {
        font-size: 0.75rem;
    }

    .bank-info-box {
        padding: 12px;
    }

    .bank-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .bank-label {
        font-size: 0.75rem;
    }

    .bank-value {
        font-size: 0.85rem;
    }

    .copy-btn {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    .btn-next {
        padding: 12px;
        font-size: 0.95rem;
    }

    .btn-back {
        padding: 10px;
    }

    .btn-confirm {
        padding: 12px;
        font-size: 0.95rem;
    }

    .summary-row {
        font-size: 0.85rem;
    }

    .summary-total {
        font-size: 1rem;
    }

    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    .qr-fullscreen-content {
        max-width: 95%;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
        padding: 16px;
        display: flex;
        flex-direction: column;
    }

    .modal-title {
        font-size: 1.15rem;
    }

    .checkout-form {
        gap: 10px;
        flex: 1;
        overflow-y: auto;
    }

    #cart-items-container {
        max-height: 200px !important;
    }

    .payment-options {
        grid-template-columns: 1fr;
    }

    .order-summary {
        padding: 12px;
    }

    .qr-crop-container {
        max-width: 80px;
    }
}