/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f7fa;
    color: #1a202c;
}

/* VARIABLES */
:root {
    --main-color: #1F4E79;
    --main-hover: #163a5a;
    --cta-color: #ff7a00;
}

/* 🔥 FIX GLOBAL INPUT (IMPORTANT) */
input,
textarea,
select {
    font-size: 16px; /* ✅ empêche zoom */
}

/* INTRO */
.intro-books {
    text-align: center;
    padding: 50px 15px 20px;
}

.intro-content {
    max-width: 500px;
    margin: auto;
}

.intro-content h1 {
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.intro-text {
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 14px;
}

/* SEARCH */
.search-section {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.search-box {
    display: flex;
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* 🔥 FIX ZOOM */
.search-bar {
    flex: 1;
    padding: 14px;
    border: none;
    outline: none;
    font-size: 16px; /* ✅ */
}

.search-btn {
    background: var(--main-color);
    color: white;
    border: none;
    padding: 14px;
    cursor: pointer;
}

/* BOOKS */
.books {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.books h2 {
    margin-bottom: 25px;
    color: var(--main-color);
}

/* GRID */
.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 25px;
}

/* CARD */
.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);

  
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.book-card.show {
    opacity: 1;
    transform: translateY(0);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* IMAGE */
.book-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* CONTENT */
.book-content {
    padding: 15px;
}

.book-content h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.book-content p {
    font-size: 13px;
    color: #6b7280;
}

/* FOOTER */
.book-footer {
    margin-top: 12px;
}

.book-price {
    display: block;
    font-weight: bold;
    color: var(--main-color);
    margin-bottom: 10px;
}

/* ================= BOUTONS ================= */
.book-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* BASE */
.buy-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    text-decoration: none;
    transition: 0.3s;

    display: flex;
    align-items: center;
    justify-content: center;

    line-height: 1.2;
}

/* PRINCIPAL */
.buy-btn {
    background: var(--cta-color);
    color: white;
}

.buy-btn:hover {
    background: #e56700;
}

/* SECONDAIRE */
.buy-btn.secondary {
    background: #e5e7eb;
    color: #1a202c;
}

.buy-btn.secondary:hover {
    background: #d1d5db;
}

/* SCROLL */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--main-color);
    color: white;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    opacity: 0;
    transform: scale(0.8);
    transition: 0.3s;
}

#scrollTopBtn.show {
    opacity: 1;
    transform: scale(1);
}

/* MOBILE */
@media (max-width: 480px) {
    .book-list {
        grid-template-columns: 1fr;
    }
}

/* ================= MODAL ================= */

.resume-modal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.resume-box{
    background: #1b1b1b;
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    position: relative;
    border: 1px solid #333;
}

.close-modal{
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 35px;
    color: white;
    cursor: pointer;
}

.modal-book-img{
    width: 180px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.resume-box h2{
    color: #ff8800;
    margin-bottom: 15px;
}

.resume-box p{
    color: #ddd;
    line-height: 1.7;
    margin-bottom: 20px;
}

.buy-modal-btn{
    display: inline-block;
    background: #ff8800;
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
}



/* ================= IMAGE CLIQUABLE ================= */

.modal-book-img{
    width: 180px;
    border-radius: 15px;
    margin-bottom: 20px;

    cursor: zoom-in;

    position: relative;
    z-index: 5;
}

/* ================= IMAGE VIEWER ================= */
.image-viewer{
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.98);

    display: none;
    justify-content: center;
    align-items: center;

    z-index: 10000;

    overflow: auto;
}

/* IMAGE */
.image-viewer img{

    width: auto;
    height: auto;

    max-width: 98vw;
    max-height: none;

    object-fit: contain;

    border-radius: 8px;

    transition: transform 0.3s ease;

    cursor: grab;
}

/* CLOSE */
.close-viewer{
    position: fixed;

    top: 15px;
    right: 25px;

    color: white;

    font-size: 45px;

    cursor: pointer;

    z-index: 10001;
}



/* ================= IMAGE VIEWER ================= */
.img-viewer{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.96);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:999999;
    overflow:hidden;
}

/* IMAGE */
#viewerImg{
    max-width:92%;
    max-height:92%;
    object-fit:contain;
    transition:transform .25s ease;
    cursor:grab;
    border-radius:12px;
    user-select:none;
}

/* CLOSE */
.close-viewer{
    position:absolute;
    top:20px;
    right:30px;
    color:white;
    font-size:55px;
    cursor:pointer;
    z-index:10;
}

/* ZOOM ICON */
.zoom-indicator{
    position:absolute;
    top:25px;
    left:25px;
    width:60px;
    height:60px;
    border-radius:50%;
    background:rgba(255,255,255,.12);
    backdrop-filter:blur(10px);
    display:flex;
    justify-content:center;
    align-items:center;
    color:white;
    font-size:28px;
}

/* CONTROLS */
.zoom-controls{
    position:absolute;
    bottom:30px;
    left:50%;
    transform:translateX(-50%);
    display:flex;
    gap:15px;
    z-index:100;
}

.zoom-controls button{
    width:58px;
    height:58px;
    border:none;
    border-radius:50%;
    background:rgba(255,255,255,.14);
    color:white;
    font-size:28px;
    cursor:pointer;
    backdrop-filter:blur(10px);
    transition:.25s;
}

.zoom-controls button:hover{
    transform:scale(1.1);
    background:rgba(255,255,255,.25);
}