/* =========================================================
   PLEXO / DETALHE DO LIVRO
   Página: /livro/{slug}
   Simples, suave e com cara de livraria/app de leitura
   ========================================================= */

.book-detail-page {
    min-height: 70vh;
    padding: 42px 0 84px;
    background: #fff;
    color: var(--text, #253238);
}

/* =========================================================
   ESTADO VAZIO
   ========================================================= */

.book-detail-empty {
    padding: 56px 24px;
    border: 1px dashed rgba(18, 55, 42, 0.14);
    border-radius: 22px;
    text-align: center;
    background: #fff;
}

.book-detail-empty h1 {
    margin: 0 0 10px;
    color: var(--primary, #12372a);
    font-size: clamp(2rem, 5vw, 3rem);
}

.book-detail-empty p {
    margin: 0;
    color: var(--muted, #6b7280);
    font-weight: 700;
}

.book-detail-empty a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    margin-top: 20px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--accent, #ff6b1a);
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

/* =========================================================
   TOPO DO PRODUTO
   ========================================================= */

.book-detail-product {
    display: grid;
    gap: 34px;
    align-items: start;
}

.book-detail-cover-column {
    display: grid;
    place-items: center;
}

.book-detail-cover-frame {
    width: min(100%, 330px);
}

.book-detail-cover-img,
.book-detail-cover-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    display: block;
    overflow: hidden;
    border-radius: 7px;
    background: #f1f3f2;
    box-shadow: 0 22px 48px rgba(18, 42, 35, 0.15);
}

.book-detail-cover-img {
    object-fit: cover;
}

.book-detail-cover-placeholder {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(180deg, #12372a 0%, #0d2d23 100%);
    color: #fff;
    font-size: 3rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
}

.book-detail-info-column {
    min-width: 0;
}

.book-detail-main-info {
    max-width: 820px;
}

/* =========================================================
   TEXTO PRINCIPAL
   ========================================================= */

.book-detail-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--muted, #6b7280);
    font-size: 0.84rem;
    font-weight: 750;
}

.book-detail-breadcrumb a {
    color: var(--muted, #6b7280);
    text-decoration: none;
}

.book-detail-breadcrumb a:hover {
    color: var(--accent, #ff6b1a);
}

.book-detail-category {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    color: var(--accent-strong, #e25508);
    font-size: 0.74rem;
    font-weight: 1000;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.book-detail-main-info h1 {
    max-width: 760px;
    margin: 0;
    color: var(--primary, #12372a);
    font-size: clamp(2.1rem, 5.4vw, 4.1rem);
    line-height: 1;
    font-weight: 1000;
    letter-spacing: -0.065em;
}

.book-detail-author {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 15px 0 0;
    color: var(--muted, #6b7280);
    font-size: 1rem;
    font-weight: 750;
}

.book-detail-author a,
.book-detail-author strong {
    color: var(--primary, #12372a);
    font-weight: 1000;
    text-decoration: none;
}

.book-detail-author a:hover {
    color: var(--accent, #ff6b1a);
}

.book-detail-inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 20px;
}

.book-detail-inline-meta span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid rgba(18, 55, 42, 0.1);
    border-radius: 999px;
    background: #fff;
    color: var(--primary, #12372a);
    font-size: 0.84rem;
    font-weight: 900;
}

/* =========================================================
   ACESSO / COMPRA / LEITURA
   ========================================================= */

.book-detail-access-line {
    display: grid;
    gap: 16px;
    margin-top: 30px;
    padding: 18px;
    border: 1px solid rgba(18, 55, 42, 0.08);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(255, 107, 26, 0.07), transparent 34%),
        #fff;
    box-shadow: 0 14px 34px rgba(18, 42, 35, 0.05);
}

.book-detail-access-line strong {
    display: block;
    color: var(--primary, #12372a);
    font-size: 1.12rem;
    font-weight: 1000;
    letter-spacing: -0.025em;
}

.book-detail-access-line p {
    max-width: 620px;
    margin: 6px 0 0;
    color: var(--muted, #6b7280);
    line-height: 1.55;
    font-weight: 700;
}

.book-detail-access-form {
    display: grid;
    gap: 10px;
    margin: 0;
}

.book-detail-access-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 86px;
    padding: 13px 14px;
    border: 1px solid rgba(18, 55, 42, 0.12);
    border-radius: 16px;
    background: #fff;
    color: var(--text, #253238);
    font: inherit;
    font-weight: 700;
}

.book-detail-access-form textarea:focus {
    outline: none;
    border-color: rgba(255, 107, 26, 0.42);
    box-shadow: 0 0 0 4px rgba(255, 107, 26, 0.08);
}

.book-detail-primary-action,
.book-detail-secondary-action {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 22px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 1000;
    text-decoration: none;
    cursor: pointer;
}

.book-detail-primary-action {
    border: 1px solid var(--accent, #ff6b1a);
    background: var(--accent, #ff6b1a);
    color: #fff;
}

.book-detail-primary-action:hover {
    background: var(--accent-strong, #e25508);
    border-color: var(--accent-strong, #e25508);
}

.book-detail-secondary-action {
    border: 1px solid rgba(18, 55, 42, 0.12);
    background: #fff;
    color: var(--primary, #12372a);
}

.book-detail-secondary-action:hover {
    border-color: rgba(18, 55, 42, 0.22);
    background: #f8faf8;
}

.book-detail-status-badge {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--plexo-orange-soft, #fff1e8);
    color: var(--accent-strong, #e25508);
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.74rem;
}

/* =========================================================
   AÇÕES SOCIAIS
   ========================================================= */

.book-detail-social-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.book-detail-social-actions form {
    margin: 0;
}

.book-detail-social-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid rgba(255, 107, 26, 0.32);
    border-radius: 999px;
    background: #fff;
    color: var(--accent, #ff6b1a);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 1000;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.book-detail-social-button:hover {
    transform: translateY(-1px);
    background: var(--plexo-orange-soft, #fff1e8);
}

.book-detail-social-button.is-active {
    background: var(--accent, #ff6b1a);
    border-color: var(--accent, #ff6b1a);
    color: #fff;
}

.book-detail-social-button span {
    font-size: 0.94rem;
    line-height: 1;
}

.book-detail-social-button small {
    font-size: 0.8rem;
    font-weight: 1000;
}

/* =========================================================
   TABS
   ========================================================= */

.book-detail-tabs {
    display: flex;
    align-items: center;
    gap: 34px;
    margin-top: 52px;
    border-bottom: 1px solid rgba(18, 55, 42, 0.08);
}

.book-detail-tabs a {
    position: relative;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    color: var(--muted, #6b7280);
    font-size: 0.95rem;
    font-weight: 1000;
    text-decoration: none;
}

.book-detail-tabs a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 3px;
    background: transparent;
}

.book-detail-tabs a:hover,
.book-detail-tabs a.is-active {
    color: var(--primary, #12372a);
}

.book-detail-tabs a.is-active::after {
    background: var(--accent, #ff6b1a);
}

.book-detail-tab-content {
    padding-top: 24px;
}

/* =========================================================
   PAINÉIS
   ========================================================= */

.book-detail-panel {
    max-width: 980px;
}

.book-detail-panel-label {
    margin-bottom: 10px;
}

.book-detail-panel-label span,
.book-detail-related-head span {
    color: var(--accent-strong, #e25508);
    font-size: 0.74rem;
    font-weight: 1000;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.book-detail-panel h2,
.book-detail-related-head h2 {
    margin: 0;
    color: var(--primary, #12372a);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.08;
    font-weight: 1000;
    letter-spacing: -0.045em;
}

.book-detail-summary p,
.book-detail-muted {
    margin: 14px 0 0;
    color: var(--muted, #6b7280);
    line-height: 1.85;
    font-size: 1rem;
    font-weight: 700;
}

.book-detail-panel-action {
    width: fit-content;
    margin-top: 18px;
}

/* =========================================================
   CAPÍTULOS
   ========================================================= */

.book-detail-chapter-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.book-detail-chapter-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid rgba(18, 55, 42, 0.08);
    border-radius: 18px;
    background: #fffdf9;
}

.book-detail-chapter-card strong {
    display: block;
    color: var(--primary, #12372a);
    font-weight: 1000;
}

.book-detail-chapter-card p {
    margin: 6px 0 0;
    color: var(--muted, #6b7280);
    line-height: 1.5;
    font-weight: 700;
}

.book-detail-chapter-card a {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 15px;
    border: 1px solid rgba(255, 107, 26, 0.32);
    border-radius: 999px;
    color: var(--accent, #ff6b1a);
    font-weight: 1000;
    text-decoration: none;
}

.book-detail-chapter-card a:hover {
    background: var(--accent, #ff6b1a);
    color: #fff;
}

/* =========================================================
   DETALHES
   ========================================================= */

.book-detail-details-list {
    display: grid;
    gap: 10px;
    max-width: 760px;
    margin: 22px 0 0;
}

.book-detail-details-list div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid rgba(18, 55, 42, 0.08);
}

.book-detail-details-list dt {
    color: var(--muted, #6b7280);
    font-weight: 900;
}

.book-detail-details-list dd {
    margin: 0;
    color: var(--primary, #12372a);
    font-weight: 900;
}

/* =========================================================
   RELACIONADOS
   ========================================================= */

.book-detail-related {
    margin-top: 56px;
}

.book-detail-related-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.book-detail-related-head a {
    flex: 0 0 auto;
    color: var(--accent-strong, #e25508);
    font-weight: 1000;
    text-decoration: none;
}

.book-detail-related-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 26px 14px;
}

.book-detail-related-card {
    min-width: 0;
}

.book-detail-related-cover {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 7px;
    background: #f1f3f2;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(18, 42, 35, 0.1);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.book-detail-related-card:hover .book-detail-related-cover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(18, 42, 35, 0.16);
}

.book-detail-related-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.book-detail-related-cover span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(180deg, #12372a 0%, #0d2d23 100%);
    color: #fff;
    font-size: 2rem;
    font-weight: 1000;
}

.book-detail-related-info {
    padding-top: 8px;
}

.book-detail-related-info h3 {
    margin: 0;
    color: var(--primary, #12372a);
    font-size: 0.92rem;
    line-height: 1.22;
    font-weight: 1000;
}

.book-detail-related-info h3 a {
    color: inherit;
    text-decoration: none;
}

.book-detail-related-info h3 a:hover {
    color: var(--accent-strong, #e25508);
}

.book-detail-related-info p {
    margin: 4px 0 0;
    color: var(--muted, #6b7280);
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-detail-related-info small {
    display: inline-flex;
    margin-top: 5px;
    color: var(--primary, #12372a);
    font-size: 0.75rem;
    font-weight: 900;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (min-width: 920px) {
    .book-detail-product {
        grid-template-columns: 330px minmax(0, 1fr);
        gap: 56px;
    }

    .book-detail-access-line {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .book-detail-access-form {
        min-width: 230px;
    }
}

@media (max-width: 1180px) {
    .book-detail-related-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .book-detail-related-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .book-detail-page {
        padding-top: 28px;
    }

    .book-detail-cover-frame {
        width: min(76vw, 300px);
    }

    .book-detail-main-info h1 {
        font-size: clamp(2.2rem, 12vw, 3.7rem);
    }

    .book-detail-tabs {
        gap: 24px;
        overflow-x: auto;
    }

    .book-detail-related-head {
        align-items: start;
        flex-direction: column;
    }

    .book-detail-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px 12px;
    }

    .book-detail-chapter-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .book-detail-cover-frame {
        width: min(82vw, 280px);
    }

    .book-detail-inline-meta {
        gap: 7px;
    }

    .book-detail-social-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .book-detail-social-button {
        width: 100%;
    }

    .book-detail-details-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .book-detail-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .book-detail-related-info h3 {
        font-size: 0.86rem;
    }

    .book-detail-related-info p,
    .book-detail-related-info small {
        font-size: 0.72rem;
    }
}

/* =========================================================
   BARRA DE TABS DO LIVRO — ESTILO APP
   ========================================================= */

.book-detail-tabs-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 52px;
    border: 1px solid rgba(18, 55, 42, 0.08);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    overflow: hidden;
}

.book-detail-tabs-bar a {
    position: relative;
    min-height: 64px;
    display: grid;
    place-items: center;
    gap: 5px;
    border-right: 1px solid rgba(18, 55, 42, 0.06);
    background: #fff;
    color: #6b7280;
    font-size: 0.84rem;
    font-weight: 850;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease;
}

.book-detail-tabs-bar a:last-child {
    border-right: 0;
}

.book-detail-tabs-bar a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background 160ms ease;
}

.book-detail-tabs-bar a:hover {
    color: var(--primary, #12372a);
    background: #fffdf9;
}

.book-detail-tabs-bar a.is-active {
    color: var(--primary, #12372a);
    background: #fff;
}

.book-detail-tabs-bar a.is-active::after {
    background: var(--accent, #ff6b1a);
}

.book-detail-tab-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
}

.book-detail-tab-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.book-detail-tab-label {
    display: block;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 900;
}

/* sobrescreve a tab textual antiga */
.book-detail-tabs.book-detail-tabs-bar {
    border-bottom: 0;
}

.book-detail-tabs.book-detail-tabs-bar a {
    min-height: 64px;
}

.book-detail-tabs.book-detail-tabs-bar a::after {
    bottom: 0;
}

@media (max-width: 760px) {
    .book-detail-tabs-bar {
        overflow-x: auto;
        grid-template-columns: repeat(3, minmax(110px, 1fr));
    }

    .book-detail-tabs-bar a {
        min-width: 110px;
    }
}

@media (max-width: 520px) {
    .book-detail-tabs-bar {
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
        border-left: 0;
        border-right: 0;
    }

    .book-detail-tab-label {
        font-size: 0.72rem;
    }
}