/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: #fff;
    color: #333333;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Layout Structure */
.page-wrapper {
    min-height: 100vh;
}

.header-container {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e1e1e1;
}

.header {
    text-align: center;
    padding: 20px 20px;
    background: #fff;
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo {
    width: 100px;
    height: auto;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    min-height: calc(100vh - 100px);
}

.checkout-main {
    flex: 1;
    padding: 0;
    border-right: 1px solid #e1e1e1;
    background: #fff;
}

.checkout-sidebar {
    width: 450px;
    padding: 0;
}

.main-content {
    padding: 54px 48px;
}

.order-summary {
    padding: 48px 40px;
}

/* Sections */
.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header .section-title {
    margin-bottom: 0;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
    position: relative;
}

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

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

/* Floating Labels */
.floating-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #737373;
    font-size: 14px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: white;
    padding: 0 4px;
}

.form-group input:focus ~ .floating-label,
.form-group input:not(:placeholder-shown) ~ .floating-label,
.form-group select:focus ~ .floating-label,
.form-group select.has-value ~ .floating-label {
    top: 0;
    font-size: 12px;
    color: #999;
}

.form-group input:focus ~ .floating-label {
    color: #000;
}

/* Input Fields */
input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.15s;
    background-color: #ffffff;
    color: #333;
}

select {
    width: 100%;
    padding: 12px 35px 12px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.15s;
    background-color: #ffffff;
    color: #333;
    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='currentColor' 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;
}

input[type="text"]:placeholder-shown,
input[type="email"]:placeholder-shown,
input[type="tel"]:placeholder-shown {
    padding-top: 12px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

input::placeholder {
    color: #737373;
}

/* Disabled Fields */
select:disabled {
    background-color: #f8f8f8;
    cursor: not-allowed;
}

/* Checkboxes and Radios */
.checkbox-group {
    display: flex;
    align-items: center;
    margin: 16px 0;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: #545454;
}

/* Custom Radio Buttons */
.custom-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    flex-shrink: 0;
}

.custom-radio-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #000;
}

/* Buttons */
.btn {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary {
    background-color: #000;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #242424;
}

.btn-secondary {
    background: #f8f8f8;
    border: 1px solid #d9d9d9;
    color: #333;
    padding: 12px 20px;
    font-size: 14px;
    white-space: nowrap;
}

/* Icon Buttons */
.icon-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1;
}

.help-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 1;
}

/* Links */
.link {
    color: #0066cc;
    text-decoration: none;
    font-size: 13px;
}

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

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

/* Payment Section */
.payment-container {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
}

.payment-option {
    cursor: pointer;
    position: relative;
}

.payment-option-credit {
    background: #f8f8f8;
    padding: 14px 16px;
    border-bottom: 1px solid #d9d9d9;
}

.payment-option-credit.selected {
    box-shadow: inset 0 0 0 2px #000;
}

.payment-option-pix {
    background: white;
    padding: 14px 16px;
    border-bottom: none;
}

.payment-option-pix.selected {
    box-shadow: inset 0 0 0 2px #000;
}

.payment-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.payment-option-content label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.payment-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-icon {
    height: 24px;
    width: auto;
}

.payment-icon-small {
    height: 16px;
}

.payment-fields {
    display: none;
    padding: 20px;
    border-bottom: 1px #d9d9d9 solid;
}

.payment-fields.active {
    display: block;
}

.payment-message {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin: 0;
}

/* PIX Payment Styles */
.pix-info {
    text-align: center;
    padding: 20px 0;
}

.pix-icon-container {
    margin-bottom: 20px;
}

.pix-large-icon {
    height: 48px;
    width: auto;
}

.pix-description {
    font-size: 14px;
    color: #545454;
    margin-bottom: 24px;
    line-height: 1.5;
}

.pix-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    max-width: 300px;
    margin: 0 auto;
}

.pix-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #545454;
}

