/* Tài liệu IELTS — catalog & detail (scoped .doc-page) */
.doc-page {
    max-width: 1200px;
    margin: 0 auto;
}

.doc-hero-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.doc-page-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--color-page-title, #1a1a2e);
    margin: 0 0 0.5rem;
}

.doc-page-desc {
    color: var(--color-muted, #6b7280);
    font-size: 1rem;
    margin: 0 auto;
    max-width: 560px;
}

.doc-search-result {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    color: var(--color-muted, #6b7280);
}

/* Category pills & tag chips */
.doc-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.doc-pill {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text, #374151);
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.doc-pill:hover,
.doc-pill.active {
    background: var(--background-static, #b8195b);
    border-color: var(--background-static, #b8195b);
    color: #fff;
}

.doc-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.doc-chip {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--background-static, #b8195b);
    background: color-mix(in srgb, var(--background-static, #b8195b) 10%, transparent);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.doc-chip:hover,
.doc-chip.active {
    background: var(--background-static, #b8195b);
    color: #fff;
}

/* Layout */
.doc-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.doc-main {
    min-width: 0;
}

/* Featured */
.doc-featured {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow, 0 6px 18px rgba(18, 38, 63, 0.06));
    margin-bottom: 2rem;
    padding: 1.25rem;
}

.doc-featured-media {
    display: block;
    aspect-ratio: 400 / 550;
    overflow: hidden;
    border-radius: 8px;
}

.doc-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-featured-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.doc-featured-title {
    font-size: clamp(1.25rem, 3vw, 1.625rem);
    font-weight: 700;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.35;
}

.doc-featured-title a {
    color: inherit;
    text-decoration: none;
}

.doc-featured-title a:hover {
    color: var(--highlight, #f25587);
}

.doc-featured-desc {
    color: var(--color-muted, #6b7280);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Grid cards 400x550 */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.doc-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow, 0 6px 18px rgba(18, 38, 63, 0.06));
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(18, 38, 63, 0.1);
}

.doc-card-media {
    display: block;
    aspect-ratio: 400 / 550;
    overflow: hidden;
}

.doc-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-card-body {
    padding: 1rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.doc-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.375rem 0 0.5rem;
    line-height: 1.4;
}

.doc-card-title a {
    color: inherit;
    text-decoration: none;
}

.doc-card-title a:hover {
    color: var(--highlight, #f25587);
}

.doc-card-desc {
    color: var(--color-muted, #6b7280);
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 0.75rem;
    flex: 1;
}

/* Badge, price, read more */
.doc-badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--background-static, #b8195b);
    background: color-mix(in srgb, var(--background-static, #b8195b) 10%, transparent);
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.doc-badge:hover {
    background: var(--background-static, #b8195b);
    color: #fff;
}

.doc-badge-featured {
    background: #fef3c7;
    color: #b45309;
    margin-right: 0.375rem;
}

.doc-badge-sm {
    font-size: 0.6875rem;
    padding: 0.15rem 0.5rem;
}

.doc-card-price,
.doc-detail-price,
.doc-sticky-price {
    margin-bottom: 0.75rem;
}

.doc-price-sale {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--color-page-title, #1a1a2e);
}

.doc-price-regular {
    font-size: 0.875rem;
    color: var(--color-muted, #9ca3af);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.doc-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--highlight, #f25587);
    text-decoration: none;
    margin-top: auto;
}

.doc-read-more:hover {
    color: var(--background-static, #b8195b);
}

/* Empty state */
.doc-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow, 0 6px 18px rgba(18, 38, 63, 0.06));
}

.doc-empty i {
    font-size: 2.5rem;
    color: var(--color-muted, #9ca3af);
    display: block;
    margin-bottom: 1rem;
}

.doc-empty p {
    color: var(--color-muted, #6b7280);
    margin-bottom: 1rem;
}

/* Pagination */
.doc-page .pagination-numbered {
    margin-top: 1rem;
}

/* Sidebar */
.doc-sidebar {
    position: sticky;
    top: 1rem;
}

.doc-sidebar-block {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--card-shadow, 0 6px 18px rgba(18, 38, 63, 0.06));
}

.doc-sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--border, #e5e7eb);
    color: var(--color-page-title, #1a1a2e);
}

.doc-search-input-wrap {
    display: flex;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}

.doc-search-input {
    flex: 1;
    border: none;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    outline: none;
    min-width: 0;
}

.doc-search-btn {
    border: none;
    background: var(--background-static, #b8195b);
    color: #fff;
    padding: 0 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.doc-search-btn:hover {
    background: var(--highlight, #f25587);
}

.doc-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-category-list li {
    margin-bottom: 0.25rem;
}

.doc-category-list li a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--color-text, #374151);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.2s, color 0.2s;
}

.doc-category-list li a:hover,
.doc-category-list li.active a {
    background: color-mix(in srgb, var(--background-static, #b8195b) 10%, transparent);
    color: var(--background-static, #b8195b);
    font-weight: 600;
}

.doc-sidebar-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.doc-sidebar-chip {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--color-text, #374151);
    background: var(--border, #f3f4f6);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.doc-sidebar-chip:hover,
.doc-sidebar-chip.active {
    background: var(--background-static, #b8195b);
    color: #fff;
}

.doc-latest-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-latest-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.doc-latest-item:last-child {
    margin-bottom: 0;
}

.doc-latest-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 77px;
    border-radius: 4px;
    overflow: hidden;
    display: block;
}

.doc-latest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-latest-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text, #374151);
    text-decoration: none;
    line-height: 1.35;
    margin-bottom: 0.25rem;
}

.doc-latest-title:hover {
    color: var(--highlight, #f25587);
}

.doc-latest-price {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--background-static, #b8195b);
}

/* Detail page */
.doc-detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.doc-detail-hero {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow, 0 6px 18px rgba(18, 38, 63, 0.06));
    margin-bottom: 1.5rem;
}

.doc-detail-cover-wrap {
    position: relative;
}

.doc-detail-cover {
    display: block;
    aspect-ratio: 400 / 550;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border, #e5e7eb);
}

.doc-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-preview-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text, #374151);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.doc-preview-btn:hover {
    background: var(--border, #f3f4f6);
    border-color: var(--color-muted, #9ca3af);
}

.doc-detail-title {
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--color-page-title, #1a1a2e);
    margin: 0.5rem 0 0.75rem;
    line-height: 1.35;
}

.doc-detail-desc {
    color: var(--color-muted, #6b7280);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.doc-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.doc-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.doc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s;
}

.doc-btn-primary {
    background: #46c28e;
    color: #fff;
}

.doc-btn-primary:hover {
    background: #3aa87a;
    color: #fff;
}

.doc-btn-outline {
    background: #fff;
    color: var(--color-text, #374151);
    border: 1px solid var(--border, #e5e7eb);
}

.doc-btn-outline:hover {
    background: var(--border, #f3f4f6);
    color: var(--color-text, #374151);
}

.doc-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.doc-detail-tabs {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow, 0 6px 18px rgba(18, 38, 63, 0.06));
    margin-bottom: 1.5rem;
}

.doc-detail-tab-content {
    padding-top: 1rem;
}

/* Related docs */
.doc-related {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow, 0 6px 18px rgba(18, 38, 63, 0.06));
}

.doc-related-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    color: var(--color-page-title, #1a1a2e);
}

.doc-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.doc-related-card {
    min-width: 0;
}

.doc-related-media {
    display: block;
    aspect-ratio: 400 / 550;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.doc-related-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-related-name {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0.25rem 0;
    line-height: 1.35;
}

.doc-related-name a {
    color: inherit;
    text-decoration: none;
}

.doc-related-name a:hover {
    color: var(--highlight, #f25587);
}

/* Preview modal */
.doc-preview-modal {
    height: 90vh;
}

.doc-preview-modal .modal-body {
    background: #525659;
    flex: 1;
}

.doc-preview-modal iframe {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: none;
}

.doc-preview-buy-link {
    color: var(--background-static, #b8195b);
    font-weight: 600;
    text-decoration: none;
}

.doc-preview-buy-link:hover {
    text-decoration: underline;
}

/* Mobile sticky CTA */
.doc-sticky-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid var(--border, #e5e7eb);
    padding: 0.75rem 1rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.doc-sticky-actions {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 991px) {
    .doc-layout,
    .doc-detail-layout {
        grid-template-columns: 1fr;
    }

    .doc-sidebar {
        position: static;
    }

    .doc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .doc-featured {
        grid-template-columns: 200px 1fr;
    }

    .doc-detail-hero {
        grid-template-columns: 200px 1fr;
    }

    .doc-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .doc-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .doc-featured {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .doc-detail-hero {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .doc-detail-actions-desktop {
        display: none;
    }

    .doc-sticky-cta {
        display: flex;
    }

    .doc-detail-sidebar {
        order: -1;
    }

    .doc-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    body:has(.doc-sticky-cta) {
        padding-bottom: 72px;
    }
}

@media (min-width: 768px) {
    .doc-sticky-cta {
        display: none !important;
    }
}
