:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f3f4f6;
    --secondary-hover: #e5e7eb;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-light: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #d1d5db;
    --border-radius: 8px;
    --border-radius-small: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.5;
}

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

.hidden {
    display: none !important;
}

/* Header Styles */
#checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 100px;
}


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

.selo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
}

.selo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--warning-color);
    color: white;
    padding: 8px 15px;
    gap: 8px;
    width: 100%;
}

.timer-icon i {
    font-size: 18px;
    display: flex;
    align-items: center;
}

.timer-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-text p {
    font-size: 14px;
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

#countdown-timer {
    font-size: 15px;
    font-weight: 600;
    width: 65px;
    display: flex;
    align-items: center;
}

/* Main Checkout Layout */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Form Styles */
.checkout-section {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 20px;
}

.checkout-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.checkout-section h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    background-color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    background-color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Remove seta padrão no IE/Edge */
select::-ms-expand {
    display: none;
}

/* Estilo hover */
select:hover {
    border-color: var(--primary-color);
}

input.valid {
    border-color: var(--success-color);
}

input.invalid {
    border-color: var(--danger-color);
}

.error-message {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-container label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Button Styles */
.btn-primary,
.btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
}

.btn-primary.disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #d1d5db;
}

.btn-primary.disabled:hover {
    background-color: #e5e7eb;
    color: #9ca3af;
    border-color: #d1d5db;
}

/* Email Autocomplete */
.email-container {
    position: relative;
}

.email-suggestions {
    position: absolute;
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
}

.email-suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
}

.email-suggestion-item:hover {
    background-color: var(--secondary-color);
}

/* CEP Search */
.cep-container {
    display: flex;
    gap: 10px;
}

.cep-container input {
    flex: 1;
}

.cep-link {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 5px;
    display: inline-block;
}

.cep-link:hover {
    text-decoration: underline;
}

/* Shipping Options */
#shipping-options-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.shipping-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.shipping-option:hover {
    border-color: var(--primary-color);
}

.shipping-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.shipping-option-radio {
    margin-right: 15px;
}

.shipping-option-info {
    flex: 1;
}

.shipping-option-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.shipping-option-delivery {
    font-size: 13px;
    color: var(--text-secondary);
}

.shipping-option-price {
    font-weight: 600;
}

/* Payment Tabs */
.payment-tabs {
    margin-bottom: 20px;
}

#payment-tabs-container {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.payment-tab {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.payment-tab:hover {
    color: var(--primary-color);
}

