/**
 * Checkout page styles (proces zamawiania).
 * Loaded via @section('page-styles') only on checkout page.
 */

/* ===== Checkout header ===== */
.checkout-header {
    background: #232f3e;
    padding: 12px 0;
}

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

.checkout-logo {
    text-decoration: none;
}

.checkout-header-phone {
    color: #fff;
    font-size: 14px;
}

.checkout-header-phone a {
    color: #febd69;
    font-weight: 600;
    text-decoration: none;
}

.checkout-header-phone a:hover {
    text-decoration: underline;
}

.checkout-header-phone-label {
    margin-right: 4px;
}

/* ===== Hero section compact ===== */
#checkout #hero_section {
    min-height: auto !important;
    padding: 16px 0 !important;
}

#checkout #hero_section h1 {
    font-size: 1.5rem;
    margin: 0;
}

/* ===== Grid layout ===== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
    padding: 24px 0;
}

/* ===== Checkout steps (accordion) ===== */
.checkout-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.checkout-step {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: -1px;
    background: #fff;
    overflow: hidden;
}

.checkout-step:first-child {
    border-radius: 4px 4px 0 0;
}

.checkout-step:last-child,
.checkout-step:last-of-type {
    border-radius: 0 0 4px 4px;
}

/* Step header */
.step-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    background: #fff;
    user-select: none;
}

.step--completed .step-header {
    cursor: pointer;
}

.step--completed .step-header:hover {
    background: #fafafa;
}

/* Step indicator (number circle / checkmark) */
.step-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    background: #e5e5e5;
    color: #666;
    transition: background 0.2s, color 0.2s;
}

.step--active .step-indicator {
    background: #232f3e;
    color: #fff;
}

.step--completed .step-indicator {
    background: #2e7d32;
    color: #fff;
    font-size: 0;
}

.step--completed .step-indicator::after {
    content: "\2713";
    font-size: 16px;
}

/* Step title */
.step-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.step--disabled .step-title {
    color: #999;
}

/* Step edit link */
.step-edit {
    font-size: 14px;
    color: #888;
    display: none;
    cursor: pointer;
}

.step-edit:hover {
    color: #333;
    text-decoration: underline;
}

.step--completed .step-edit {
    display: inline;
}

/* Step content (collapse/expand) */
.step-content {
    display: none;
    padding: 0 20px 20px;
}

.step--active .step-content {
    display: block;
}

/* Step actions */
.step-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.step-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== Form layout ===== */
.checkout-step .fieldset {
    width: 100%;
}

.checkout-step .form-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checkout-step .fields {
    margin-bottom: 16px;
}

/* Flex row for fields side by side */
.checkout-step .df {
    display: flex;
}

.checkout-step .fd-r {
    flex-direction: row;
}

.checkout-step .fw-w {
    flex-wrap: wrap;
}

.checkout-step .jc-sb {
    justify-content: space-between;
}

/* All form rows use 2-column layout: grid-7 + grid-7 */
.checkout-step .grid-7 { width: 49%; min-width: 0; }

/* Nested Kod + Miasto inside the right grid-7 column */
.checkout-step .checkout-code-city {
    gap: 12px;
}

.checkout-step .checkout-field-code {
    width: 35%;
    min-width: 0;
    flex-shrink: 0;
}

.checkout-step .checkout-field-city {
    flex: 1;
    min-width: 0;
}

/* Fix inline styles from form.blade.php */
.checkout-step .fields.mb-20px {
    margin-bottom: 16px !important;
}

.checkout-step .w-100i {
    width: 100% !important;
}

.checkout-step .pl-0 {
    padding-left: 0 !important;
}

.checkout-step label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
    text-align: left !important;
}

/* Float-left checkbox label (billing toggle) */
.checkout-step label.float-left {
    display: inline;
}

