/* Личный кабинет FlagRu — карточки в стиле новой корзины */

#lk-page {
    --lk-text: #172033;
    --lk-muted: #6b7280;
    --lk-line: #e8ecf2;
    --lk-primary: #1a56db;
    --lk-primary-dark: #1546b5;
    --lk-accent: #d51932;
    --lk-alt: #f5f7fa;
    --lk-radius: 20px;

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

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

#lk-page.lk-page--history-head {
    padding-bottom: 24px;
}

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

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

#lk-page .lk-eyebrow {
    margin-bottom: 10px;
    color: var(--lk-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

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

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

#lk-page .lk-back {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--lk-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;
}

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

#lk-page .lk-head-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

#lk-page .lk-logout {
    background: #fff1f2;
    color: #9f1239;
    box-shadow: 0 6px 20px rgba(159, 18, 57, 0.08);
}

#lk-page .lk-logout:hover {
    color: #7f1d1d;
    background: #ffe4e6;
}

#lk-page .lk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

#lk-page .lk-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 186px;
    padding: 20px;
    overflow: hidden;
    border-radius: var(--lk-radius);
    background: #fff;
    color: var(--lk-text);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#lk-page .lk-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.11);
}

#lk-page .lk-card-art {
    display: flex;
    flex: 0 0 170px;
    align-items: center;
    justify-content: center;
    width: 170px;
    height: 146px;
    overflow: hidden;
    border-radius: 16px;
    background: #f8faff;
}

#lk-page .lk-card-art svg {
    display: block;
    width: 100%;
    height: 100%;
}

#lk-page .lk-card-body {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 26px;
}

#lk-page .lk-card-title {
    display: block;
    margin-bottom: 7px;
    color: var(--lk-text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

#lk-page .lk-card-text {
    display: block;
    max-width: 280px;
    color: var(--lk-muted);
    font-size: 13px;
    line-height: 1.45;
}

#lk-page .lk-card-meta {
    display: inline-flex;
    margin-top: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--lk-primary);
    font-size: 12px;
    font-weight: 700;
}

#lk-page .lk-card--products .lk-card-meta {
    background: #fff1f2;
    color: #b91c3c;
}

#lk-page .lk-card--addresses .lk-card-meta {
    background: #f5f7fa;
    color: #3f4b5f;
}

#lk-page .lk-card--profile .lk-card-meta {
    background: #ecfdf3;
    color: #166534;
}

#lk-page .lk-card-arrow {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eef4ff;
    color: var(--lk-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

#lk-page .lk-card:hover .lk-card-arrow {
    transform: translateX(2px);
    background: #e3edff;
}

#lk-page .lk-section-title {
    margin: 0 0 16px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.015em;
}

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

#lk-page .lk-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#lk-page .lk-address-card {
    padding: 18px;
    border-radius: 16px;
    background: var(--lk-alt);
}

#lk-page .lk-address-card:nth-child(even) {
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

#lk-page .lk-address-city {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

#lk-page .lk-address-line {
    margin: 3px 0;
    color: var(--lk-muted);
    font-size: 13px;
}

#lk-page .lk-empty {
    padding: 28px;
    border-radius: 16px;
    background: var(--lk-alt);
    color: var(--lk-muted);
    text-align: center;
}

#lk-page .lk-purchased-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#lk-page .lk-purchased-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 14px;
    border-radius: 16px;
    background: var(--lk-alt);
}

#lk-page .lk-purchased-card:nth-child(even) {
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

#lk-page .lk-purchased-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 116px;
    width: 116px;
    height: 100px;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
}

#lk-page .lk-purchased-image img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#lk-page .lk-purchased-no-image {
    color: var(--lk-muted);
    font-size: 11px;
    text-align: center;
}

#lk-page .lk-purchased-body {
    min-width: 0;
}

#lk-page .lk-purchased-name {
    display: block;
    color: var(--lk-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.15s ease;
}

#lk-page .lk-purchased-name:hover {
    color: var(--lk-accent);
}

#lk-page .lk-purchased-class {
    display: inline-flex;
    margin-top: 7px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--lk-primary);
    font-size: 11px;
    font-weight: 700;
}

#lk-page .lk-purchased-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
    color: var(--lk-muted);
    font-size: 11px;
}

#lk-page .lk-purchased-price strong {
    color: var(--lk-accent);
    font-size: 16px;
    font-weight: 700;
}

