@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600&display=swap');

.yeb-store { display:block; width:min(1200px, calc(100% - 32px)); margin:0 auto; }
.yeb-store-grid { display:grid; grid-template-columns: 280px 1fr; gap: 16px; align-items:start; }
@media (max-width: 900px){ .yeb-store-grid { grid-template-columns: 1fr; } }

.yeb-card { border: 1px solid #e2e2e2; border-radius: 10px; padding: 14px; background: #fff; }
.yeb-card h3, .yeb-card h2 { margin: 0 0 10px 0; }

.yeb-muted { opacity: .7; font-size: .95em; }
.yeb-label { display:block; font-size: .9em; opacity:.85; margin: 0 0 4px 0; }

.yeb-btn { display:inline-block; text-decoration:none; border: 1px solid #1f2937; background:#1f2937; color:#fff; padding: 10px 12px; border-radius: 10px; font-weight:600; line-height:1; cursor:pointer; }
.yeb-btn:hover { opacity:.92; }
.yeb-btn-ghost { background:#fff; color:#111827 !important; }
.yeb-btn-block { display:block; width:100%; text-align:center; }

.yeb-store-filters { position:sticky; top: 18px; }
@media (max-width: 900px){ .yeb-store-filters { position:static; } }

.yeb-filter-group { margin: 0 0 14px 0; }
.yeb-filter-group h3 { margin: 0 0 10px 0; font-size: 1.05em; }

.yeb-cat-list { list-style:none; padding:0; margin:0; }
.yeb-cat-list li { margin: 6px 0; }
.yeb-cat-list li a { display:flex; justify-content:space-between; align-items:center; gap:10px; text-decoration:none; padding: 6px 8px; border-radius: 8px; }
.yeb-cat-list li a:hover { background:#f5f5f5; }
.yeb-cat-list li.is-active a { background:#1f2937; color:#fff; }
.yeb-count { font-size:.85em; opacity:.8; }

.yeb-filters-form input[type="search"],
.yeb-filters-form input[type="number"],
.yeb-filters-form select { width:100%; padding: 10px 10px; border: 1px solid #d7d7d7; border-radius: 10px; background:#fff; }

.yeb-price-range { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.yeb-filter-actions { display:flex; gap: 10px; align-items:center; }
.yeb-filter-actions .yeb-btn { flex: 1 1 auto; }

.yeb-store-header { margin-bottom: 14px; }

.yeb-books-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px){ .yeb-books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px){ .yeb-books-grid { grid-template-columns: 1fr; } }

.yeb-book-card { border: 1px solid #e2e2e2; border-radius: 12px; overflow:hidden; background:#fff; display:flex; flex-direction:column; min-height: 100%; }
.yeb-product-card--bundle{
    position:relative;
    border-color:rgba(245, 158, 11, 0.45);
    background:linear-gradient(180deg, #fff7ed 0%, #ffffff 60%);
    box-shadow:0 18px 34px rgba(245,158,11,0.18);
    transform:translateY(-2px);
}

.yeb-product-card--bundle:after{
    content:"";
    position:absolute;
    inset:0;
    background:radial-gradient(circle at 20% 0%, rgba(245,158,11,0.18), transparent 55%);
    pointer-events:none;
    z-index:0;
}

.yeb-product-card--bundle > *{
    position:relative;
    z-index:1;
}

.yeb-product-card--bundle .yeb-book-title a{
    color:#111827;
}

.yeb-bundle-includes{
    margin-top:6px;
    padding:6px 10px;
    border-radius:10px;
    background:rgba(245,158,11,0.12);
    color:#92400e;
    font-weight:700;
    font-size:.85em;
}
.yeb-book-cover { display:block; position:relative; aspect-ratio: 16/10; background:#f4f4f4; overflow:hidden; }
.yeb-book-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.yeb-cover-placeholder { width:100%; height:100%; background: linear-gradient(120deg, #f0f0f0, #fafafa); }
.yeb-cover-placeholder-lg { height: 360px; border-radius: 12px; }
.yeb-cover-count{
    position:absolute;
    top:10px;
    left:10px;
    padding:6px 10px;
    border-radius:999px;
    background:rgba(15,23,42,0.9);
    color:#fff;
    font-weight:700;
    font-size:.78em;
    letter-spacing:.2px;
    z-index:2;
    box-shadow:0 6px 16px rgba(15,23,42,0.25);
}

.yeb-badge { display:inline-block; font-size: .78em; padding: 5px 8px; border-radius: 999px; border: 1px solid #d7d7d7; text-decoration:none; line-height:1; }
.yeb-badge-cat { background:#fff; color:#111; }
.yeb-badge-sale { position:absolute; right: 10px; top: 10px; background:#111; color:#fff; border-color:#111; }

.yeb-book-body { padding: 12px; display:flex; flex-direction:column; gap: 10px; flex: 1 1 auto; }
.yeb-book-cats { display:flex; flex-wrap:wrap; gap: 6px; }
.yeb-book-title { margin: 0; font-size: 1.08em; line-height: 1.2; }
.yeb-book-title a { color: inherit; text-decoration:none; }
.yeb-book-title a:hover { text-decoration:underline; }

.yeb-book-excerpt { margin: 0; opacity:.85; font-size: .95em; }

.yeb-book-price { display:flex; align-items:baseline; gap: 10px; }
.yeb-price-oldwrap { position: relative; display:inline-block; padding-right: 18px; }
.yeb-price-off { position:absolute; top:-0.95em; right:-2px; font-size:.68em; font-weight:800; line-height:1; padding:2px 6px; border-radius: 999px; background:#111; color:#fff; border: 1px solid #111; }
.yeb-book-price--hero { gap: 12px; }
.yeb-book-price--hero .yeb-price-now { font-size: 1.55em; }
.yeb-book-price--hero .yeb-price-oldwrap { padding-right: 26px; }
.yeb-book-price--hero .yeb-price-off { top:-1.05em; font-size:.72em; padding:3px 8px; }

.yeb-price-old { text-decoration: line-through; opacity:.7; }
.yeb-price-now { font-weight: 800; font-size: 1.15em; }

.yeb-book-actions { margin-top:auto; display:flex; gap:8px; flex-wrap:wrap; }
.yeb-book-actions .yeb-btn{ width:auto !important; flex:0 0 auto; }

.yeb-similar-section{
    margin-top:22px;
    padding-top:18px;
    border-top:1px solid #eee;
}

.yeb-similar-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:12px;
}

.yeb-similar-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:12px;
}

.yeb-book-card--compact .yeb-book-body{
    padding:10px 12px;
}

.yeb-book-card--compact .yeb-book-title{
    font-size:1em;
}

@media (max-width: 900px){
    .yeb-similar-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px){
    .yeb-similar-grid{
        grid-template-columns:1fr;
    }
}

.yeb-pagination { display:flex; flex-wrap:wrap; gap: 8px; align-items:center; margin-top: 14px; }
.yeb-page { text-decoration:none; padding: 8px 10px; border: 1px solid #d7d7d7; border-radius: 10px; }
.yeb-page.is-current { background:#1f2937; border-color:#1f2937; color:#fff; }
.yeb-dots { padding: 0 6px; opacity:.7; }

/* Book page */
.yeb-book-page { padding: 18px; width:min(1200px, calc(100% - 32px)); margin:0 auto; }
.yeb-book-top { margin-bottom: 12px; }
.yeb-back { text-decoration:none; }
.yeb-book-layout { display:grid; grid-template-columns: 360px 1fr; gap: 18px; align-items:start; }
@media (max-width: 900px){ .yeb-book-layout { grid-template-columns: 1fr; } }

.yeb-book-cover-lg { width:100%; height:auto; border-radius: 12px; border: 1px solid #e2e2e2; display:block; }
.yeb-book-h1 { margin: 0 0 10px 0; }
.yeb-book-lead { opacity:.9; }

.yeb-book-buybox { margin: 14px 0; padding: 14px; border: 1px solid #e2e2e2; border-radius: 12px; }
.yeb-buybox-title { font-weight: 700; margin-bottom: 10px; }

.yeb-prices-table { width:100%; border-collapse: collapse; margin-top: 10px; }
.yeb-prices-table th, .yeb-prices-table td { border-top: 1px solid #eaeaea; padding: 8px 6px; text-align:left; }
.yeb-prices-table th { font-size: .9em; opacity:.8; }


/* --- Book detail enhancements (v0.1.34) --- */

.yeb-book-facts{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:10px 0 14px 0;
}

.yeb-fact{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:6px 10px;
    border:1px solid rgba(0,0,0,0.10);
    border-radius:999px;
    background:#fff;
    font-size:13px;
}

.yeb-fact-k{
    font-weight:700;
    letter-spacing:.02em;
    text-transform:uppercase;
    opacity:.75;
}

.yeb-fact-v{
    font-weight:600;
    opacity:.95;
}

.yeb-shortcatchy{
    margin:12px 0 16px 0;
    padding:14px 16px;
    border-radius:14px;
    border:1px solid rgba(0,0,0,0.10);
    background:linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.00));
    position:relative;
    font-size:16px;
    line-height:1.55;
}

.yeb-shortcatchy:before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:4px;
    border-radius:14px 0 0 14px;
    background:rgba(0,0,0,0.14);
}

.yeb-book-share{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-top:14px;
}

.yeb-share-label{
    font-weight:700;
    opacity:.85;
}

.yeb-share-buttons{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.yeb-share-buttons .yeb-btn{
    background:#fff !important;
    border-color:#d1d5db !important;
    color:#111827 !important;
}

.yeb-share-buttons .yeb-btn svg{
    color:#0f172a;
}

/* Preview modal */
.yeb-modal[aria-hidden="true"]{ display:none; }
.yeb-modal{
    position:fixed;
    inset:0;
    z-index:9999;
}

.yeb-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,0.55);
}

.yeb-modal-dialog{
    position:relative;
    z-index:2;
    width:min(980px, calc(100% - 26px));
    margin:6vh auto;
    background:#fff;
    border-radius:18px;
    border:1px solid rgba(0,0,0,0.12);
    box-shadow:0 20px 60px rgba(0,0,0,0.30);
    overflow:hidden;
}

.yeb-modal-body{
    padding:14px;
}

.yeb-modal-close{
    all:unset;
    position:absolute;
    top:10px;
    right:10px;
    border:1px solid var(--yeb-primary);
    background:var(--yeb-primary);
    color:#fff;
    width:36px;
    height:36px;
    border-radius:12px;
    font-size:18px;
    font-weight:700;
    line-height:1;
    cursor:pointer;
    box-shadow:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
}

.yeb-modal-open{
    overflow:hidden;
}

.yeb-preview-frame{
    min-height:260px;
}

.yeb-preview-iframe{
    width:100%;
    height:70vh;
    border:0;
}

.yeb-preview-image{
    width:100%;
    height:auto;
    border-radius:12px;
}

.yeb-preview-audio{
    width:100%;
}

.yeb-toast{
    position:fixed;
    left:50%;
    bottom:18px;
    transform:translateX(-50%) translateY(10px);
    opacity:0;
    background:rgba(0,0,0,0.86);
    color:#fff;
    padding:10px 12px;
    border-radius:999px;
    font-size:13px;
    z-index:10000;
    transition:opacity .2s ease, transform .2s ease;
    pointer-events:none;
}

.yeb-toast.is-on{
    opacity:1;
    transform:translateX(-50%) translateY(0);
}


/* --- Frontend polish (v0.1.35) --- */

/* Icon share buttons */
.yeb-icon-btn{
    width:42px;
    height:42px;
    padding:0 !important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
}

.yeb-icon-btn svg{
    width:18px;
    height:18px;
    display:block;
    fill:currentColor;
    opacity:.92;
}

/* Preview button readability */
.yeb-preview-btn:not(.yeb-preview-icon){
    color:#111827 !important;
    background:#ffffff !important;
    border-color:rgba(0,0,0,0.12) !important;
}

.yeb-preview-btn:not(.yeb-preview-icon):hover{
    background:rgba(0,0,0,0.03) !important;
}

.yeb-media-frame{
    position:relative;
    display:block;
    border-radius:12px;
    overflow:hidden;
}

.yeb-preview-icon{
    all:unset;
    position:absolute;
    top:10px;
    right:10px;
    width:28px;
    height:28px;
    border-radius:999px;
    border:0 !important;
    background:transparent !important;
    color:#111827;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:none !important;
    transition:transform .15s ease, opacity .15s ease;
    z-index:2;
    box-sizing:border-box;
}

.yeb-preview-icon:hover{
    transform:translateY(-1px) scale(1.04);
    opacity:.9;
}

.yeb-preview-icon svg{
    width:18px;
    height:18px;
    fill:currentColor;
    filter:drop-shadow(0 1px 2px rgba(255,255,255,0.3));
}

.yeb-preview-icon:focus{
    outline:none;
}

.yeb-preview-icon:focus-visible{
    outline:2px solid rgba(255,255,255,0.95);
    outline-offset:2px;
}

/* Facts row: icon + value-first pill */
.yeb-book-facts{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:12px 0 16px 0;
}

.yeb-fact{
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border:1px solid rgba(0,0,0,0.10);
    border-radius:16px;
    background:#fff;
    box-shadow:0 8px 24px rgba(0,0,0,0.06);
    min-height:44px;
}

.yeb-fact-ico{
    width:34px;
    height:34px;
    border-radius:12px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,0.04);
    color:#111827;
    flex:0 0 auto;
}

.yeb-fact-ico svg{
    width:18px;
    height:18px;
    fill:currentColor;
    opacity:.9;
}

.yeb-fact-text{
    display:flex;
    flex-direction:column;
    line-height:1.1;
    gap:2px;
}

.yeb-fact-v{
    font-size:15px;
    font-weight:800;
    letter-spacing:.01em;
    color:#111827;
}

.yeb-fact-k{
    font-size:11px;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
    opacity:.65;
}


/* Copied feedback */
.yeb-icon-btn.is-copied{
    outline:2px solid rgba(16,185,129,0.45);
    box-shadow:0 0 0 6px rgba(16,185,129,0.10);
}


/* --- Product cards + detail --- */
.yeb-product-cover{
    display:flex;
    align-items:center;
    justify-content:center;
}

.yeb-product-cover img{
    border-radius:10px;
}

.yeb-cover-stack{
    position:relative;
    width:100%;
    height:100%;
}

.yeb-cover-stack-img{
    position:absolute;
    top:50%;
    left:50%;
    width:70%;
    max-width:220px;
    height:auto;
    border-radius:12px;
    border:1px solid #e2e2e2;
    background:#fff;
    box-shadow:0 12px 28px rgba(0,0,0,0.18);
    transform:translate(-50%, -50%);
}

.yeb-cover-stack-img.is-back{
    transform:translate(-58%, -54%) rotate(-6deg);
    opacity:.95;
}

.yeb-cover-stack-img.is-front{
    transform:translate(-42%, -44%) rotate(4deg);
}

.yeb-cover-stack-count{
    position:absolute;
    right:12px;
    bottom:12px;
    background:#111;
    color:#fff;
    border:1px solid #111;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    padding:4px 8px;
}

.yeb-cover-stack--hero{
    min-height:320px;
}

.yeb-cover-stack--hero .yeb-cover-stack-img{
    width:78%;
    max-width:320px;
}

.yeb-cover-stack--hero .yeb-cover-stack-img.is-back{
    transform:translate(-60%, -54%) rotate(-6deg);
}

.yeb-cover-stack--hero .yeb-cover-stack-img.is-front{
    transform:translate(-40%, -46%) rotate(4deg);
}

.yeb-cover-slider{
    position:relative;
    width:100%;
    max-width:320px;
    height:420px;
    margin:0 auto;
    border-radius:18px;
    border:1px solid #e2e2e2;
    background:linear-gradient(160deg, #fafafa, #f1f1f1);
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 18px 40px rgba(0,0,0,0.12);
}

.yeb-cover-slide{
    position:absolute;
    width:72%;
    height:auto;
    max-height:85%;
    border-radius:14px;
    border:1px solid rgba(0,0,0,0.08);
    box-shadow:0 18px 36px rgba(0,0,0,0.2);
    opacity:0;
    transform:translateY(16px) scale(0.96);
    filter:blur(2px);
    transition:opacity 1s ease, transform 1s ease, filter 1s ease;
    will-change:opacity, transform, filter;
}

.yeb-cover-slide.is-active{
    opacity:1;
    transform:translateY(0) scale(1);
    filter:blur(0);
    z-index:2;
}

.yeb-cover-dots{
    position:absolute;
    bottom:12px;
    left:50%;
    transform:translateX(-50%);
    display:flex;
    gap:6px;
    align-items:center;
    z-index:3;
}

.yeb-cover-dot{
    width:8px;
    height:8px;
    border-radius:999px;
    background:rgba(0,0,0,0.25);
    transition:all .4s ease;
}

.yeb-cover-dot.is-active{
    width:18px;
    background:#111;
}

@media (prefers-reduced-motion: reduce){
    .yeb-cover-slide{
        transition:none;
    }
}

.yeb-badge-meta{
    background:#111;
    color:#fff;
    border-color:#111;
    font-weight:700;
}

.yeb-product-page{
    padding:18px;
    width:min(1200px, calc(100% - 32px));
    margin:0 auto;
}

.yeb-product-hero{
    display:grid;
    grid-template-columns:360px 1fr;
    gap:18px;
    align-items:start;
    margin-bottom:12px;
    padding:16px;
    border-radius:18px;
    border:1px solid #e7ebf0;
    background:linear-gradient(135deg, #f8fafc 0%, #ffffff 60%);
    box-shadow:0 10px 26px rgba(15,23,42,0.06);
}

.yeb-product-hero-media{
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:16px;
    overflow:hidden;
    background:#f5f7fb;
}

.yeb-product-meta{
    font-weight:600;
    opacity:.75;
    margin:4px 0 10px 0;
}

.yeb-product-description{
    margin:16px 0 4px 0;
}

.yeb-includes-divider,
.yeb-section-divider{
    display:flex;
    align-items:center;
    gap:14px;
    margin:18px 0 12px;
}

.yeb-includes-line{
    flex:1 1 auto;
    height:1px;
    background:repeating-linear-gradient(
        to right,
        rgba(15,23,42,0.22),
        rgba(15,23,42,0.22) 6px,
        transparent 6px,
        transparent 12px
    );
}

.yeb-includes-title{
    font-family:'Caveat', 'Segoe Script', 'Comic Sans MS', cursive;
    font-size:28px;
    letter-spacing:0.2px;
    color:#1f2937;
    line-height:1;
}

.yeb-section-title{
    font-family:"Palatino Linotype","Book Antiqua",Palatino,serif;
    font-size:22px;
    letter-spacing:0.4px;
    color:#1f2937;
    line-height:1;
}

.yeb-description-text{
    font-family:"Palatino Linotype","Book Antiqua",Palatino,serif;
}

.yeb-product-books{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
    gap:16px;
    margin-top:18px;
}

.yeb-product-books--duo{
    grid-template-columns:repeat(2, minmax(0, 1fr));
}

.yeb-product-book-card{
    position:relative;
    border:1px solid #e2e2e2;
    border-radius:16px;
    overflow:hidden;
    background:#fff;
    display:flex;
    flex-direction:column;
    box-shadow:0 12px 24px rgba(0,0,0,0.06);
}

.yeb-product-book-card:before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(135deg, rgba(0,0,0,0.04), rgba(0,0,0,0.00));
    pointer-events:none;
    z-index:0;
}

.yeb-product-books--duo .yeb-product-book-card:nth-child(2){
    transform:none;
}

.yeb-product-book-media{
    background:#f7f7f7;
    position:relative;
    z-index:1;
    padding:12px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.yeb-product-book-media img{
    width:300px;
    height:250px;
    max-width:100%;
    margin:0 auto;
    display:block;
    object-fit:cover;
    border-radius:12px;
}

.yeb-product-book-media .yeb-cover-placeholder{
    width:300px;
    height:250px;
    max-width:100%;
    margin:0 auto;
    border-radius:12px;
}

.yeb-product-book-preview{
    align-self:stretch;
}

.yeb-product-book-body{
    padding:14px 16px 16px 16px;
    display:flex;
    flex-direction:column;
    gap:8px;
    position:relative;
    z-index:1;
}

.yeb-product-book-title{
    margin:0;
    font-size:1.05em;
}

.yeb-product-book-meta{
    font-size:.9em;
    opacity:.75;
}

.yeb-product-book-excerpt{
    margin:0;
    opacity:.85;
    font-size:.95em;
}

.yeb-product-book-more{
    margin-top:6px;
}

.yeb-product-book-more summary{
    cursor:pointer;
    font-weight:600;
}

.yeb-product-book-more[open] summary{
    margin-bottom:8px;
}

@media (max-width: 900px){
    .yeb-product-hero{
        grid-template-columns:1fr;
    }
    .yeb-cover-slider{
        height:360px;
    }
    .yeb-product-books--duo{
        grid-template-columns:1fr;
    }
    .yeb-product-books--duo .yeb-product-book-card{
        transform:none;
    }
}

/* --- Cart UI --- */
:root{
    --yeb-primary: var(--carrino-primary, var(--wp--preset--color--primary, #163b6b));
    --yeb-primary-contrast: #ffffff;
    --yeb-accent: var(--carrino-accent, var(--wp--preset--color--accent, #16a34a));
    --yeb-badge: var(--carrino-danger, var(--wp--preset--color--vivid-red, #ef4444));
    --yeb-coupon-bg: #fff7e6;
    --yeb-coupon-border: #f59e0b;
    --yeb-coupon-accent: #b45309;
    --yeb-coupon-text: #7c2d12;
}

.yeb-visually-hidden{
    border:0;
    clip:rect(0 0 0 0);
    height:1px;
    margin:-1px;
    overflow:hidden;
    padding:0;
    position:absolute;
    width:1px;
    white-space:nowrap;
}

.yeb-btn-primary{
    background:var(--yeb-primary);
    border-color:var(--yeb-primary);
    color:var(--yeb-primary-contrast) !important;
}

.yeb-btn-primary:hover{
    filter:brightness(0.96);
}

.yeb-btn-secondary{
    background:#fff;
    border-color:var(--yeb-primary);
    color:var(--yeb-primary) !important;
}
.yeb-btn-secondary:hover{
    background:var(--yeb-primary);
    color:var(--yeb-primary-contrast) !important;
}

.yeb-physical-book-cta{
    margin-top:16px;
    padding:14px 16px;
    border:1px dashed var(--yeb-primary, #1f2937);
    border-radius:10px;
    text-align:center;
}
.yeb-physical-book-cta .yeb-physical-price{
    margin:0 0 10px;
    font-size:.95rem;
    color:#374151;
}
.yeb-physical-book-cta .yeb-btn{
    width:100%;
}

.yeb-cart-wrap{
    position:fixed;
    right:22px;
    bottom:22px;
    z-index:9990;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    pointer-events:none;
}

.yeb-cart-wrap > *{
    pointer-events:auto;
}

.yeb-cart-wrap:not(.is-open) .yeb-cart-panel{
    display:none;
}

.yeb-cart-wrap.is-open .yeb-cart-fab{
    display:none;
}

.yeb-cart-panel{
    display:flex;
    flex-direction:column;
    gap:12px;
    width:min(360px, calc(100vw - 32px));
    max-height:80vh;
    background:#fff;
    border:1px solid #e6e6e6;
    border-radius:22px;
    padding:16px;
    box-shadow:0 18px 40px rgba(0,0,0,0.18);
    overflow:auto;
    overscroll-behavior:contain;
}

.yeb-cart-section{
    display:none;
    flex-direction:column;
    gap:12px;
}

.yeb-cart-section.is-active{
    display:flex;
}

.yeb-cart-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
}

.yeb-cart-title{
    font-weight:700;
    font-size:1.05em;
}

.yeb-cart-close{
    border:1px solid var(--yeb-primary);
    background:var(--yeb-primary);
    color:#fff;
    width:36px;
    height:36px;
    border-radius:12px;
    cursor:pointer;
    font-size:18px;
    line-height:34px;
}

.yeb-cart-items{
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:280px;
    overflow:auto;
    padding-right:2px;
}

.yeb-cart-item{
    display:flex;
    gap:12px;
    align-items:center;
    border:1px solid #ededed;
    border-radius:16px;
    padding:12px;
    background:#fff;
}

.yeb-cart-item-info{
    flex:1 1 auto;
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}

.yeb-cart-item-title{
    font-weight:700;
    font-size:.98em;
}

.yeb-cart-item-price{
    display:flex;
    align-items:baseline;
    gap:8px;
    font-size:.95em;
}

.yeb-cart-price-now{
    font-weight:800;
    color:var(--yeb-accent);
}

.yeb-cart-price-old{
    text-decoration:line-through;
    opacity:.6;
}

.yeb-cart-remove{
    border:1px solid var(--yeb-primary);
    background:var(--yeb-primary);
    width:36px;
    height:36px;
    border-radius:12px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.yeb-cart-remove svg{
    width:16px;
    height:16px;
    fill:#fff;
}

.yeb-cart-empty{
    text-align:center;
    opacity:.7;
    font-size:.95em;
    padding:12px 0;
}

.yeb-cart-total{
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-weight:700;
    padding-top:6px;
    border-top:1px solid #eee;
}

.yeb-cart-total--subtotal{
    border-top:0;
    padding-top:0;
}

.yeb-cart-total--payment{
    border-top:1px solid #eee;
    padding-top:6px;
}

.yeb-cart-discount{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    font-weight:600;
    font-size:.95em;
    color:#0f172a;
}

.yeb-cart-discount-label{
    display:inline-flex;
    align-items:center;
    gap:6px;
    color:#6b7280;
    font-weight:600;
}

.yeb-cart-discount-code{
    color:#0f172a;
    font-weight:700;
}

.yeb-cart-discount [data-yeb-cart-discount-value]{
    color:#b91c1c;
    font-weight:800;
}

.yeb-cart-coupon{
    display:flex;
    flex-direction:column;
    gap:8px;
    padding-top:8px;
    border:1px dashed var(--yeb-coupon-border);
    border-radius:16px;
    padding:12px;
    background:var(--yeb-coupon-bg);
}

.yeb-cart-coupon-label{
    font-size:.92em;
    font-weight:700;
    color:var(--yeb-coupon-text);
}

.yeb-cart-coupon-row{
    display:flex;
    gap:8px;
    align-items:center;
}

.yeb-cart-coupon-row input{
    flex:1 1 auto;
    max-width:170px;
    padding:8px 10px;
    border:1px solid #f3d08a;
    border-radius:10px;
    background:#fff;
    font:inherit;
    font-size:.92rem;
}

.yeb-cart-coupon-row .yeb-cart-coupon-apply{
    white-space:nowrap;
    width:36px;
    height:36px;
    padding:0;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:var(--yeb-coupon-accent);
    border-color:var(--yeb-coupon-accent);
    color:#fff !important;
    box-shadow:none;
}

.yeb-cart-coupon-status{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    font-size:.9em;
    color:var(--yeb-coupon-text);
}

.yeb-cart-coupon-status-text strong{
    font-weight:800;
}

.yeb-cart-coupon-remove{
    width:34px;
    height:34px;
    padding:0;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:var(--yeb-primary) !important;
    border-color:var(--yeb-primary) !important;
    color:#fff !important;
    box-shadow:none;
}

.yeb-cart-coupon-icon svg{
    width:16px;
    height:16px;
    fill:currentColor;
    display:block;
}

.yeb-cart-coupon-apply.is-disabled,
.yeb-cart-coupon-apply[disabled],
.yeb-cart-coupon-remove[disabled]{
    opacity:.6;
    cursor:not-allowed;
}

.yeb-cart-coupon-error{
    font-size:.9em;
    font-weight:600;
    color:#b91c1c;
}

.yeb-cart-coupon.is-loading .yeb-cart-coupon-apply{
    opacity:.7;
    cursor:progress;
}

.yeb-cart-pay-note{
    font-weight:600;
    color:#6b7280;
}

.yeb-stripe-box{
    position:relative;
    border:1px dashed #e5e7eb;
    border-radius:16px;
    padding:12px;
    background:#fbfbfb;
    min-height:180px;
}

.yeb-cart-section[data-yeb-cart-step="payment"] .yeb-stripe-box{
    max-height:360px;
    overflow-y:auto;
}

#yeb-stripe-element{
    min-height:160px;
}

.yeb-stripe-loading{
    position:absolute;
    inset:0;
    display:none;
    align-items:center;
    justify-content:center;
    background:rgba(255,255,255,0.92);
    border-radius:16px;
    font-weight:700;
    color:var(--yeb-primary);
    text-align:center;
    padding:12px;
}

.yeb-stripe-box.is-loading .yeb-stripe-loading{
    display:flex;
}

.yeb-cart-pay-error{
    color:#b91c1c;
    font-size:.92em;
    font-weight:600;
}

.yeb-cart-email input{
    width:100%;
    padding:10px 12px;
    border:1px solid #d7d7d7;
    border-radius:12px;
    background:#fff;
}

.yeb-cart-help{
    margin-top:6px;
    font-size:.9em;
    color:var(--yeb-primary);
    font-weight:600;
}

.yeb-cart-email-error{
    margin-top:6px;
    font-size:.9em;
    font-weight:600;
    color:#b91c1c;
}

.yeb-cart-actions{
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    align-items:center;
}

.yeb-cart-actions--payment{
    grid-template-columns:1fr 1fr;
}

.yeb-cart-next{
    width:100%;
    text-align:center;
}

.yeb-cart-pay{
    background:var(--yeb-accent);
    border-color:var(--yeb-accent);
    color:#fff !important;
}

.yeb-cart-panel .yeb-btn-ghost{
    border-color:var(--yeb-primary);
    color:var(--yeb-primary) !important;
    background:#fff;
    box-shadow:none;
}

.yeb-cart-panel .yeb-cart-clear,
.yeb-cart-panel .yeb-cart-back{
    background:#eef2f7 !important;
    border-color:#cbd5e1 !important;
    color:#0f172a !important;
}

.yeb-cart-panel .yeb-cart-clear:hover,
.yeb-cart-panel .yeb-cart-back:hover{
    background:#e2e8f0 !important;
}

.yeb-cart-panel .yeb-btn,
.yeb-cart-panel .yeb-cart-close,
.yeb-cart-panel .yeb-cart-remove{
    -webkit-appearance:none;
    appearance:none;
    font:inherit;
    font-size:.95rem;
    line-height:1;
    letter-spacing:normal;
    text-transform:none;
}

.yeb-cart-panel .yeb-btn{
    min-height:40px;
    padding:10px 16px;
    border-radius:12px;
    box-shadow:none;
}

.yeb-cart-panel .yeb-cart-coupon-apply,
.yeb-cart-panel .yeb-cart-coupon-remove{
    min-height:36px;
    min-width:36px;
    padding:0;
    border-radius:10px;
}

.yeb-cart-panel .yeb-cart-coupon-apply{
    background:var(--yeb-coupon-accent) !important;
    border-color:var(--yeb-coupon-accent) !important;
    color:#fff !important;
}

.yeb-cart-panel .yeb-cart-coupon-remove{
    background:var(--yeb-primary) !important;
    border-color:var(--yeb-primary) !important;
    color:#fff !important;
}

.yeb-cart-close,
.yeb-cart-remove{
    min-width:36px;
    min-height:36px;
    padding:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    border-radius:12px;
}

.yeb-cart-next.is-disabled{
    opacity:.6;
    cursor:not-allowed;
}

.yeb-cart-actions .is-disabled{
    opacity:.6;
    cursor:not-allowed;
}

.yeb-cart-steps{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    border-top:1px solid #eee;
    padding-top:8px;
    font-size:.9em;
}

.yeb-cart-step{
    display:flex;
    align-items:center;
    gap:6px;
    color:#6b7280;
    font-weight:600;
}

.yeb-cart-step.is-active{
    color:#111;
}

.yeb-step-dot{
    width:22px;
    height:22px;
    border-radius:999px;
    border:1px solid #d1d5db;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
}

.yeb-cart-step.is-active .yeb-step-dot{
    background:var(--yeb-accent);
    border-color:var(--yeb-accent);
    color:#fff;
}

.yeb-cart-done-title{
    font-weight:800;
    font-size:1.05em;
    margin-bottom:6px;
}

.yeb-cart-done-body{
    font-size:.95em;
    color:#4b5563;
}

.yeb-cart-fab{
    position:relative;
    width:58px;
    height:58px;
    border-radius:999px;
    border:0;
    background:var(--yeb-accent);
    color:#fff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 14px 28px rgba(0,0,0,0.2);
}

.yeb-cart-fab-icon svg{
    width:24px;
    height:24px;
    fill:#fff;
    display:block;
}

.yeb-cart-fab-count{
    position:absolute;
    top:-6px;
    right:-4px;
    min-width:22px;
    height:22px;
    padding:0 6px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:var(--yeb-badge);
    color:#fff;
    border-radius:999px;
    font-size:.8em;
    font-weight:700;
    box-shadow:0 6px 12px rgba(0,0,0,0.18);
}

.yeb-cart-buybox{
    margin-top:12px;
}

.yeb-cart-buybox .yeb-cart-btn{
    width:auto !important;
    text-align:center;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
}

.yeb-cart-btn{
    background:var(--yeb-primary);
    border-color:var(--yeb-primary);
    color:#fff !important;
    -webkit-appearance:none;
    appearance:none;
    font:inherit;
    font-size:.95rem;
    line-height:1;
    letter-spacing:normal;
    text-transform:none;
    padding:10px 16px;
    border-radius:12px;
}

.yeb-cart-btn[disabled]{
    opacity:.6;
    cursor:not-allowed;
}

.yeb-cart-btn.is-in-cart{
    background:#e2e8f0 !important;
    color:#64748b !important;
    border-color:#cbd5e1 !important;
    opacity:.65;
}

@media (max-width: 600px){
    .yeb-cart-wrap{
        right:12px;
        bottom:12px;
    }
    .yeb-cart-panel{
        width:min(360px, calc(100vw - 24px));
    }
    .yeb-cart-coupon-row{
        flex-direction:column;
        align-items:stretch;
    }
    .yeb-cart-coupon-row input{
        max-width:100%;
    }
}

/* --- Library --- */

/* Ensure parent containers have proper spacing when library/dashboard is present */
.entry-header:has(+ .entry-content .yeb-profile-dashboard),
.entry-header:has(+ .entry-content .yeb-library),
.entry-content:has(.yeb-profile-dashboard),
.entry-content:has(.yeb-library){
    padding-left:20px !important;
    padding-right:20px !important;
}

.yeb-library{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:12px;
    padding:4px 0 24px;
}
@media (max-width: 700px){
    .yeb-library{
        grid-template-columns:1fr;
    }
}

/* Empty state (login / no purchases) */
.yeb-lib-empty-state{
    text-align:center;
    padding:48px 20px;
}
.yeb-lib-empty-icon{
    color:#94a3b8;
    margin-bottom:16px;
}
.yeb-lib-empty-state p{
    font-size:1.05em;
    color:#475569;
    margin:0 0 20px;
}
.yeb-lib-login-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 28px;
    border-radius:999px;
    background:#0f172a;
    color:#fff !important;
    font-weight:600;
    font-size:.92em;
    text-decoration:none;
    transition:background .2s;
}
.yeb-lib-login-btn:hover{
    background:#334155;
    color:#fff !important;
    text-decoration:none;
}

/* Book card */
.yeb-lib-card{
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:16px 18px;
    background:#fff;
    box-shadow:0 1px 3px rgba(15,23,42,.04);
    transition:box-shadow .2s, border-color .2s;
}
.yeb-lib-card:hover{
    border-color:#cbd5e1;
    box-shadow:0 4px 12px rgba(15,23,42,.07);
}

/* Title */
.yeb-lib-card-title{
    margin-bottom:6px;
}
.yeb-lib-card-title a,
.yeb-lib-card-title span{
    font-weight:700;
    font-size:1em;
    color:#0f172a;
    text-decoration:none;
    line-height:1.3;
}
.yeb-lib-card-title a:hover{
    color:var(--yeb-primary,#2563eb);
}

/* Meta (date + price) */
.yeb-lib-card-meta{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px 10px;
    font-size:.8em;
    color:#64748b;
    margin-bottom:10px;
}
.yeb-lib-card-meta span+span::before{
    content:"\00b7";
    margin-right:12px;
    font-weight:700;
    color:#cbd5e1;
}

/* Downloads row */
.yeb-lib-card-downloads{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
}
.yeb-lib-card-dl-label{
    font-size:.82em;
    color:#64748b;
    font-weight:500;
}
.yeb-lib-card-empty{
    font-size:.88em;
    color:#94a3b8;
    font-style:italic;
}

/* Download button */
.yeb-lib-dl-btn{
    display:inline-flex;
    align-items:center;
    gap:5px;
    padding:7px 16px;
    border-radius:999px;
    border:1px solid #e2e8f0;
    background:#f8fafc;
    color:#0f172a;
    font-weight:700;
    font-size:.78em;
    text-decoration:none;
    letter-spacing:.02em;
    text-transform:uppercase;
    transition:all .15s ease;
}
.yeb-lib-dl-btn svg{
    flex-shrink:0;
}
.yeb-lib-dl-btn:hover{
    border-color:#0f172a;
    background:#0f172a;
    color:#fff;
}
.yeb-lib-dl-btn.is-disabled{
    opacity:.45;
    pointer-events:none;
    border-color:#e5e7eb;
    background:#f1f5f9;
    color:#94a3b8;
}

@media (max-width: 700px){
    .yeb-lib-card{
        padding:14px;
    }
    .yeb-lib-card-downloads{
        flex-direction:column;
        align-items:flex-start;
    }
}

/* Empty state spans full grid */
.yeb-lib-empty-state{
    grid-column:1 / -1;
}

/* --- Profile Dashboard --- */
.yeb-profile-dashboard{
    padding:4px 0 24px;
}

.yeb-profile-nav{
    display:flex;
    gap:0;
    border-bottom:2px solid #e5e7eb;
    margin-bottom:20px;
    padding:0;
    overflow-x:auto;
}
.yeb-profile-tab-btn{
    padding:10px 20px;
    border:none;
    background:transparent;
    font-weight:600;
    font-size:.9em;
    color:#64748b;
    cursor:pointer;
    border-bottom:2px solid transparent;
    margin-bottom:-2px;
    transition:color .2s, border-color .2s;
    white-space:nowrap;
    font-family:inherit;
}
.yeb-profile-tab-btn.is-active{
    color:#1a365d;
    border-bottom-color:#dd6b20;
}
.yeb-profile-tab-btn:hover{
    color:#1a365d;
}

.yeb-profile-panel{
    display:none;
}
.yeb-profile-panel.is-active{
    display:block;
}

/* Forms */
.yeb-profile-form{
    max-width:420px;
}
.yeb-profile-field{
    margin-bottom:16px;
}
.yeb-profile-label{
    display:block;
    font-weight:600;
    font-size:.88em;
    color:#1a365d;
    margin-bottom:6px;
}
.yeb-profile-input{
    width:100%;
    padding:10px 14px;
    border:1px solid #e2e8f0;
    border-radius:8px;
    font-size:.95em;
    font-family:inherit;
    transition:border-color .2s, box-shadow .2s;
    box-sizing:border-box;
}
.yeb-profile-input:focus{
    outline:none;
    border-color:#dd6b20;
    box-shadow:0 0 0 3px rgba(221,107,32,.1);
}
.yeb-profile-current-val{
    padding:10px 0 0;
    font-size:.95em;
    color:#475569;
}
.yeb-profile-submit{
    display:inline-flex;
    align-items:center;
    padding:10px 28px;
    border-radius:999px;
    background:#1a365d;
    color:#fff;
    font-weight:600;
    font-size:.92em;
    border:none;
    cursor:pointer;
    font-family:inherit;
    transition:background .2s;
}
.yeb-profile-submit:hover{
    background:#2d4a7a;
}
.yeb-profile-submit:disabled{
    opacity:.6;
    cursor:not-allowed;
}

/* Messages */
.yeb-profile-msg{
    padding:10px 14px;
    border-radius:8px;
    font-size:.88em;
    font-weight:500;
    margin-bottom:16px;
}
.yeb-profile-msg--ok{
    background:#ecfdf5;
    color:#065f46;
    border:1px solid #a7f3d0;
}
.yeb-profile-msg--err{
    background:#fef2f2;
    color:#991b1b;
    border:1px solid #fecaca;
}

@media (max-width: 600px){
    .yeb-profile-nav{
        gap:0;
    }
    .yeb-profile-tab-btn{
        padding:10px 14px;
        font-size:.84em;
    }
    .yeb-profile-form{
        max-width:100%;
    }
}

/* Rating */
.yeb-rating-section { margin: 24px 0; }
.yeb-rating-summary { display:flex; align-items:center; gap:10px; margin:12px 0; }
.yeb-rating-stars-lg { font-size:1.5em; line-height:1; }
.yeb-star--filled { color:#f59e0b; }
.yeb-star--empty { color:#d1d5db; }
.yeb-rating-text { font-size:.95em; opacity:.85; }
.yeb-rating-form-wrap { margin:12px 0; }
.yeb-rating-form-title { margin:0 0 6px 0; font-size:1em; font-weight:600; }
.yeb-rating-form { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.yeb-star-selector { display:flex; gap:2px; }
.yeb-star-label input[type="radio"] { position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
.yeb-star--selectable { font-size:1.8em; cursor:pointer; color:#d1d5db; transition:color .15s; line-height:1; }
.yeb-star-label input:checked ~ .yeb-star--selectable,
.yeb-star-label:has(input:checked) .yeb-star--selectable { color:#f59e0b; }
.yeb-rating-already, .yeb-rating-purchase-required { font-size:.95em; opacity:.75; margin:8px 0; }
.yeb-rating-thanks { color:#16a34a; margin:8px 0; }
.yeb-fact--rating .yeb-fact-ico svg { fill:#f59e0b; }
