/* Shopify Checkout - EXACT Replication */

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

body.shopify-checkout {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #202223;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

/* ========== HEADER ========== */
.shopify-header {
    border-bottom: 1px solid #e1e3e5;
    padding: 24px 20px;
    background: #fff;
}

.shopify-header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.shopify-logo {
    display: flex;
    justify-content: center;
}

.shopify-logo img {
    height: 36px;
    display: block;
}

.cart-summary-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #202223;
    display: block;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.cart-summary-toggle .cart-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

/* Ensure no cart badge appears on checkout */
.cart-summary-toggle .cart-badge,
.shopify-checkout .cart-badge {
    display: none !important;
}

/* ========== MOBILE ORDER SUMMARY ========== */
.mobile-order-summary {
    border-bottom: 1px solid #e1e3e5;
    background: #fafafa;
}

.summary-toggle {
    width: 100%;
    padding: 24px 20px;
    background: #e8e8e8;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #202223;
}

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

.toggle-text {
    font-size: 14px;
    font-weight: 500;
}

.chevron {
    transition: transform 0.2s;
    color: #202223;
}

.summary-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.summary-total {
    font-size: 16px;
    font-weight: 600;
    color: #5A3518;
}

.summary-content {
    padding: 0 20px 20px;
    animation: slideDown 0.2s ease-out;
}

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

/* Summary Items */
.summary-items {
    margin-bottom: 16px;
}

.summary-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e1e3e5;
}

.summary-item:last-child {
    border-bottom: none;
}

.item-image-wrapper {
    position: relative;
    flex-shrink: 0;
}

.item-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: #f6f6f7;
    border: 1px solid #e1e3e5;
}

.item-quantity-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #5A3518;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.item-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
}

.item-name {
    font-size: 14px;
    font-weight: 400;
    color: #202223;
}

.item-price {
    font-size: 14px;
    font-weight: 400;
    color: #202223;
}

/* Discount Section */
.summary-discount,
.desktop-discount {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.discount-input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid #e1e3e5;
    border-radius: 6px;
    font-size: 14px;
    color: #202223;
}

.discount-input::placeholder {
    color: #6d7175;
}

.discount-input:focus {
    outline: none;
    border-color: #5A3518;
    box-shadow: 0 0 0 1px #5A3518;
}

.apply-btn {
    padding: 11px 20px;
    background: #f6f6f7;
    border: 1px solid #e1e3e5;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #202223;
    cursor: pointer;
    transition: background 0.2s;
}

.apply-btn:hover {
    background: #e6e6e7;
}

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

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #202223;
}

.shipping-free {
    color: #5A3518;
    font-weight: 600;
}

.total-row {
    padding-top: 12px;
    border-top: 1px solid #e1e3e5;
    margin-top: 4px;
    font-size: 16px;
}

.total-row strong {
    color: #5A3518;
}

.total-price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.currency {
    font-size: 12px;
    color: #6d7175;
    font-weight: 400;
}

.total-price strong {
    font-size: 18px;
    font-weight: 600;
}

/* ========== MAIN CONTAINER ========== */
.shopify-main {
    max-width: 100%;
}

.shopify-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
}

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

/* ========== FORM SECTIONS ========== */
.shopify-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 16px;
}

.checkout-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.checkout-section:first-child {
    margin-top: 0;
}

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

.section-title {
    font-size: 20px;
    font-weight: 650;
    color: #202223;
    line-height: 1.3;
}

.sign-in-link {
    font-size: 14px;
    color: #5A3518;
    text-decoration: underline;
}

/* ========== FORM FIELDS ========== */
.form-field {
    position: relative;
    width: 100%;
}

.field-label {
    display: block;
    font-size: 12px;
    color: #6d7175;
    margin-bottom: 6px;
    font-weight: 400;
}

.shopify-input,
.shopify-select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #e1e3e5;
    border-radius: 8px;
    font-size: 16px;
    color: #202223;
    background: #fff;
    transition: all 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.shopify-input::placeholder {
    color: #6d7175;
}

.shopify-input:focus,
.shopify-select:focus {
    outline: none;
    border-color: #202223;
    border-width: 3px;
    padding: 12px 15px; /* Adjust for thicker border */
}

.shopify-select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23767676' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

/* Address field with search icon */
.address-input {
    padding-right: 44px;
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Checkbox */
.checkbox-field {
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0 0;
    cursor: pointer;
    accent-color: #5A3518;
}

.checkbox-text {
    font-size: 14px;
    color: #202223;
    line-height: 1.5;
}

/* ========== SHIPPING METHOD ========== */
.shipping-method-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #faf9f8;
    border-radius: 8px;
    border: 1px solid #d4c4b8;
}

.shipping-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.shipping-time {
    font-size: 13px;
    color: #6d7175;
}

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

/* ========== SECURE CHECKOUT ========== */
.payment-section {
    margin-top: 4px;
}

.secure-text {
    font-size: 13px;
    color: #6d7175;
    line-height: 1.6;
    margin-bottom: -12px;
}

/* Payment Element Wrapper */
.payment-element-wrapper {
    min-height: 300px;
    margin-top: -8px;
    margin-bottom: 16px;
    margin-left: -20px;
    margin-right: -20px;
    border: none !important;
}

