/* Корзина FlagRu — локальные стили поверх Bootstrap/layout */
#basket-page {
    --bp-text: #172033;
    --bp-muted: #6b7280;
    --bp-line: #e8ecf2;
    --bp-primary: #1a56db;
    --bp-primary-dark: #1546b5;
    --bp-accent: #d92d20;
    --bp-alt: #f5f7fa;
    --bp-radius: 18px;

    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px 72px;
    color: var(--bp-text);
    font-size: 15px;
    line-height: 1.5;
}

#basket-page *,
#basket-page *::before,
#basket-page *::after {
    box-sizing: border-box;
}

#basket-page a {
    text-decoration: none;
}

#basket-page button,
#basket-page input,
#basket-page select,
#basket-page textarea {
    font-family: inherit;
}

#basket-page .bp-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

#basket-page .bp-title {
    margin: 0;
    font-size: clamp(28px, 3.2vw, 38px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#basket-page .bp-subtitle {
    margin: 8px 0 0;
    color: var(--bp-muted);
    font-size: 14px;
}

#basket-page .bp-back {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--bp-text);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    transition: color 0.15s ease, transform 0.15s ease;
}

#basket-page .bp-back:hover {
    color: var(--bp-primary);
    transform: translateY(-1px);
}

#basket-page .bp-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-bottom: 22px;
    padding: 14px 18px;
    border-radius: 16px;
    background: #eef4ff;
    color: #1e3a8a;
    font-size: 13px;
}

#basket-page .bp-note strong {
    font-weight: 700;
}

#basket-page .bp-note span {
    white-space: nowrap;
}

#basket-page .bp-note-muted {
    color: #52627a;
    white-space: normal !important;
}

#basket-page .bp-list {
    overflow: hidden;
    border-radius: var(--bp-radius);
    background: #fff;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

#basket-page .bp-list-head,
#basket-page .bp-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 150px 120px 44px;
    gap: 18px;
    align-items: center;
}

#basket-page .bp-list-head {
    padding: 14px 22px;
    color: var(--bp-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#basket-page .bp-row {
    padding: 18px 22px;
    background: #fff;
    transition: background-color 0.15s ease;
}

#basket-page .bp-row--alt {
    background: var(--bp-alt);
}

#basket-page .bp-product {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

#basket-page .bp-thumb {
    display: flex;
    flex: 0 0 92px;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    padding: 6px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

#basket-page .bp-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#basket-page .bp-info {
    min-width: 0;
}

#basket-page .bp-name {
    display: inline-block;
    color: var(--bp-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

#basket-page .bp-name:hover {
    color: var(--bp-primary);
}

#basket-page .bp-variant {
    margin-top: 4px;
    color: var(--bp-muted);
    font-size: 13px;
}

#basket-page .bp-meta {
    margin-top: 6px;
    color: var(--bp-muted);
    font-size: 12px;
}

#basket-page .bp-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

#basket-page .bp-price-current {
    font-weight: 600;
    white-space: nowrap;
}

#basket-page .bp-price-old {
    color: #9aa3af;
    font-size: 12px;
    text-decoration: line-through;
    white-space: nowrap;
}

#basket-page .bp-qty {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 2px;
    padding: 4px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.09);
}

#basket-page .bp-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--bp-text);
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

#basket-page .bp-qty-btn:hover:not(:disabled) {
    background: var(--bp-primary);
    color: #fff;
}

#basket-page .bp-qty-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

#basket-page .bp-qty-input {
    width: 44px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bp-text);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

#basket-page .bp-qty-input::-webkit-outer-spin-button,
#basket-page .bp-qty-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

#basket-page .bp-total {
    color: var(--bp-accent);
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

#basket-page .bp-remove {
    display: flex;
    justify-content: flex-end;
}

#basket-page .bp-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9aa3af;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#basket-page .bp-remove-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

#basket-page .bp-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 24px;
    margin-top: 26px;
}

#basket-page .bp-options {
    display: grid;
    gap: 16px;
}

#basket-page .bp-card {
    padding: 22px;
    border-radius: var(--bp-radius);
    background: #fff;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

#basket-page .bp-card-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
}

#basket-page .bp-field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--bp-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#basket-page .bp-input,
#basket-page .bp-select,
#basket-page .bp-textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f3f5f8;
    color: var(--bp-text);
    font-size: 14px;
    outline: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#basket-page .bp-textarea {
    min-height: 96px;
    padding: 12px 14px;
    resize: vertical;
}

#basket-page .bp-input:focus,
#basket-page .bp-select:focus,
#basket-page .bp-textarea:focus {
    border-color: var(--bp-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

#basket-page .bp-delivery-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    color: var(--bp-muted);
    font-size: 14px;
}

#basket-page .bp-delivery-price strong {
    color: var(--bp-accent);
    font-size: 17px;
}

#basket-page .bp-promo-result {
    min-height: 20px;
    margin-top: 10px;
    color: #067647;
    font-size: 13px;
}

#basket-page .bp-promo-result.is-error {
    color: #b42318;
}

#basket-page .bp-summary {
    position: sticky;
    top: 20px;
    padding: 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

#basket-page .bp-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    color: var(--bp-muted);
    font-size: 14px;
}

#basket-page .bp-summary-row > span:last-child {
    color: var(--bp-text);
    font-weight: 600;
}

#basket-page .bp-summary-row--discount > span:last-child {
    color: #067647;
}

#basket-page .bp-summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px dashed var(--bp-line);
    font-size: 17px;
    font-weight: 700;
}

#basket-page .bp-summary-total strong {
    color: var(--bp-accent);
    font-size: 28px;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

#basket-page .bp-offer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 16px 0 0;
    color: var(--bp-muted);
    font-size: 12px;
    line-height: 1.5;
}

