:root{
  --navy:#132f70;
  --blue:#123d8f;
  --light:#eef5fc;
  --orange:#f4511e;
  --border:#dce5ef;
  --text:#12315f;
  --muted:#72829a;
}

/* BASE */
*{box-sizing:border-box}
html{scroll-behavior:smooth}


.top-banner {
    width: 100%;
    background: #f5f5f5;
    margin: 0 0 20px 0;
    padding: 0;
}

.banner-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.banner-img {
    width: 100%;
    height: 190px;
    max-height: 190px;
    display: block;
    object-fit: cover;
    border-radius: 0 0 6px 6px;
    background: #fff;
}

.privacy-check {
    font-size:14px;
    margin-top:15px;
    display:block;
    color:var(--text);
}

.privacy-check a {
    color:var(--orange);
    font-weight:600;
}


.admin-table {
    width:100%;
    border-collapse:collapse;
    margin:20px 0;
    background:#fff;
    border:1px solid var(--border);
    border-radius:8px;
    overflow:hidden;
}

.admin-table th {
    background:var(--navy);
    color:#fff;
    padding:10px;
    text-align:left;
    font-size:14px;
}

.admin-table td {
    padding:10px;
    border-bottom:1px solid var(--border);
    font-size:14px;
}

.admin-table tr:last-child td {
    border-bottom:0;
}


body{
    margin:0;
    font-family:Arial,Helvetica,sans-serif;
    color:var(--text);
    background:#fff;
    font-size:20px;
    line-height:1.55;
}
a{text-decoration:none;color:inherit}
.wrap{max-width:1120px;margin:auto;padding:0 28px}

/* HEADER */
/* =========================================================
   HEADER - LOGOTIPO À ESQUERDA / MENU À DIREITA
   ========================================================= */

.site-header {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-sizing: border-box;
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;

    gap: 20px;
    box-sizing: border-box;
}

/* LOGOTIPO */
.site-logo {
    height: 60px;
    width: auto;
    display: block;
}

/* ÁREA DO MENU */
.menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 18px;

    min-width: 0;
    width: 100%;

    flex-wrap: nowrap;
    white-space: nowrap;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: thin;
}

.menu a {
    display: inline-block;

    flex: 0 0 auto;

    white-space: nowrap;

    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
}

.menu a:hover {
    color: var(--orange);
}


/* TABLET */
@media (max-width: 900px) {

    .header-inner {
        padding: 10px 15px;
        gap: 12px;
    }

    .site-logo {
        height: 48px;
    }

    .menu {
        justify-content: flex-end;
        gap: 14px;
    }

    .menu a {
        font-size: 14px;
    }
}


/* TELEMÓVEL */
@media (max-width: 420px) {

    .header-inner {
        padding: 8px 10px;
        gap: 8px;
    }

    .site-logo {
        height: 42px;
    }

    .menu {
        gap: 10px;
        justify-content: flex-end;
    }

    .menu a {
        font-size: 13px;
    }
}

.advanced-search-link {
  margin-top: 14px;
  text-align: center;
}

.advanced-search-button {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: .2s ease;
}

.advanced-search-button:hover {
  background: var(--blue);
  color: #fff;
}

/* Botões dos livros no catálogo */
.book-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.book-card .actions .btn {
  font-size: 13px;
  padding: 9px 10px;
  white-space: nowrap;
  text-align: center;
  flex: 1 1 0;
  min-width: 0;
}

/* Botão Reservar ocupa uma nova linha */
.book-card .actions .reserve-btn {
  display: block !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;

  background: #198754;
  color: #fff;
  border: 1px solid #198754;

  text-align: center;
  white-space: nowrap;
}

.book-card .actions .reserve-btn:hover {
  background: #146c43;
  border-color: #146c43;
  color: #fff;
}

/* Mensagens de sucesso */
.ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
}

/* Mensagens de erro */
.err {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
}