#payment-element {
    min-height: 250px;
    border: none !important;
    box-shadow: none !important;
}

#payment-element iframe {
    min-height: 250px !important;
    border: none !important;
}

/* Stripe payment element selected state styling */
#payment-element .p-AccordionItem--selected,
#payment-element [data-testid*="accordion-item"][aria-expanded="true"] {
    background: #f9f9f9 !important;
    border-color: #d1d5db !important;
}

#payment-element .p-AccordionItem:hover {
    background: #fafafa !important;
}

#express-checkout-element {
    min-height: 48px;
}

#express-checkout-element iframe {
    min-height: 48px !important;
}

.payment-message {
    font-size: 14px;
    color: #d72c0d;
    margin-top: 12px;
    display: none;
}

/* ========== SUBMIT BUTTON ========== */
.submit-button {
    width: 100%;
    padding: 18px 24px;
    background: #5A3518;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 12px;
}

.submit-button:hover {
    background: #4a2a12;
}

.submit-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* ========== FOOTER LINKS ========== */
.checkout-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e1e3e5;
    justify-content: center;
}

.checkout-footer-links a {
    font-size: 12px;
    color: #5A3518;
    text-decoration: underline;
}

/* ========== CUSTOM EXPRESS BUTTONS ========== */
.custom-express-section {
    margin-bottom: 24px;
}

.express-checkout-title {
    font-size: 14px;
    color: #6d7175;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 400;
}

.custom-express-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.express-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    height: 48px;
}

.apple-pay-btn {
    background: #000;
    color: #fff;
    font-weight: 400;
}

.apple-pay-btn:hover {
    background: #1a1a1a;
}

.apple-pay-btn svg {
    display: block;
    margin: 0;
}

.apple-pay-btn span {
    display: flex;
    align-items: center;
}

.klarna-btn {
    background: #FFB3C7;
    color: #000;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.klarna-btn:hover {
    background: #FFA0B8;
}

/* Express Checkout Message */
.express-checkout-message {
    padding: 20px;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

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

.express-message-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.express-message-title {
    font-size: 16px;
    font-weight: 600;
    color: #155724;
    margin: 0 0 4px 0;
}

.express-message-text {
    font-size: 14px;
    color: #155724;
    margin: 0;
}

/* Keep buttons side by side on all screen sizes */

.or-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.or-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e1e3e5;
}

.or-divider span {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background: #fff;
    font-size: 14px;
    color: #6d7175;
    font-weight: 400;
}

/* ========== MINI ORDER SUMMARY ========== */
.mini-order-summary {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.mini-summary-items {
    margin-bottom: 16px;
}

.mini-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mini-item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    position: relative;
}

.mini-item-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #5A3518;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.mini-item-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-item-name {
    font-size: 14px;
    color: #202223;
}

.mini-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #202223;
}

.mini-summary-total {
    border-top: 1px solid #d1d5db;
    padding-top: 12px;
}

.mini-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #202223;
}

.mini-total-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #d1d5db;
    font-size: 16px;
}

/* ========== DESKTOP ONLY ========== */
.desktop-only {
    display: none;
}

/* ========== RESPONSIVE - TABLET/DESKTOP ========== */
@media (min-width: 1000px) {
    .shopify-container {
        max-width: 1400px;
        padding: 40px 40px;
    }

    /* Two Column Grid Layout */
    .checkout-grid {
        display: grid;
        grid-template-columns: 1fr 480px;
        gap: 80px;
        align-items: start;
    }

    .checkout-main-content {
        max-width: 100%;
        padding: 0;
    }

    /* Sidebar Styling */
    .checkout-sidebar {
        background: #fafafa;
        border-radius: 12px;
        border: 1px solid #e1e3e5;
        padding: 32px;
    }

    .sidebar-sticky {
        position: sticky;
        top: 20px;
    }

    .checkout-sidebar .section-title {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 24px;
        color: #202223;
    }

    .desktop-summary-items {
        margin-bottom: 24px;
        padding-bottom: 20px;
        border-bottom: 1px solid #e1e3e5;
    }

    .desktop-discount {
        margin-bottom: 24px;
    }

    .desktop-totals {
        padding-top: 20px;
        border-top: 1px solid #e1e3e5;
    }

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

    .desktop-only {
        display: block;
    }

    .section-title {
        font-size: 20px;
    }

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

    /* Hide mini summary on desktop */
    .mini-order-summary {
        display: none;
    }
}

/* ========== STRIPE ELEMENT CUSTOMIZATION ========== */
#payment-element {
    margin: 16px 0;
    min-height: 200px;
    width: 100%;
}

#payment-element iframe {
    width: 100% !important;
    min-height: 200px !important;
}

#express-checkout-element {
    min-height: 48px;
    width: 100%;
}

#express-checkout-element iframe {
    width: 100% !important;
}

/* Make Stripe elements match Shopify style */
.StripeElement {
    padding: 14px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
}

.StripeElement--focus {
    border-color: #202223;
    border-width: 3px;
}

.StripeElement--invalid {
    border-color: #d72c0d;
}

/* Stripe Express Checkout button styling */
#express-checkout-element iframe {
    border-radius: 8px !important;
}

/* Payment Element styling - NO BORDER */
.payment-element-wrapper {
    border: none !important;
    border-radius: 0;
    overflow: visible;
}