#basket-page .bp-offer input {
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: var(--bp-primary);
}

#basket-page .bp-offer a {
    color: var(--bp-primary);
}

#basket-page .bp-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 16px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: var(--bp-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

#basket-page .bp-checkout:hover {
    background: var(--bp-primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

#basket-page .bp-safe {
    margin-top: 12px;
    color: var(--bp-muted);
    font-size: 12px;
    text-align: center;
}

#basket-page .bp-empty {
    padding: 64px 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    text-align: center;
}

#basket-page .bp-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #eef4ff;
    color: var(--bp-primary);
}

#basket-page .bp-empty h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
}

#basket-page .bp-empty p {
    margin: 0;
    color: var(--bp-muted);
    font-size: 14px;
}

#basket-page .bp-empty .bp-checkout {
    max-width: 280px;
    margin: 20px auto 0;
}

#basket-page .bp-hidden {
    display: none;
}

/* Модальные окна внутри корзины */
#basket-page .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}

#basket-page .modal-header,
#basket-page .modal-footer {
    border: 0;
}

#basket-page .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 24px 26px 0;
}

#basket-page .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

#basket-page .modal-body {
    padding: 20px 26px;
}

#basket-page .modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 26px 24px;
}

#basket-page .modal-header .close {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f5f8;
    color: var(--bp-muted);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    opacity: 1;
    text-shadow: none;
    float: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#basket-page .modal-header .close span {
    display: block;
    line-height: 1;
    margin-top: -2px;
}

#basket-page .modal-header .close:hover,
#basket-page .modal-header .close:focus {
    background: #e8ecf2;
    color: var(--bp-text);
    opacity: 1;
    outline: none;
}

#basket-page .bp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

#basket-page .bp-field {
    margin-bottom: 14px;
}

#basket-page .bp-check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0;
    color: var(--bp-muted);
    font-size: 12px;
    line-height: 1.5;
}

#basket-page .bp-check-row input {
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: var(--bp-primary);
}

#basket-page .bp-check-row a {
    color: var(--bp-primary);
}

#basket-page .bp-modal-note {
    margin: 4px 0 12px;
    color: #b42318;
    font-size: 12px;
    line-height: 1.5;
}

#basket-page .bp-hint {
    margin: 8px 0 0;
    color: var(--bp-muted);
    font-size: 12px;
}

#basket-page .bp-modal-submit,
#basket-page .bp-modal-secondary {
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

#basket-page .bp-modal-submit {
    background: var(--bp-primary);
    color: #fff;
}

#basket-page .bp-modal-submit:hover {
    background: var(--bp-primary-dark);
    color: #fff;
}

#basket-page .bp-modal-secondary {
    background: #f3f5f8;
    color: var(--bp-text);
}

#basket-page .bp-modal-secondary:hover {
    background: #e8ecf2;
}

#basket-page .bp-spinner {
    width: 44px;
    height: 44px;
    margin: 6px auto 18px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--bp-primary);
    border-radius: 50%;
    animation: bp-spin 0.8s linear infinite;
}

@keyframes bp-spin {
    to { transform: rotate(360deg); }
}

#basket-page .bp-process-text {
    margin: 0;
    color: var(--bp-muted);
    font-size: 14px;
    text-align: center;
}

#basket-page .bp-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 4px auto 16px;
    border-radius: 50%;
    background: #ecfdf3;
    color: #067647;
    font-size: 30px;
}

@media (max-width: 1040px) {
    #basket-page .bp-list-head,
    #basket-page .bp-row {
        grid-template-columns: minmax(0, 1fr) 100px 140px 110px 40px;
        gap: 14px;
    }

    #basket-page .bp-bottom {
        grid-template-columns: minmax(0, 1fr) 330px;
    }
}

@media (max-width: 900px) {
    #basket-page .bp-list-head {
        display: none;
    }

    #basket-page .bp-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "product remove"
            "price qty"
            "total total";
        gap: 12px 16px;
        padding: 16px;
    }

    #basket-page .bp-product { grid-area: product; }
    #basket-page .bp-price {
        grid-area: price;
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
    }
    #basket-page .bp-qty {
        grid-area: qty;
        justify-self: end;
    }
    #basket-page .bp-total {
        grid-area: total;
        padding-top: 2px;
        text-align: left;
    }
    #basket-page .bp-total::before {
        content: "Сумма: ";
        color: var(--bp-muted);
        font-size: 13px;
        font-weight: 500;
    }
    #basket-page .bp-remove { grid-area: remove; }

    #basket-page .bp-bottom {
        grid-template-columns: 1fr;
    }

    #basket-page .bp-summary {
        position: static;
    }
}

@media (max-width: 600px) {
    #basket-page {
        padding: 24px 12px 48px;
    }

    #basket-page .bp-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #basket-page .bp-thumb {
        flex-basis: 76px;
        width: 76px;
        height: 76px;
        border-radius: 12px;
    }

    #basket-page .bp-product {
        align-items: flex-start;
        gap: 12px;
    }

    #basket-page .bp-name {
        font-size: 14px;
    }

    #basket-page .bp-qty-btn {
        width: 32px;
        height: 32px;
    }

    #basket-page .bp-qty-input {
        width: 38px;
    }

    #basket-page .bp-summary-total strong {
        font-size: 24px;
    }

    #basket-page .bp-form-grid {
        grid-template-columns: 1fr;
    }

    #basket-page .modal-header {
        padding: 20px 20px 0;
    }

    #basket-page .modal-body {
        padding: 16px 20px;
    }

    #basket-page .modal-footer {
        padding: 0 20px 20px;
    }

    #basket-page .bp-note {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}