/* =====================================================
   USER HOME
   Bám giao diện home cũ banchuasach, dùng biến từ shared
===================================================== */

:root {
    --home-primary: var(--user-blue);
    --home-primary-soft: var(--user-blue-light);
    --home-gold: var(--user-gold);
    --home-yellow: #f7d85b;
    --home-bg: #fbf9f5;
    --home-surface: var(--user-bg-soft);
    --home-white: #fff;
    --home-text: var(--user-text);
    --home-muted: var(--user-muted);
    --home-border: var(--user-border);
    --home-border-soft: #eee4d2;
    --home-shadow: 0 10px 26px rgba(0, 32, 69, 0.07);
}

body.user-page {
    background: var(--home-bg);
}

.home-banner {
    width: 100%;
    height: 480px;
    overflow: hidden;
    background: #efe8da;
    border-bottom: 1px solid var(--home-border);
}

.home-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.home-search-section {
    padding: 16px 0 32px;
    background: var(--home-surface);
}

.home-search-wrap {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.home-search-wrap h2 {
    margin: 0 0 10px;
    color: var(--home-primary);
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.home-search-form {
    padding: 7px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 10px;
    background: var(--home-white);
    border: 1px solid var(--home-border);
    border-radius: 8px;
    box-shadow: var(--home-shadow);
}

.home-search-input {
    min-height: 42px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.home-search-input .material-symbols-outlined {
    color: #7d8590;
    font-size: 17px;
    font-weight: 250;
}

.home-search-input input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--home-text);
    font-family: inherit;
    font-size: 12px;
}

.home-search-input input::placeholder {
    color: #9ca3af;
}

.home-search-form button {
    border: 0;
    border-radius: 6px;
    background: var(--home-primary);
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.18s ease;
}

.home-search-form button:hover {
    background: var(--home-gold);
}

.home-search-filter {
    margin-top: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
}

.home-search-filter label {
    color: #5f6875;
    font-size: 11px;
    font-weight: 450;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-search-filter input {
    accent-color: var(--home-primary);
}

.home-section-head,
.home-new-books-head {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.home-section-head span {
    display: block;
    color: var(--home-gold);
    font-size: 10.5px;
    font-weight: 600;
}

.home-section-head h2,
.home-new-books-head h2 {
    margin: 3px 0 0;
    color: var(--home-text);
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.home-new-books-head h2 {
    color: var(--home-primary);
    font-weight: 650;
}

.home-new-books-head p {
    margin: 5px 0 0;
    color: var(--home-muted);
    font-size: 11.5px;
}

.home-section-head > a,
.home-new-books-head a {
    color: var(--home-gold);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.home-new-books-head a {
    font-size: 11px;
    font-weight: 600;
}

.home-section-head > a:hover,
.home-new-books-head a:hover {
    color: var(--home-primary);
}

.home-section-head .material-symbols-outlined,
.home-new-books-head .material-symbols-outlined {
    color: currentColor;
    font-size: 16px;
    font-weight: 250;
}

.home-search-result-section {
    padding: 38px 0 24px;
    background: #fffdf7;
    border-bottom: 1px solid rgba(222, 211, 189, 0.65);
}

.home-search-result-list {
    display: grid;
    gap: 11px;
}

.home-search-result-card {
    padding: 11px;
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) 36px;
    gap: 13px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 32, 69, 0.045);
    text-decoration: none;
    transition: 0.18s ease;
}

.home-search-result-card:hover {
    border-color: rgba(0, 32, 69, 0.24);
    transform: translateY(-2px);
}

.search-result-cover {
    width: 66px;
    height: 86px;
    overflow: hidden;
    border-radius: 9px;
    background: #eee6d4;
}

.search-result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info > span {
    display: inline-block;
    color: var(--home-gold);
    font-size: 10px;
    font-weight: 600;
}

.search-result-info h3 {
    margin: 3px 0 0;
    color: var(--home-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.search-result-info p {
    margin: 3px 0 0;
    color: #727b88;
    font-size: 10.5px;
}

.search-result-info div {
    margin-top: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.search-result-info small {
    color: #5d6674;
    font-size: 10px;
}

.search-result-action {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f3ead4;
    color: var(--home-gold);
}

.search-result-action .material-symbols-outlined {
    font-size: 18px;
    font-weight: 250;
}

.home-new-books {
    padding: 22px 0 26px;
    background: var(--home-bg);
}

.home-new-books-head {
    margin-bottom: 16px;
}

.home-new-books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.home-new-book-card {
    min-width: 0;
    padding: 10px;
    display: block;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(0, 32, 69, 0.055);
    transition: 0.18s ease;
}

.home-new-book-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 32, 69, 0.25);
    box-shadow: 0 12px 28px rgba(0, 32, 69, 0.09);
}

.home-new-book-cover {
    height: 200px;
    padding: 6px;
    overflow: hidden;
    border-radius: 8px;
    background: #f4efe3;
    border: 1px solid #e4d8c0;
}

.home-new-book-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.home-new-book-info {
    padding: 11px 2px 2px;
}

.home-new-book-info span {
    margin-bottom: 5px;
    display: block;
    color: var(--home-gold);
    font-size: 9.8px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-new-book-info h3 {
    min-height: 32px;
    margin: 0;
    color: var(--home-text);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-new-book-info p {
    margin: 6px 0 0;
    color: #727b88;
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-new-books-empty,
.home-empty {
    grid-column: 1 / -1;
    min-height: 130px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    background: #fffdf7;
    border: 1px dashed #d8cbb2;
    border-radius: 12px;
    color: #7b8490;
    text-align: center;
}

.home-empty {
    min-height: 120px;
    padding: 28px;
    border-radius: 14px;
}

.home-new-books-empty .material-symbols-outlined,
.home-empty .material-symbols-outlined {
    color: var(--home-gold);
    font-size: 34px;
    font-weight: 250;
}

.home-empty .material-symbols-outlined {
    font-size: 30px;
}

.home-new-books-empty p,
.home-empty p {
    margin: 0;
    font-size: 11.5px;
}

.home-service-section {
    padding: 0 0 58px;
    background: var(--home-bg);
}

.home-service-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(0, 32, 69, 0.06);
}

.home-service-main {
    min-height: 230px;
    padding: 32px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background:
        linear-gradient(135deg, rgba(0, 32, 69, 0.96), rgba(7, 55, 99, 0.94)),
        var(--home-primary);
}

.home-service-main > span {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--home-yellow);
    font-size: 25px;
    font-weight: 240;
}

.home-service-main h2 {
    margin: 2px 0 10px;
    color: #fff;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.home-service-main p {
    max-width: 500px;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    line-height: 1.6;
}

.home-service-list {
    display: grid;
    grid-template-columns: 1fr;
    background: #fffdf8;
}

.home-service-item {
    min-height: 76px;
    padding: 22px 28px;
    border-bottom: 1px solid rgba(222, 211, 189, 0.7);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.home-service-item:last-child {
    border-bottom: 0;
}

.home-service-item > span {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f1e6c9;
    color: var(--home-gold);
    font-size: 21px;
    font-weight: 250;
}

.home-service-item h3 {
    margin: 0 0 5px;
    color: var(--home-primary);
    font-size: 12.5px;
    font-weight: 650;
}

.home-service-item p {
    margin: 0;
    color: var(--home-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

@media (max-width: 1000px) {
    .home-new-books-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .home-service-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .home-banner {
        height: 220px;
    }

    .home-search-section {
        padding: 14px 0 26px;
    }

    .home-search-wrap h2 {
        font-size: 16px;
    }

    .home-search-form {
        grid-template-columns: 1fr;
    }

    .home-search-form button {
        min-height: 44px;
    }

    .home-search-filter {
        justify-content: flex-start;
        gap: 12px;
    }

    .home-section-head,
    .home-new-books-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .home-new-books {
        padding: 18px 0 22px;
    }

    .home-new-books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .home-new-book-cover {
        height: 180px;
    }

    .home-search-result-card {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .search-result-cover {
        width: 56px;
        height: 76px;
    }

    .search-result-action {
        display: none;
    }

    .home-service-main {
        padding: 26px 22px;
        flex-direction: column;
    }

    .home-service-item {
        padding: 18px 20px;
    }
}

@media (max-width: 480px) {
    .home-new-books-grid {
        grid-template-columns: 1fr;
    }

    .home-new-book-cover {
        height: 230px;
    }
}

.home-banner {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    background: #efe8da;
    border-bottom: 1px solid var(--home-border);
}

.home-banner-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.home-banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

.home-banner-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.home-banner-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.home-banner-slide img.is-loaded {
    animation: homeBannerZoom 7s ease forwards;
}

.home-banner-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    background: rgba(0, 32, 69, 0.45);
    color: #ffffff;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    cursor: pointer;
    transition: 0.18s ease;
}

.home-banner-nav:hover {
    background: rgba(0, 32, 69, 0.75);
    border-color: #ffffff;
}

.home-banner-nav .material-symbols-outlined {
    font-size: 24px;
    font-weight: 250;
}

.home-banner-nav.is-prev {
    left: 18px;
}

.home-banner-nav.is-next {
    right: 18px;
}

.home-banner-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transform: translateX(-50%);
}

.home-banner-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    cursor: pointer;
    transition: 0.18s ease;
}

.home-banner-dots button.is-active {
    width: 22px;
    background: #ffffff;
}

@keyframes homeBannerZoom {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.035);
    }
}

@media (max-width: 992px) {
    .home-banner {
        height: 380px;
    }
}

@media (max-width: 768px) {
    .home-banner {
        height: 300px;
    }

    .home-banner-nav {
        width: 32px;
        height: 32px;
    }

    .home-banner-nav.is-prev {
        left: 10px;
    }

    .home-banner-nav.is-next {
        right: 10px;
    }
}

@media (max-width: 576px) {
    .home-banner {
        height: 240px;
    }

    .home-banner-dots {
        bottom: 10px;
    }
}
/* =====================================================
   CLEAN RESPONSIVE PATCH - USER HOME
===================================================== */
.home-page,
.home-page * {
    min-width: 0;
}

@media (max-width: 992px) {
    .home-hero-grid,
    .home-section-grid,
    .home-map-grid,
    .home-feature-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .home-page {
        padding-top: 12px;
    }

    .home-hero-actions,
    .home-section-head,
    .home-search-form {
        align-items: stretch !important;
        grid-template-columns: 1fr !important;
        flex-direction: column !important;
    }

    .home-hero-actions a,
    .home-search-form button,
    .home-search-form input {
        width: 100% !important;
    }
}

/* =====================================================
   CLEAN MOBILE OVERFLOW GUARD
===================================================== */
@media (max-width: 640px) {
    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }
}

/* =====================================================
   RESPONSIVE - SÁCH MỚI CẬP NHẬT
   Cho mô tả + Xem tất cả nằm cùng 1 hàng trên mobile
===================================================== */

@media (max-width: 640px) {
    .home-new-books-head {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: end !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }

    .home-new-books-head > div {
        min-width: 0 !important;
    }

    .home-new-books-head h2 {
        margin: 0 0 6px !important;
        font-size: 22px !important;
        line-height: 1.2 !important;
    }

    .home-new-books-head p {
        margin: 0 !important;
        max-width: 100% !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .home-new-books-head a {
        margin: 0 0 1px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .home-new-books-head a .material-symbols-outlined {
        font-size: 17px !important;
    }
}