/* ============================================
   MOLDOSERVICE CHECKOUT v8 - LUMA OVERRIDE
   
   LUMA defaults we must override:
   .opc-wrapper { width:66.66%; float:left; padding-right:30px }
   .opc-wrapper .form-shipping-address { max-width:500px }
   .opc-sidebar { width:33.33%; float:right; margin:46px 0 20px }
   .checkout-payment-method .billing-address-form { max-width:500px }
   ============================================ */

/* === BACKGROUND === */
body.checkout-index-index {
    background: #f8fafc !important;
}

/* === HIDE LUMA DEFAULT HEADER/FOOTER ELEMENTS === */
body.checkout-index-index .page-header,
body.checkout-index-index .nav-sections,
body.checkout-index-index .page-title-wrapper,
body.checkout-index-index .authentication-wrapper,
body.checkout-index-index .opc-estimated-wrapper,
body.checkout-index-index .opc-block-shipping-information,
body.checkout-index-index footer .block.newsletter,
body.checkout-index-index footer form.subscribe,
body.checkout-index-index footer .footer.links {
    display: none !important;
}

/* === CUSTOM HEADER === */
body.checkout-index-index .page-wrapper::before {
    content: 'MOLDOSERVICE' !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border-bottom: 1px solid #e5e7eb !important;
    height: 60px !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    letter-spacing: 3px !important;
    color: #0f172a !important;
}

/* === CONTAINER === */
body.checkout-index-index .page-main {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 24px 48px !important;
}
body.checkout-index-index .columns {
    display: block !important;
}
body.checkout-index-index .column.main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    float: none !important;
}

/* === CHECKOUT CONTAINER - FLEX LAYOUT === */
body.checkout-index-index .checkout-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 28px !important;
    align-items: flex-start !important;
}

/* === PROGRESS BAR (full width row) === */
body.checkout-index-index .opc-progress-bar {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 440px !important;
    margin: 20px auto !important;
    padding: 0 !important;
    display: flex !important;
    list-style: none !important;
    background: none !important;
    position: relative !important;
    counter-reset: step !important;
}
body.checkout-index-index .opc-progress-bar::before {
    content: '' !important;
    position: absolute !important;
    top: 16px !important;
    left: 15% !important;
    right: 15% !important;
    height: 2px !important;
    background: #e2e8f0 !important;
    z-index: 0 !important;
}
body.checkout-index-index .opc-progress-bar-item {
    flex: 1 !important;
    text-align: center !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    width: auto !important;
}
body.checkout-index-index .opc-progress-bar-item::before,
body.checkout-index-index .opc-progress-bar-item::after {
    display: none !important;
}
body.checkout-index-index .opc-progress-bar-item > span {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    position: relative !important;
    background: none !important;
    padding: 0 !important;
    width: auto !important;
}
body.checkout-index-index .opc-progress-bar-item > span::before {
    counter-increment: step !important;
    content: counter(step) !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #e2e8f0 !important;
    border: none !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #fff !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.checkout-index-index .opc-progress-bar-item > span::after {
    display: none !important;
}
body.checkout-index-index .opc-progress-bar-item._active > span { color: #0f172a !important; }
body.checkout-index-index .opc-progress-bar-item._active > span::before {
    background: #dc2626 !important;
}
body.checkout-index-index .opc-progress-bar-item._complete > span { color: #0f172a !important; }
body.checkout-index-index .opc-progress-bar-item._complete > span::before {
    content: '✓' !important;
    background: #16a34a !important;
    font-size: 16px !important;
}

/* === OPC WRAPPER (LEFT COLUMN) ===
   OVERRIDE Luma: width:66.66%, float:left, padding-right:30px */
body.checkout-index-index .opc-wrapper {
    width: auto !important;
    float: none !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    order: 1 !important;
}

/* === KILL max-width:500px ON FORMS ===
   THIS IS THE KEY FIX! Luma limits forms to 500px */
body.checkout-index-index .opc-wrapper .form-login,
body.checkout-index-index .opc-wrapper .form-shipping-address,
body.checkout-index-index .checkout-payment-method .billing-address-form,
body.checkout-index-index .checkout-payment-method .field-select-billing {
    max-width: 100% !important;
    width: 100% !important;
}

/* === STEPS LIST === */
body.checkout-index-index #checkoutSteps {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

/* === CARDS (shipping address, shipping method, payment) === */
body.checkout-index-index .checkout-shipping-address,
body.checkout-index-index .checkout-shipping-method,
body.checkout-index-index .checkout-payment-method {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 28px 32px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04) !important;
}

/* === STEP TITLES === */
body.checkout-index-index .step-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding: 0 0 14px !important;
    margin: 0 0 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
}