.payment-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Credit Card Styles */
.card-preview {
    width: 100%;
    max-width: 350px;
    height: 200px;
    margin: 0 auto 30px;
    perspective: 1000px;
    position: relative;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 25px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: var(--shadow);
    transition: transform 0.6s;
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.card-preview.flipped .card-front {
    transform: rotateY(180deg);
}

.card-preview.flipped .card-back {
    transform: rotateY(0deg);
}

.card-number-display {
    font-size: 22px;
    letter-spacing: 2px;
    margin-top: 60px;
    font-weight: 500;
}

.card-info {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.card-name-display {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.card-expiry-display {
    font-size: 14px;
    font-weight: 500;
}

.card-back {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.card-cvv-display {
    font-size: 16px;
    font-weight: 500;
    background: white;
    color: #333;
    border-radius: 4px;
    padding: 10px 15px;
    letter-spacing: 1px;
}

/* PIX Styles */
.pix-container {
    padding: 20px 0;
}

.pix-instructions-container {
    background-color: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
}

.pix-instructions-container h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--text-primary);
}

.pix-instructions-text {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.pix-discount-offer {
    font-size: 16px;
    font-weight: 600;
    color: var(--success-color);
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    background-color: rgba(34, 197, 94, 0.1);
    border-radius: var(--border-radius);
}

.pix-discount-offer i {
    margin-right: 5px;
}

#generate-pix {
    margin: 0 auto 25px;
    display: block;
    max-width: 300px;
    padding: 15px 20px;
    font-size: 16px;
}

#pix-qrcode-container {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#pix-qrcode {
    max-width: 250px;
    margin: 0 auto 20px;
}

.pix-instructions {
    margin: 15px 0;
    font-size: 14px;
    text-align: center;
    color: var(--text-secondary);
}

.pix-key-container {
    display: flex;
    gap: 10px;
    margin: 0 auto 25px;
    max-width: 400px;
    width: 100%;
}

.pix-key-container input {
    flex: 1;
    background-color: var(--secondary-color);
}

/* PIX Status Messages */
.pix-status-message {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    border-radius: var(--border-radius);
    font-weight: 500;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pix-status-message.success {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pix-status-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pix-status-message.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Order Summary */
.order-summary {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.order-summary-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.order-summary-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.order-summary-content {
    padding: 20px;
}

.products-list {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    object-fit: cover;
    margin-right: 15px;
}

.product-details {
    flex: 1;
}

.product-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.product-quantity {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.product-price {
    font-weight: 600;
}

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

.coupon-input input {
    flex: 1;
}

.order-totals {
    margin-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.total-final {
    font-size: 18px;
    font-weight: 600;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* Mobile Summary */
#mobile-summary-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.mobile-summary-content {
    display: flex;
    flex-direction: column;
}

#mobile-products-count {
    font-size: 14px;
    color: var(--text-secondary);
}

#mobile-total-value {
    font-weight: 600;
    font-size: 16px;
}

#mobile-discount-info {
    font-size: 14px;
    color: var(--success-color);
    font-weight: 500;
}

#mobile-summary-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
}

#mobile-summary-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 110;
    display: flex;
    align-items: flex-end;
}

.modal-content {
    background-color: var(--bg-primary);
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

#close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

/* Checkout Actions */
.checkout-actions {
    margin-top: 30px;
}

/* Responsive Styles */
@media (max-width: 920px) {
    body {
        padding-top: 70px;
    }

    .checkout-container {
        grid-template-columns: 1fr;
    }

    .order-summary {
        display: none;
    }

    #mobile-summary-bar {
        display: flex;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    #timer-container {
        width: 100%;
        justify-content: center;
        padding: 10px 15px;
    }

    .timer-text {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .timer-text p {
        margin: 0;
        font-size: 14px;
    }

    #countdown-timer {
        font-size: 15px;
        font-weight: 600;
    }

    /* Animação para o botão toggle */
    #mobile-summary-toggle .fa-chevron-up {
        transition: transform 0.3s ease;
    }

    #mobile-summary-toggle.open .fa-chevron-up {
        transform: rotate(180deg);
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"] {
        padding: 15px 18px;
        font-size: 16px;
    }
    
    select {
        padding: 15px 18px;
        padding-right: 45px;
        font-size: 16px;
        background-position: right 15px center;
        background-size: 18px;
    }

    .form-group {
        margin-bottom: 30px;
    }

    label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .error-message {
        font-size: 14px;
        margin-top: 8px;
    }
}

/* Banner */
.checkout-banner {
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.banner-image {
    width: 100%;
    height: 120px !important;
    display: block;
    object-fit: cover;
}

/* Shipping Options */
.shipping-fields-row {
    display: flex;
    gap: 15px;
}

.shipping-fields-row .form-group:first-child {
    flex: 5;
}

.shipping-fields-row .form-group:last-child {
    flex: 1;
}

/* Credit Card Fields */
.card-fields-row {
    display: flex;
    gap: 15px;
}

.card-fields-row .form-group:first-child {
    flex: 2;
}

.card-fields-row .form-group:last-child {
    flex: 1;
}

@media (max-width: 768px) {

    .shipping-fields-row,
    .card-fields-row {
        flex-direction: row;
    }
}

.discount-percentage {
    font-size: 12px;
    color: var(--success-color);
    margin-left: 5px;
}

.highlight-discount {
    animation: pulse 1.5s ease-in-out;
    background-color: rgba(34, 197, 94, 0.1);
    border-radius: var(--border-radius);
    padding: 5px;
    margin: 0 -5px 10px;
}

@keyframes pulse {
    0% {
        background-color: rgba(34, 197, 94, 0.1);
    }

    50% {
        background-color: rgba(34, 197, 94, 0.2);
    }

    100% {
        background-color: rgba(34, 197, 94, 0.1);
    }
}

/* Quantity controls */
.quantity-control {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: fit-content;
    overflow: hidden;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.quantity-btn {
    background-color: var(--secondary-color);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.quantity-btn:hover {
    background-color: var(--secondary-hover);
}

.quantity-btn i {
    font-size: 10px;
}

.product-quantity {
    display: inline-block;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 32px;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

.remove-product-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 12px;
    padding: 0;
    margin-top: 5px;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition);
}

.remove-product-btn:hover {
    opacity: 0.8;
}

/* Confirmation Modal Styles */
.confirmation-modal-content {
    max-width: 400px;
}

.confirmation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.confirmation-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.confirmation-modal-body {
    padding: 20px 0;
}

.confirmation-modal-body p {
    margin-bottom: 20px;
    text-align: center;
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content p {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}