#lk-page .lk-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
}

#lk-page .lk-pagination--top {
    margin-top: 0;
    margin-bottom: 16px;
}

#lk-page .lk-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 9px;
    background: var(--lk-alt);
    color: var(--lk-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

#lk-page a.lk-pagination-link:hover {
    background: #e3edff;
    color: var(--lk-primary);
}

#lk-page .lk-pagination-link.is-current {
    background: var(--lk-primary);
    color: #fff;
}

#lk-page .lk-pagination-link.is-disabled {
    opacity: 0.4;
}

@media (max-width: 768px) {
    #lk-page .lk-purchased-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    #lk-page .lk-purchased-card {
        align-items: flex-start;
    }

    #lk-page .lk-purchased-image {
        flex-basis: 96px;
        width: 96px;
        height: 88px;
    }
}

#lk-page .lk-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#lk-page .lk-data-item {
    padding: 18px;
    border-radius: 16px;
    background: var(--lk-alt);
}

#lk-page .lk-data-item:nth-child(even) {
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

#lk-page .lk-data-label {
    margin-bottom: 6px;
    color: var(--lk-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#lk-page .lk-data-value {
    color: var(--lk-text);
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

#lk-page .lk-data-note {
    margin: 18px 0 0;
    color: var(--lk-muted);
    font-size: 12px;
}

/* Локальное меню кабинета */
.lk-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin: 0 0 24px;
    padding: 6px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.07);
}

.lk-nav-link {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    color: #52627a;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.lk-nav-link:hover {
    background: #f5f7fa;
    color: #1a56db;
    text-decoration: none;
}

.lk-nav-link.is-active {
    background: #eef4ff;
    color: #1a56db;
}

.lk-nav-icon {
    display: inline-flex;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.lk-nav-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

#lk-page .lk-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
}

#lk-page .lk-message--error {
    background: #fff1f2;
    color: #9f1239;
}

#lk-page .lk-message--success {
    background: #ecfdf3;
    color: #166534;
}

#lk-page .lk-order-list {
    display: grid;
    gap: 16px;
}

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

#lk-page .lk-order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--lk-line);
}

#lk-page .lk-order-number {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

#lk-page .lk-order-date {
    margin-top: 4px;
    color: var(--lk-muted);
    font-size: 13px;
}

#lk-page .lk-order-side {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
}

#lk-page .lk-order-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f5f7fa;
    color: #52627a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

#lk-page .lk-order-status--new {
    background: #eef4ff;
    color: var(--lk-primary);
}

#lk-page .lk-order-status--processing {
    background: #fff7ed;
    color: #9a3412;
}

#lk-page .lk-order-status--shipped {
    background: #eff6ff;
    color: #1d4ed8;
}

#lk-page .lk-order-status--issued {
    background: #ecfdf3;
    color: #166534;
}

#lk-page .lk-order-status--canceled {
    background: #fff1f2;
    color: #9f1239;
}

#lk-page .lk-order-sum {
    color: var(--lk-text);
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

#lk-page .lk-order-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

#lk-page .lk-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px;
    border-radius: 12px;
    background: var(--lk-alt);
}

#lk-page .lk-order-thumb {
    display: flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 4px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

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

#lk-page .lk-order-thumb-empty {
    color: var(--lk-muted);
    font-size: 20px;
    font-weight: 700;
}

#lk-page .lk-order-item-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

#lk-page .lk-order-item-name {
    overflow: hidden;
    color: var(--lk-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#lk-page .lk-order-item-class {
    display: inline-flex;
    align-self: flex-start;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--lk-primary);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}

#lk-page .lk-order-item-price {
    color: var(--lk-muted);
    font-size: 12px;
}

#lk-page .lk-order-empty-items {
    margin: 16px 0;
    color: var(--lk-muted);
    font-size: 13px;
}

#lk-page .lk-order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--lk-line);
}

#lk-page .lk-order-delivery {
    color: var(--lk-muted);
    font-size: 13px;
}

#lk-page .lk-repeat {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: #eef4ff;
    color: var(--lk-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#lk-page .lk-repeat:hover {
    background: #e3edff;
    transform: translateY(-1px);
}

#lk-page .lk-repeat[disabled] {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

#lk-page .lk-empty a {
    color: var(--lk-primary);
    font-weight: 600;
}