.payment-qr-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.payment-qr-box {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-qr-text {
    font-size: 12px;
    color: #757575;
    margin-top: 12px;
    line-height: 1.5;
}


/* Billing Address Section */
.billing-container {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
}

.billing-option {
    cursor: pointer;
    position: relative;
}

.billing-option-same {
    background: #f8f8f8;
    padding: 14px 16px;
    border-bottom: 1px solid #d9d9d9;
}

.billing-option-same.selected {
    box-shadow: inset 0 0 0 2px #000;
}

.billing-option-different {
    background: white;
    padding: 14px 16px;
}

.billing-option-different.selected {
    box-shadow: inset 0 0 0 2px #000;
}

.billing-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.billing-fields {
    display: none;
    padding: 20px;
    border: 1px #d9d9d9 solid;
    border-top: 0;
}

.billing-fields.active {
    display: block;
}

/* Shipping Method Section */
.shipping-placeholder {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    text-align: center;
}

.shipping-placeholder-text {
    color: #757575;
    font-size: 13px;
    margin: 0;
}

.shipping-container {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
}

.shipping-option {
    background: white;
    border-bottom: 1px solid #d9d9d9;
    padding: 14px 16px;
    cursor: pointer;
    position: relative;
}

.shipping-option:last-child {
    border-bottom: none;
}

.shipping-option.selected {
    box-shadow: inset 0 0 0 2px #000;
}

.shipping-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.shipping-option-content label {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
}

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

.shipping-option-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.shipping-option-time {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.shipping-option-price {
    text-align: right;
}

.shipping-price-free {
    font-size: 14px;
    font-weight: 600;
    color: #059669;
}

.shipping-price-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.shipping-price-original {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 2px;
}

/* Product Items */
.product-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    position: relative;
}

.product-item:not(:last-child) {
    border-bottom: 1px solid #e5e5e5;
}

.product-image-container {
    position: relative;
}

.product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.product-placeholder {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 4px;
}

.product-quantity-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #505050;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
}

.product-details {
    flex: 1;
}

.product-name {
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-variant {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.product-price {
    font-size: 14px;
    color: #1a1a1a;
    white-space: nowrap;
    align-self: flex-start;
    padding-top: 2px;
}

/* Discount Code */
.discount-container {
    display: flex;
    gap: 8px;
    margin: 20px 0;
}

.discount-input-wrapper {
    flex: 1;
    position: relative;
}

/* Order Summary */
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.summary-total-label {
    font-size: 16px;
    font-weight: 600;
}

.summary-total-value {
    text-align: right;
}

.summary-currency {
    font-size: 12px;
    color: #666;
    margin-right: 8px;
}

.summary-amount {
    font-size: 18px;
    font-weight: 600;
}

.summary-divider {
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

/* Footer Links */
.footer-links {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.footer-link {
    color: #0066cc;
    font-size: 13px;
    margin: 0 8px;
}

/* Mobile Specific */
.mobile-cart-icon {
    display: none;
}

.mobile-summary-toggle {
    display: none;
}

.mobile-summary-content {
    display: block;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: inline-block;
}

/* Empty State */
.empty-cart {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

/* Messages */
.error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
}

.success-message {
    color: #059669;
    font-size: 13px;
    margin-top: 4px;
}

/* Utility Classes */
.text-gray {
    color: #757575;
}

.text-small {
    font-size: 12px;
}

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

.mt-32 {
    margin-top: 32px;
}

.pt-24 {
    padding-top: 24px;
}

.border-top {
    border-top: 1px solid #e5e5e5;
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        background-color: #fff;
    }

    .page-wrapper {
        background: #fff;
    }

    .header-container {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .header {
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .container {
        flex-direction: column;
        border: none;
        max-width: 100%;
        padding-bottom: 40px;
    }

    .checkout-main {
        border-right: none;
        order: 2;
    }

    .checkout-sidebar {
        width: 100%;
        order: 1;
        background: #f8f8f8;
        padding: 20px 15px 5px;
        border-bottom: 1px solid #e1e1e1;
    }

    .main-content {
        padding: 20px 15px;
    }

    .order-summary {
        padding: 0;
    }

    .mobile-cart-icon {
        display: block;
    }

    .mobile-summary-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding-bottom: 15px;
    }

    .mobile-summary-toggle-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-summary-toggle-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-summary-toggle-title {
        font-size: 14px;
        font-weight: 500;
    }

    .mobile-summary-toggle-price {
        font-size: 16px;
        font-weight: 600;
    }

    .toggle-arrow {
        transform: rotate(0deg);
        transition: transform 0.3s;
    }

    .toggle-arrow.active {
        transform: rotate(180deg);
    }

    .mobile-summary-content {
        display: none;
        animation: slideDown 0.3s ease-out;
    }

    .mobile-summary-content.active {
        display: block;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .mobile-only {
        display: block !important;
        margin-bottom: 20px;
    }

    .desktop-only {
        display: none !important;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

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

    .section {
        margin-bottom: 24px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 25px;
    }

    .footer-links {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
        font-size: 12px;
        padding: 16px;
        margin-top: 16px;
    }
}

@media (min-width: 769px) {
    .mobile-summary-toggle {
        display: none;
    }

    .mobile-summary-content {
        display: block !important;
    }
}

/* Discount Code Styles */
.discount-message {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.discount-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.discount-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-remove-discount {
    background: none;
    border: none;
    color: #155724;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    white-space: nowrap;
}

.btn-remove-discount:hover {
    color: #0d3f1a;
    text-decoration: none;
}

.discount-row {
    color: #059669;
    font-weight: 500;
}

.discount-row .discount-amount {
    color: #059669;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