.checkout-step .form-control,
.checkout-step .m-input {
    width: 100% !important;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.checkout-step .form-control:focus {
    border-color: #232f3e;
    outline: none;
    box-shadow: 0 0 0 2px rgba(35, 47, 62, 0.1);
}

.checkout-step select.form-control,
.checkout-step select.m-input {
    appearance: auto;
    height: 42px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Ensure text inputs also have explicit height for consistency */
.checkout-step input.form-control,
.checkout-step input.m-input {
    height: 42px !important;
    box-sizing: border-box;
}

/* Billing address section */
.checkout-step .billingAddress {
    border-top: 1px solid #eee;
    padding-top: 16px;
    margin-top: 8px;
}

.checkout-step .billingAddress .legend {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px;
}

/* Checkbox styling */
.checkout-step input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

/* ===== Radio buttons (carriers/payments) ===== */
label.checkout-radio,
.checkout-radio {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    gap: 10px;
    width: 100%;
}

.checkout-radio:hover {
    border-color: #ccc;
    background: #fafafa;
}

.checkout-radio:has(.checkout-radio-input:checked) {
    border-color: #232f3e;
    background: #f8f9fa;
}

.checkout-radio-input {
    accent-color: #232f3e;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.checkout-radio-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.checkout-radio-price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

/* ===== Notes textarea ===== */
.checkout-notes {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.checkout-notes-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.checkout-notes-textarea {
    resize: vertical;
    min-height: 60px;
}

/* ===== Terms checkbox ===== */
.checkout-terms {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.checkout-terms-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 1.5;
}

.checkout-terms-input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #232f3e;
}

.checkout-terms-label a {
    color: #232f3e;
    font-weight: 600;
    text-decoration: underline;
}

.checkout-terms-label a:hover {
    color: #febd69;
}

/* ===== Buttons ===== */
/* Override theme.css .btn.btn-primary with higher specificity */
.checkout-continue,
.checkout-submit-btn,
button.checkout-continue,
button.checkout-submit-btn {
    padding: 12px 32px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    border: none !important;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

button.checkout-continue,
.checkout-continue {
    background: #232f3e !important;
    color: #fff !important;
}

button.checkout-continue:hover,
.checkout-continue:hover {
    background: #1a2332 !important;
}

button.checkout-submit-btn,
.checkout-submit-btn {
    background: #febd69 !important;
    color: #232f3e !important;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

button.checkout-submit-btn:hover,
.checkout-submit-btn:hover {
    background: #f0a93e !important;
}

/* ===== Sidebar ===== */
.checkout-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

/* Store info box */
.checkout-store-info {
    margin-top: 16px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
}

.checkout-store-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0a93e;
    color: #232323;
}

.checkout-store-info p {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.checkout-store-info p:last-child {
    margin-bottom: 0;
}

.checkout-store-info p svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #f0a93e;
}

.checkout-store-info a {
    color: #232323;
    text-decoration: none;
}

.checkout-store-info a:hover {
    color: #f0a93e;
}

.checkout-summary-card {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

/* Summary header (toggle) */
.checkout-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #eee;
}

.checkout-summary-header:hover {
    background: #fafafa;
}

.checkout-summary-count {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.checkout-summary-toggle-text {
    font-size: 13px;
    color: #666;
}

.checkout-summary-arrow {
    font-size: 10px;
    display: inline-block;
    transition: transform 0.2s;
}

.checkout-summary-arrow.is-open {
    transform: rotate(180deg);
}

/* Summary products list */
.checkout-summary-products {
    padding: 0 20px;
    max-height: 300px;
    overflow-y: auto;
    border-bottom: 1px solid #eee;
}

.checkout-summary-product {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
}

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

.checkout-summary-product-img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.checkout-summary-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.checkout-summary-product-info {
    flex: 1;
    min-width: 0;
}

.checkout-summary-product-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    display: block;
    line-height: 1.3;
}

.checkout-summary-product-name:hover {
    color: #c49a6c;
}

.checkout-summary-product-attr {
    display: block;
    font-size: 11px;
    color: #888;
    line-height: 1.4;
}

.checkout-summary-product-qty {
    font-size: 12px;
    color: #999;
}

.checkout-summary-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Summary totals */
.checkout-summary-totals {
    padding: 16px 20px;
}

.checkout-summary-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: #555;
}

.checkout-summary-total {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid #333;
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

/* Summary actions */
.checkout-summary-actions {
    padding: 0 20px 20px;
}

.checkout-summary-actions .checkout-submit-btn {
    display: block;
    width: 100%;
    text-align: center;
}

/* ===== Footer ===== */
.checkout-footer {
    background: #f8f8f8;
    border-top: 1px solid #eee;
}

.checkout-footer-bar {
    padding: 16px 0;
    text-align: center;
}

.checkout-footer-copyright {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* ===== Order Confirmation ===== */
.order-confirmation-header {
    text-align: center;
    padding: 40px 20px 24px;
}

.order-confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2e7d32;
    color: #fff;
    font-size: 32px;
    margin-bottom: 16px;
}

.order-confirmation-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
}

.order-confirmation-subtitle {
    font-size: 16px;
    color: #555;
    margin: 0 0 4px;
}

.order-confirmation-email {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Payment section */
.order-confirmation-payment {
    max-width: 700px;
    margin: 0 auto 24px;
    text-align: center;
}

.order-confirmation-payment-message {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 16px;
}

.order-confirmation-payment-message p {
    margin: 4px 0;
}

.order-confirmation-payment-action {
    margin-top: 16px;
}

/* Order items card */
.order-confirmation-card {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    padding: 20px;
    margin-bottom: 24px;
}

.order-confirmation-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px;
}

.order-confirmation-products {
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

.order-confirmation-product {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-confirmation-product:last-child {
    border-bottom: none;
}

.order-confirmation-product-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.order-confirmation-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.order-confirmation-product-info {
    flex: 1;
    min-width: 0;
}

.order-confirmation-product-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: block;
    line-height: 1.4;
}

.order-confirmation-product-attr {
    display: block;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.order-confirmation-product-qty {
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
}

.order-confirmation-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Totals */
.order-confirmation-totals {
    padding-top: 4px;
}

.order-confirmation-total-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: #555;
}

.order-confirmation-total-final {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid #333;
    font-size: 16px;
    color: #000;
}

/* Order details */
.order-confirmation-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.order-confirmation-detail-col {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    padding: 20px;
}

.order-confirmation-detail-col p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.order-confirmation-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-confirmation-detail-list li {
    font-size: 14px;
    color: #555;
    padding: 4px 0;
}

/* Actions */
.order-confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 0 0 40px;
}

.order-confirmation-btn-orders {
    padding: 12px 32px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    border: 2px solid #232f3e !important;
    background: transparent !important;
    color: #232f3e !important;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4 !important;
}

.order-confirmation-btn-orders:hover {
    background: #232f3e !important;
    color: #fff !important;
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-sidebar {
        position: static;
    }

    .checkout-step .grid-7 {
        width: 100%;
    }

    .checkout-step .df.fd-r {
        flex-direction: column;
        gap: 12px;
    }

    /* On mobile, Kod+Miasto stay side by side (they're narrow fields) */
    .checkout-step .checkout-code-city {
        flex-direction: row !important;
    }
}

@media (max-width: 767px) {
    .order-confirmation-details {
        grid-template-columns: 1fr;
    }

    .order-confirmation-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .order-confirmation-actions .btn {
        text-align: center;
    }
}

@media (max-width: 575px) {
    .checkout-header-phone-label {
        display: none;
    }

    .step-header {
        padding: 12px 16px;
    }

    .step-content {
        padding: 0 16px 16px;
    }

    .step-indicator {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .step-title {
        font-size: 1rem;
    }

    .checkout-continue,
    .checkout-submit-btn {
        width: 100%;
        text-align: center;
    }

    .step-actions {
        justify-content: center;
    }

    .checkout-summary-product-img {
        width: 40px;
        height: 40px;
    }
}
