.page-main {
    padding-bottom: calc(var(--nav-height) + 16px);
}

.page-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 12px 10px;
}

.page-header-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.page-subtitle--desktop {
    display: none;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.favorites-clear-btn {
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-light);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
}

.favorites-clear-btn:hover {
    color: var(--danger);
    border-color: rgba(231, 76, 60, 0.45);
    background: #fff;
}

.favorites-clear-btn[hidden] {
    display: none;
}

.page-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 8px;
    width: 100%;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fav-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    background: var(--card-bg);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}

.fav-card:active {
    transform: scale(0.995);
}

.fav-card-media {
    position: relative;
    flex-shrink: 0;
    width: 88px;
    height: 88px;
}

.fav-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    background: #f0ebe5;
    display: block;
}

.fav-card-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--danger);
    color: #fff;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    z-index: 2;
    line-height: 1.3;
}

.fav-card-favorite {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 32px;
    height: 32px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    z-index: 3;
    transition: transform 0.15s;
}

.fav-card-favorite:active {
    transform: scale(0.92);
}

.fav-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 2px;
}

.fav-card-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    padding-right: 8px;
}

.fav-card-weight {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.4;
}

.fav-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.fav-card-prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.fav-card-prices .old-price {
    font-size: 12px;
    color: var(--text-light);
    text-decoration: line-through;
}

.fav-card-prices .current-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.favorites-empty {
    text-align: center;
    color: var(--text-light);
    padding: 48px 24px 56px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin: 4px 4px 0;
}

.favorites-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.favorites-empty h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 8px;
}

.favorites-empty p {
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 22px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.favorites-empty-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.favorites-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 13px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s, transform 0.15s;
    min-width: 200px;
}

.favorites-empty-btn:hover {
    background: var(--primary-dark);
}

.favorites-empty-btn:active {
    transform: scale(0.98);
}

.favorites-empty-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.favorites-empty-link:hover {
    color: var(--primary);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: #fff;
    border-top: 1px solid #e8e8e8;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 80;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    padding: 0 4px;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    color: #999;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 0;
    position: relative;
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.bottom-nav .nav-item svg {
    width: 22px;
    height: 22px;
    stroke: #999;
    stroke-width: 2;
    fill: none;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-item.active svg {
    stroke: var(--primary);
    fill: var(--primary);
}

.bottom-nav .nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(calc(50% + 12px));
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.bottom-nav .nav-item .nav-label {
    font-size: 9px;
    line-height: 1.2;
}

.bottom-nav .nav-item .nav-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    :root {
        --nav-height: 58px;
        --header-height: 60px;
    }

    .page-header {
        padding: 14px 10px 8px;
    }

    .section-title {
        font-size: 20px;
    }

    .page-content {
        padding: 0 6px;
    }

    .fav-card {
        border-radius: 16px;
        padding: 9px;
        gap: 10px;
    }

    .fav-card-media {
        width: 76px;
        height: 76px;
    }

    .fav-card-image {
        border-radius: 12px;
    }

    .fav-card-name {
        font-size: 14px;
    }

    .fav-card-prices .current-price {
        font-size: 16px;
    }

    .favorites-empty {
        padding: 40px 18px 48px;
        border-radius: 16px;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }

    .page-main {
        padding-bottom: 24px;
    }

    .page-header {
        padding: 24px 20px 14px;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 20px;
    }

    .page-header-actions {
        margin-top: 0;
        flex-shrink: 0;
        justify-content: flex-end;
    }

    .page-subtitle--mobile {
        display: none;
    }

    .page-subtitle--desktop {
        display: block;
        margin-top: 0;
        font-size: 15px;
        font-weight: 600;
        color: var(--secondary);
        text-align: right;
        white-space: nowrap;
    }

    .page-content {
        padding: 0 20px;
    }

    .favorites-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 18px;
    }

    .fav-card {
        flex-direction: column;
        padding: 0;
        gap: 0;
        border-radius: 20px;
        overflow: hidden;
    }

    .fav-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

    .fav-card:active {
        transform: translateY(-2px);
    }

    .fav-card-media {
        width: 100%;
        height: 180px;
    }

    .fav-card-image {
        border-radius: 0;
        height: 180px;
    }

    .fav-card-badge {
        top: 12px;
        left: 12px;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
    }

    .fav-card-favorite {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }

    .fav-card-body {
        padding: 14px 16px 16px;
        gap: 4px;
    }

    .fav-card-name {
        font-size: 16px;
        min-height: 2.6em;
        padding-right: 0;
    }

    .fav-card-weight {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .fav-card-footer {
        padding-top: 0;
    }

    .fav-card-prices .old-price {
        font-size: 14px;
    }

    .fav-card-prices .current-price {
        font-size: 19px;
    }
}

@media (min-width: 1100px) {
    .favorites-list {
        grid-template-columns: repeat(4, 1fr);
    }
}
