@import url("ui-feedback.css");

.checkout-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checkout-summary-card,
.checkout-payment-card,
.checkout-done-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.checkout-card-title {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 600;
}

.checkout-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.checkout-table th,
.checkout-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.checkout-table th {
    background: #f1f5f9;
    font-weight: 600;
}

.checkout-total-label {
    text-align: right;
    font-weight: 600;
}

.checkout-total-value {
    font-weight: 700;
    color: var(--accent);
}

.checkout-qty-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

.checkout-qty-input {
    width: 72px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    text-align: center;
}

.checkout-qty-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.checkout-line-row.checkout-line-removed {
    opacity: 0.45;
}

.checkout-lines-empty {
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
}

.checkout-lines-empty.hidden {
    display: none;
}

.checkout-table.hidden {
    display: none;
}

.checkout-field-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}

.checkout-payment-hint {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.45;
}

.checkout-referral-panel {
    padding: 14px 16px;
    border: 1px solid #99f6e4;
    border-radius: 10px;
    background: #f0fdfa;
}

.checkout-referral-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.checkout-referral-text {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
}

.checkout-referral-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

a.checkout-referral-link {
    text-decoration: none;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checkout-inline-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.checkout-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.checkout-field input,
.checkout-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

.checkout-field input:focus,
.checkout-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.checkout-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.order-privacy-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.order-privacy-field {
    margin: 0;
}

.order-privacy-label {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: 10px;
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}

.order-privacy-label input[type="checkbox"] {
    margin: 2px 0 0;
    width: 18px;
    height: 18px;
    grid-column: 1;
    grid-row: 1;
}

.order-privacy-label-text {
    grid-column: 2;
    grid-row: 1;
}

.order-privacy-label a {
    color: var(--accent);
}

.checkout-btn-primary {
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.checkout-btn-primary:hover {
    background: #0d6b63;
}

.checkout-btn-secondary,
.checkout-link-btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.checkout-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 14px;
}

.checkout-error.hidden {
    display: none;
}

.checkout-done-card p {
    margin: 0 0 16px;
    line-height: 1.5;
}

.checkout-pickup-block {
    margin: 16px 0;
    padding: 14px 16px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
}

.checkout-pickup-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.checkout-pickup-address {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .checkout-inline-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .checkout-table {
        font-size: 13px;
    }

    .checkout-table th:nth-child(4),
    .checkout-table td:nth-child(4) {
        display: none;
    }
}