/* Pequena animação */
.ok,
.err {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* HERO */
.hero{
    background:#f7faff;
    padding:50px 0;
    border-bottom:1px solid var(--border);
}
.hero-grid{
    display:grid;
    grid-template-columns:1fr 300px;
    gap:45px;
    align-items:center;
}
.hero-copy{}
.eyebrow{
    font-size:14px;
    letter-spacing:1.5px;
    font-weight:800;
    color:var(--orange);
    margin-bottom:10px;
}
.hero h1{
    font-size:44px;
    line-height:1.1;
    margin:0 0 14px;
    color:var(--navy);
}
.hero p{
    font-size:17px;
    color:#536b89;
    max-width:540px;
    margin:0 0 18px;
}
.hero-button{
    display:inline-block;
    background:var(--orange);
    color:#fff;
    padding:12px 20px;
    border-radius:6px;
    font-size:15px;
    font-weight:700;
    transition:.2s;
}
.hero-button:hover{background:#d94812}

/* HOW CARD */
.how-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:8px;
    padding:16px;
    box-shadow:0 8px 22px rgba(26,55,100,.09);
}
.how-card h3{
    font-size:16px;
    margin:0 0 10px;
    color:var(--navy);
}
.how-card ol{
    margin:0;
    padding-left:18px;
    font-size:14px;
    line-height:1.9;
    color:#324c72;
}

/* SECTION */
.section{padding:50px 0}
.catalog h2,.free-section h2{
    font-size:22px;
    margin:0 0 18px;
    color:var(--navy);
}

/* SEARCH BAR */
.catalog-search{
    height:auto;
    border:1px solid var(--border);
    border-radius:9px;
    padding:12px;
    display:flex;
    gap:10px;
    box-shadow:0 4px 15px rgba(30,60,100,.07);
    margin-bottom:20px;
}
.catalog-search input{
    flex:1;
    min-width:0;
    border:1px solid #cad9ea;
    border-radius:4px;
    padding:10px;
    font-size:15px;
    outline:none;
    color:var(--text);
}
.catalog-search select{
    width:160px;
    border:1px solid #cad9ea;
    border-radius:4px;
    padding:10px;
    font-size:15px;
    background:#fff;
    color:#273f62;
}
.catalog-search button{
    background:var(--navy);
    color:#fff;
    border:0;
    border-radius:4px;
    padding:10px 18px;
    font-size:15px;
    font-weight:800;
}

/* BOOK GRID */
.book-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:24px;
}
.book-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 4px 12px rgba(20,50,90,.06);
    transition:.2s;
}
.book-card:hover{
    transform:translateY(-3px);
    box-shadow:0 6px 18px rgba(20,50,90,.10);
}
.book-cover{
    display:block;
    height:260px;
    background:#edf5ff;
    overflow:hidden;
}
.book-cover img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.cover-placeholder{
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:8px;
    font-size:16px;
    font-weight:800;
    color:var(--navy);
}
.book-body{padding:14px}
.book-card h3{
    font-size:16px;
    margin:0 0 6px;
    color:var(--navy);
}
.author{
    font-size:14px;
    color:var(--muted);
    margin:0 0 6px;
}
.meta{
    font-size:13px;
    color:#536a88;
    margin:0 0 10px;
}
.actions{
    display:flex;
    gap:8px;
    margin-top:12px;
}
.btn{
    background:var(--navy);
    color:#fff;
    padding:8px 12px;
    border-radius:6px;
    font-size:13px;
    font-weight:700;
}
.btn.secondary{
    background:#fff;
    color:var(--navy);
    border:1px solid var(--navy);
}

/* FREE SECTION */
.free-section{
    background:#f7faff;
    padding:50px 0;
}
.section-intro{
    font-size:15px;
    color:#73839a;
    margin:0 0 18px;
}
.free-grid{
    display:flex;
    gap:24px;
    flex-wrap:wrap;
}
.free-card{
    width:220px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:10px;
    padding:14px;
    box-shadow:0 4px 12px rgba(20,50,90,.06);
}
.download-icon{
    color:var(--orange);
    font-size:26px;
    margin-bottom:10px;
}
.free-card h3{
    font-size:16px;
    margin:0 0 6px;
    color:var(--navy);
}
.free-card p{
    font-size:14px;
    color:#71829a;
    margin:0 0 10px;
}
.download-button{
    font-size:14px;
    padding:8px 12px;
}

/* BADGES */
.badge{
    padding:6px 10px;
    border-radius:6px;
    font-weight:700;
    font-size:13px;
    display:inline-block;
}
.badge.ok{background:#d1e7dd;color:#0f5132}
.badge.full{background:#f8d7da;color:#842029}
.badge.wait{background:#fff3cd;color:#664d03}
.badge.type{background:#cfe2ff;color:#084298}

/* FOOTER */
.footer{
    background:var(--navy);
    color:#fff;
    padding:30px 0;
    margin-top:40px;
}
.footer strong{
    font-size:16px;
}
.footer p{
    font-size:14px;
    margin-top:6px;
    color:#dce6f5;
}

/* RESPONSIVE */
/* RESPONSIVE */

@media (max-width: 760px) {

    .wrap {
        padding: 0 18px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .book-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-inner {
        flex-wrap: nowrap !important;
    }

    .menu {
        flex-wrap: nowrap !important;
        white-space: nowrap;
        overflow-x: auto;
        margin-left: auto !important;
    }
}


@media (max-width: 420px) {

    .header-inner {
        min-height: 60px;
        padding: 8px 10px;
        gap: 8px;
    }

    .site-logo {
        height: 42px;
    }

    .menu {
        gap: 10px;
        font-size: 13px;

        max-width: calc(100vw - 150px);

        overflow-x: auto;
        flex-wrap: nowrap !important;
    }

    .menu a {
        font-size: 13px;
        flex-shrink: 0;
    }

    .catalog-search {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .catalog-search input {
        grid-column: 1 / -1;
    }

    .book-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .book-card {
        width: auto;
    }
}