@media (max-width: 980px) {
    #lk-page .lk-card-art {
        flex-basis: 145px;
        width: 145px;
        height: 130px;
    }

    #lk-page .lk-card-title {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    #lk-page {
        padding: 24px 16px 48px;
    }

    .lk-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .lk-nav-link {
        justify-content: flex-start;
        padding: 0 10px;
        white-space: normal;
    }

    #lk-page .lk-data-grid {
        grid-template-columns: 1fr;
    }

    #lk-page .lk-head {
        align-items: flex-start;
        flex-direction: column;
    }

    #lk-page .lk-back {
        display: none;
    }

    #lk-page .lk-head-actions .lk-logout {
        display: inline-flex;
    }

    #lk-page .lk-grid,
    #lk-page .lk-address-grid {
        grid-template-columns: 1fr;
    }

    #lk-page .lk-card {
        min-height: 0;
        padding: 18px;
    }

    #lk-page .lk-card-art {
        flex-basis: 132px;
        width: 132px;
        height: 120px;
    }
}

@media (max-width: 520px) {
    #lk-page .lk-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    #lk-page .lk-card-art {
        flex-basis: auto;
        width: 100%;
        height: 142px;
    }

    #lk-page .lk-card-body {
        padding-right: 24px;
    }

    #lk-page .lk-card-text {
        max-width: none;
    }

    #lk-page .lk-order-head,
    #lk-page .lk-order-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    #lk-page .lk-order-side {
        align-items: flex-start;
    }

    #lk-page .lk-repeat {
        width: 100%;
    }
}

/* Адреса: добавление, редактирование и удаление */
#lk-page .lk-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

#lk-page .lk-alert strong {
    font-weight: 700;
}

#lk-page .lk-alert ul {
    margin: 7px 0 0;
    padding-left: 18px;
}

#lk-page .lk-alert--success {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #166534;
}

#lk-page .lk-alert--error {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #9f1239;
}

#lk-page .lk-address-form-panel {
    margin: 18px 0 0;
    padding: 18px;
    border: 1px solid var(--lk-line);
    border-radius: 16px;
    background: var(--lk-alt);
}

#lk-page .lk-address-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

#lk-page .lk-address-form-head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}

#lk-page .lk-address-form-head p {
    margin: 5px 0 0;
    color: var(--lk-muted);
    font-size: 13px;
}

#lk-page .lk-form-cancel {
    flex: 0 0 auto;
    color: var(--lk-muted);
    font-size: 12px;
    font-weight: 600;
}

#lk-page .lk-form-cancel:hover {
    color: var(--lk-accent);
}

#lk-page .lk-address-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#lk-page .lk-field {
    display: block;
    min-width: 0;
}

#lk-page .lk-field > span {
    display: block;
    margin-bottom: 6px;
    color: var(--lk-muted);
    font-size: 12px;
    font-weight: 600;
}

#lk-page .lk-field > span em {
    color: var(--lk-accent);
    font-style: normal;
}

#lk-page .lk-input {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--lk-line);
    border-radius: 10px;
    background: #fff;
    color: var(--lk-text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#lk-page .lk-input:focus {
    border-color: #9db8ff;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

#lk-page .lk-address-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

#lk-page .lk-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#lk-page .lk-button:hover {
    transform: translateY(-1px);
}

#lk-page .lk-button--primary {
    background: var(--lk-primary);
    color: #fff;
}

#lk-page .lk-button--primary:hover {
    background: var(--lk-primary-dark);
}

#lk-page .lk-button--ghost {
    background: #fff;
    color: var(--lk-muted);
    box-shadow: inset 0 0 0 1px var(--lk-line);
}

#lk-page .lk-button--ghost:hover {
    color: var(--lk-accent);
}

#lk-page .lk-address-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--lk-line);
}

#lk-page .lk-address-actions form {
    margin: 0;
}

#lk-page .lk-address-action {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--lk-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

#lk-page .lk-address-action:hover {
    color: var(--lk-primary-dark);
}

#lk-page .lk-address-action--danger {
    color: var(--lk-muted);
}

#lk-page .lk-address-action--danger:hover {
    color: var(--lk-accent);
}

@media (max-width: 768px) {
    #lk-page .lk-address-form-head {
        flex-direction: column;
    }

    #lk-page .lk-address-form-grid {
        grid-template-columns: 1fr;
    }
}
