/* ══════════════════════════════════════
       BOOK CARD (standard)
       ══════════════════════════════════════ */
.book-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
    overflow: hidden;
    cursor: pointer;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .13);
}

.book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    position: relative;
}

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

/* Mockup cover */
.mock-cover {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.mock-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 8px;
    background: rgba(0, 0, 0, .25);
}

.mock-cover-top {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 10px 12px 0;
}

.mock-cover-icon {
    font-size: 28px;
    color: rgba(255, 255, 255, .15);
}

.mock-cover-body {
    padding: 12px 12px 12px 16px;
    position: relative;
    z-index: 1;
}

.mock-cover-tag {
    font-size: 8px;
    font-weight: 700;
    color: rgba(255, 255, 255, .6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.mock-cover-name {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.book-info {
    padding: 10px 10px 12px;
}

.book-name {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-sub {
    font-size: 11px;
    color: #888;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Popular card ─────────────────────────────────────────── */
.pop-card {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .18);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.pop-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .25);
    color: inherit;
    text-decoration: none;
}

/* Move ribbon together with card on hover */
.pop-col:has(.pop-card:hover) .pop-ribbon {
    transform: translateY(-6px);
}

/* ── Equal-height items ── */
/* Make the stage a flex container so every item stretches to the tallest */
.pop-owl .owl-stage {
    display: flex;
    align-items: stretch;
}

.pop-owl .owl-item {
    display: flex;
    padding-top: 14px;  /* room for ribbon that overflows top */
}

/* Ribbon lives outside pop-card (avoids overflow:hidden clip) */
.pop-col {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;            /* fill owl-item height */
}

/* Card fills the col so all cards are the same height */
.pop-col .pop-card {
    flex: 1;
}

.pop-ribbon {
    position: absolute;
    top: -10px;
    left: 12px;
    width: 52px;
    height: 63px;                   /* 52 * (76/63) */
    z-index: 4;
    pointer-events: none;
    transition: transform .2s;
}

.pop-ribbon-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.pop-ribbon-num {
    position: absolute;
    top: 20px;                      /* vertically centered in ribbon body */
    left: 0;
    width: 76%;                     /* align with ribbon body width (not fold) */
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* ── Cover area (gradient bg + image) ── */
/* JS (equalizePopCovers) sets an explicit height on this element        */
/* so the image inside can reliably use height:100%                      */
.pop-cover-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 16px 16px 14px;
    /* flex:1 kept for initial layout before JS runs */
    flex: 1;
    min-height: 0;
}

.pop-cover-img {
    width: 78%;
    height: 100%;           /* resolves against JS-set height on cover-wrap */
    object-fit: cover;
    border-radius: 6px;
    display: block;
    object-fit: scale-down;
}

.pop-cover-placeholder {
    width: 78%;
    border-radius: 6px;
    background: rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, .5);
}

/* ── Info section (white bottom) ── */
.pop-info {
    color: #fff;
    padding: 10px 0 14px;
    flex-shrink: 0;
    width: 100%;
}

.pop-prdmain {
    padding-left: 5px;
    border-bottom: solid 1px #fff;
}

.pop-prdmain span {
    /* font-size: 8px;
    font-weight: 700; */
    letter-spacing: 1px;
    border-left: solid 2px #fff;
    padding-left: 5px;
}


.pop-cat {
    /* font-size: 10px; */
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
    padding-left: 8px;
    border-left: 3px solid #00BCD4;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pop-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 10px;
}

/* ── Card gradient backgrounds ── */
.pc1  { background: linear-gradient(160deg, #00BCD4 0%, #1a237e 100%); }
.pc2  { background: linear-gradient(160deg, #26C6DA 0%, #283593 100%); }
.pc3  { background: linear-gradient(160deg, #00ACC1 0%, #1565C0 100%); }
.pc4  { background: linear-gradient(160deg, #00838F 0%, #0D47A1 100%); }
.pc5  { background: linear-gradient(160deg, #0097A7 0%, #311B92 100%); }
.pc6  { background: linear-gradient(160deg, #00BCD4 0%, #4A148C 100%); }
.pc7  { background: linear-gradient(160deg, #26C6DA 0%, #880E4F 100%); }
.pc8  { background: linear-gradient(160deg, #00ACC1 0%, #BF360C 100%); }
.pc9  { background: linear-gradient(160deg, #00838F 0%, #1B5E20 100%); }
.pc10 { background: linear-gradient(160deg, #0097A7 0%, #33691E 100%); }

/* ── Responsive: book cards ── */
@media (max-width: 767.98px) {
    .book-info {
        padding: 8px 8px 10px;
    }
    .book-name {
        font-size: 11px;
    }
    .book-sub {
        font-size: 10px;
    }
}

/* ── Responsive: popular cards ── */
@media (max-width: 767.98px) {
    .pop-ribbon {
        width: 40px;
        height: 49px;
        top: -8px;
        left: 8px;
    }
    .pop-ribbon-num {
        font-size: 13px;
        top: 16px;
    }
    .pop-name {
        font-size: 11px;
        padding: 8px;
    }
    .pop-cat {
        font-size: 9px;
        padding-left: 6px;
    }
}

@media (max-width: 575.98px) {
    .pop-ribbon {
        width: 34px;
        height: 42px;
        top: -6px;
        left: 6px;
    }
    .pop-ribbon-num {
        font-size: 11px;
        top: 13px;
    }
}