section {
    padding-top: 50px;
}

/* Ebook Hero Header */
.ebook-hero {
    position: relative;
    width: 100%;
    min-height: 450px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    color: #fff;
}

.header-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
}

.header-text-block {
    padding: 120px 140px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.header-text-block h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.2;
}

.header-text-block .ebook-description {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
    text-align: justify;
}

.ebook-description img {
    display: none !important;
}

.btn-ebook-download {
    display: flex;
    justify-content: center;
    width: fit-content;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 12px 50px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    margin-top: 10px;
}

.btn-ebook-download:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#download-form {
    scroll-margin-top: 100px; 
}

/* Breadcrumb */
.ebook-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 60px;
    font-size: 14px;
    font-weight: 500;
}

.ebook-breadcrumb a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.ebook-breadcrumb a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.ebook-breadcrumb .separator {
    color: var(--primary-blue);
    font-weight: 300;
}

.ebook-breadcrumb .current-page {
    color: var(--primary-blue);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Main Grid 2 Columns --- */
.ebook-main-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    align-items: flex-start;
}

.col-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark-blue);
    text-align: center;
}

/* Preview Column */
.pdf-wrapper {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    line-height: 0;
    height: 700px;
}

.pdf-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.preview-col {
    position: relative;
}

.no-preview {
    padding: 100px;
    background: #f5f5f5;
    text-align: center;
    border-radius: 12px;
}

/* Form Column Styles */
.form-sticky-box {
    background: var(--white);
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
    position: sticky;
    top: 100px;
}

.form-title {
    color: var(--dark-blue);
    font-size: 26px;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.form-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 25px;
    text-align: center;
}

.wpcf7-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark-blue);
}

.wpcf7-text, 
.wpcf7-textarea, 
.wpcf7-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #FAFAFA;
}

.wpcf7-text:focus, 
.wpcf7-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(1, 118, 211, 0.1);
}

.wpcf7-submit {
    background: var(--primary-blue);
    color: var(--white);
    padding: 14px 35px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.wpcf7-submit:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(3, 45, 96, 0.2);
}

.wpcf7-response-output {
    display: none;
}

/* Form Group */
.form-group {
    text-align: justify;
    margin-bottom: 20px;
}

.form-submit {
    max-height: 50px;
    margin-top: 50px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-blue);
    font-size: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0px;
}

::placeholder {
    color: #A0A0A0;
    opacity: 0.8;
}

/* RELATED POSTS */
.related-ebooks {
    background: var(--bg-light);
    padding-top: 70px;
}

.related-ebooks h3 {
    font-size: 42px;
    margin-bottom: 24px;
    text-align: center;
    margin-bottom: 50px;
}

/* GRID */
.ebook-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* CARD */
.ebook-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.25s;
}

.ebook-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

/* IMAGE */
.ebook-thumb {
    height: 170px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-light);
}

.ebook-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CONTENT */
.ebook-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* TITLE */
.ebook-title {
    font-size: 18px !important;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;

    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ebook-title a {
    color: var(--dark-blue);
    text-decoration: none;
}

/* EXCERPT */
.ebook-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-ebook-download2 {
    display: flex;
    justify-content: center;
    width: fit-content;
    background-color: var(--primary-blue);
    color: var(--white);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    margin-top: 10px;
    padding: 5px 10px;
    font-size: 15px;
}

.btn-ebook-download2:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.view-more {
    font-size: 14px;
    color: var(--dark-blue);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    display: block;
    text-align: end;
    margin-bottom: 20px;
    cursor: pointer;
}

.view-more:hover {
    color: var(--primary-blue);
}

/* Toast notification sau khi submit form ebook */
.ebook-toast {
    position: fixed;
    top: 80px;
    right: 30px;
    max-width: 380px;
    background: var(--dark-blue, #032D60);
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999999;
}

.ebook-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ebook-toast i {
    color: #4caf50;
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-text-block {
        padding: 50px 30px;
    }

    .ebook-hero {
        min-height: 250px;
    }

    .ebook-main-grid { 
        gap: 20px;
        grid-template-columns: 1fr 1fr;
    }

    .related-ebooks h3 {
        margin-bottom: 20px;
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .header-text-block {
        padding: 30px 20px;
        gap: 16px;
    }

    .btn-ebook-download {
        padding: 8px 20px;
    }

    .ebook-breadcrumb {
        margin-bottom: 16px;
    }

    .ebook-main-grid {
        grid-template-columns: 1fr;
    }
    .header-text-block h1 {
        font-size: 26px;
    }

    .related-ebooks h3 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .view-more {
        margin-bottom: 12px;
    }

    .ebook-grid {
        display: flex;
        overflow-x: auto;
        gap: 16px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .ebook-grid::-webkit-scrollbar {
        display: none;
    }

    .ebook-card {
        max-width: 70%;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .ebook-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}