/* === FORM FIELDS === */
body.checkout-index-index .fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}
body.checkout-index-index .fieldset > .field,
body.checkout-index-index .field {
    margin: 14px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
body.checkout-index-index .field .label,
body.checkout-index-index .field > label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 4px !important;
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding: 0 !important;
}
body.checkout-index-index .field .control {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}
body.checkout-index-index .legend { display: none !important; }
body.checkout-index-index .field .note { color: #64748b !important; font-size: 12px !important; }

/* === INPUTS ===
   Override Luma form field widths */
body.checkout-index-index input[type="text"],
body.checkout-index-index input[type="email"],
body.checkout-index-index input[type="tel"],
body.checkout-index-index input[type="password"],
body.checkout-index-index input[type="number"],
body.checkout-index-index select,
body.checkout-index-index textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    background-color: #fff !important;
    height: auto !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    outline: none !important;
    box-shadow: none !important;
}
body.checkout-index-index input:focus,
body.checkout-index-index select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}
body.checkout-index-index select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
    padding-right: 36px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
body.checkout-index-index input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
    accent-color: #dc2626 !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
body.checkout-index-index input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #dc2626 !important;
    flex-shrink: 0 !important;
}

/* === FIELD ERRORS === */
body.checkout-index-index .field._error input { border-color: #dc2626 !important; }
body.checkout-index-index .field-error,
body.checkout-index-index div.mage-error { color: #dc2626 !important; font-size: 12px !important; margin-top: 4px !important; }

/* === SHIPPING METHODS TABLE === */
body.checkout-index-index .table-checkout-shipping-method {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 6px !important;
}
body.checkout-index-index .table-checkout-shipping-method tr {
    background: #f8fafc !important;
    cursor: pointer !important;
}
body.checkout-index-index .table-checkout-shipping-method tr:hover { background: #f1f5f9 !important; }
body.checkout-index-index .table-checkout-shipping-method td {
    padding: 12px 14px !important;
    border-top: 1px solid #e5e7eb !important;
    border-bottom: 1px solid #e5e7eb !important;
    font-size: 14px !important;
    vertical-align: middle !important;
}
body.checkout-index-index .table-checkout-shipping-method td:first-child {
    border-left: 1px solid #e5e7eb !important;
    border-radius: 8px 0 0 8px !important;
    width: 40px !important;
}
body.checkout-index-index .table-checkout-shipping-method td:last-child {
    border-right: 1px solid #e5e7eb !important;
    border-radius: 0 8px 8px 0 !important;
}
body.checkout-index-index .table-checkout-shipping-method .col-price {
    font-weight: 700 !important;
    color: #dc2626 !important;
    white-space: nowrap !important;
}
body.checkout-index-index .table-checkout-shipping-method .col-carrier {
    font-weight: 600 !important;
    color: #0f172a !important;
}

/* === BUTTONS === */
body.checkout-index-index .action.primary,
body.checkout-index-index button.action.primary {
    background: #dc2626 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 12px 36px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-transform: none !important;
    box-shadow: 0 1px 3px rgba(220,38,38,.2) !important;
    line-height: 1.4 !important;
    height: auto !important;
}
body.checkout-index-index .action.primary:hover {
    background: #b91c1c !important;
}

/* === SIDEBAR ===
   OVERRIDE Luma: width:33.33%, float:right, margin:46px 0 20px */
body.checkout-index-index .opc-sidebar {
    width: 380px !important;
    float: none !important;
    flex: 0 0 380px !important;
    margin: 0 !important;
    padding: 0 !important;
    order: 2 !important;
    position: sticky !important;
    top: 20px !important;
}

/* === ORDER SUMMARY === */
body.checkout-index-index .opc-block-summary {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 24px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04) !important;
    margin: 0 !important;
}
body.checkout-index-index .opc-block-summary > .title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding: 0 0 12px !important;
    margin: 0 0 14px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
body.checkout-index-index .opc-block-summary .items-in-cart > .title {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    border: none !important;
    padding: 10px 0 !important;
}
body.checkout-index-index .opc-block-summary .product-item {
    padding: 10px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
body.checkout-index-index .opc-block-summary .product-item-name {
    font-size: 13px !important;
    font-weight: 600 !important;
}
body.checkout-index-index .opc-block-summary .product-image-container img {
    border-radius: 6px !important;
}

/* Totals */
body.checkout-index-index .opc-block-summary .table-totals th,
body.checkout-index-index .opc-block-summary .table-totals td {
    padding: 6px 0 !important;
    font-size: 14px !important;
}
body.checkout-index-index .opc-block-summary .grand.totals th,
body.checkout-index-index .opc-block-summary .grand.totals td {
    font-size: 16px !important;
    font-weight: 700 !important;
    padding-top: 12px !important;
    border-top: 2px solid #0f172a !important;
}
body.checkout-index-index .opc-block-summary .grand.totals .price {
    color: #dc2626 !important;
}

/* Hide 0,00 RON tax artifact + tax summary */
body.checkout-index-index .opc-block-summary .totals-tax-summary { display: none !important; }
body.checkout-index-index .opc-block-summary .totals-tax-details { display: none !important; }

/* === PAYMENT METHODS === */
body.checkout-index-index .payment-method {
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    margin-bottom: 8px !important;
}
body.checkout-index-index .payment-method._active {
    border-color: #dc2626 !important;
    background: #fff !important;
}
body.checkout-index-index .payment-method-title {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px 16px !important;
}
body.checkout-index-index .payment-method-title label {
    font-size: 14px !important;
    font-weight: 600 !important;
    flex: 1 !important;
}
body.checkout-index-index .payment-method-content {
    padding: 0 16px 16px !important;
}
body.checkout-index-index .payment-method .action.primary.checkout {
    width: 100% !important;
    padding: 14px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

/* Hide discount code on payment step (already in cart) */
body.checkout-index-index .payment-option._collapsible {
    display: none !important;
}

/* === BILLING ADDRESS IN PAYMENT === */
body.checkout-index-index .billing-address-details {
    font-size: 14px !important;
    line-height: 1.6 !important;
}
body.checkout-index-index .action-edit-address,
body.checkout-index-index .action-update-address,
body.checkout-index-index .action-cancel {
    font-size: 13px !important;
}

/* === ACTIONS === */
body.checkout-index-index .actions-toolbar {
    margin-top: 16px !important;
    border: none !important;
    padding: 0 !important;
}

/* === MESSAGES === */
body.checkout-index-index .message {
    border-radius: 8px !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
}

/* === TOOLTIP === */
body.checkout-index-index .field-tooltip {
    position: relative !important;
    display: inline-block !important;
}
body.checkout-index-index .field-tooltip .field-tooltip-content {
    background: #1e293b !important;
    color: #fff !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
}

/* === LOADER === */
body.checkout-index-index .loading-mask .loader img {
    position: static !important;
}

/* === FOOTER === */
body.checkout-index-index .page-footer {
    background: #f1f5f9 !important;
    padding: 16px 0 !important;
    margin-top: 48px !important;
}
body.checkout-index-index .copyright {
    text-align: center !important;
    display: block !important;
    font-size: 13px !important;
    color: #64748b !important;
}

/* === RESPONSIVE === */
@media (max-width: 991px) {
    body.checkout-index-index .checkout-container {
        flex-direction: column !important;
    }
    body.checkout-index-index .opc-wrapper {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    body.checkout-index-index .opc-sidebar {
        flex: 0 0 100% !important;
        width: 100% !important;
        position: static !important;
        order: -1 !important;
    }
}
@media (max-width: 639px) {
    body.checkout-index-index .page-main {
        padding: 0 12px 24px !important;
    }
    body.checkout-index-index .checkout-shipping-address,
    body.checkout-index-index .checkout-shipping-method,
    body.checkout-index-index .checkout-payment-method,
    body.checkout-index-index .opc-block-summary {
        padding: 18px 16px !important;
        border-radius: 10px !important;
    }
    body.checkout-index-index .opc-progress-bar {
        max-width: 300px !important;
    }
}
