/*
Theme Name: Книги о WHIEDA
Theme URI: https://whieda-knigi.ru/
Author: WHIEDA Books
Description: Тема книжного магазина WHIEDA на WooCommerce. Без встроенных платёжных и логистических интеграций.
Version: 2.1.2
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: whieda-books
*/
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');
:root{--red:#a72d32;--ink:#454545;--muted:#6b6b6b;--line:#e7e2df}*{box-sizing:border-box}body{margin:0;background:#fff;color:var(--ink);font:400 16px/1.65 Montserrat,Arial,sans-serif}a{color:inherit}img{max-width:100%;height:auto}.wrap{max-width:1160px;margin:auto;padding:0 25px}.header{background:#fff;border-bottom:1px solid var(--line);position:relative;z-index:2}.head{display:flex;align-items:center;gap:24px;justify-content:space-between;min-height:92px}.brand{text-decoration:none;font-size:20px;font-weight:700;color:#762329;line-height:1.25}.brand small{display:block;color:#777;font-size:11px;font-weight:500;letter-spacing:.05em}.nav{display:flex;gap:20px;align-items:center;flex-wrap:wrap}.nav a{text-decoration:none;font-size:12px;font-weight:600}.nav a:hover{color:var(--red)}.cartlink{white-space:nowrap}.hero{background:linear-gradient(90deg,rgba(255,255,255,.98) 0%,rgba(255,255,255,.91) 44%,rgba(255,255,255,.24) 100%),url('assets/mountains.png') center/cover;min-height:600px}.hero-grid{display:grid;grid-template-columns:1fr 380px;align-items:center;gap:50px;padding-top:66px;padding-bottom:70px}.eyebrow{color:var(--red);font-weight:700;font-size:14px;letter-spacing:.04em}.hero h1{font-size:clamp(42px,5vw,72px);line-height:1.05;letter-spacing:-.04em;color:#86242b;margin:12px 0}.hero h2{font-size:22px;line-height:1.35;margin:14px 0 22px}.hero p{max-width:580px}.cover{max-height:480px;max-width:100%;object-fit:contain;filter:drop-shadow(15px 20px 20px #0003);display:block;margin:auto}.price{font-size:32px;font-weight:700;color:var(--red);margin:18px 0 12px}.btn,button.button,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.wp-block-button__link{background:var(--red)!important;color:white!important;border:0;border-radius:3px;padding:14px 25px;display:inline-block;text-decoration:none;font:600 14px Montserrat,Arial,sans-serif;cursor:pointer}.btn:hover,.woocommerce a.button:hover{background:#7e2026!important}.shipping{font-size:12px;color:#666;margin-top:13px}.section{padding:65px 0}.section h2{font-size:clamp(25px,3vw,38px);line-height:1.3;margin:0 0 30px}.facts{display:grid;grid-template-columns:repeat(4,1fr);gap:22px;padding-top:26px;padding-bottom:26px;border-bottom:1px solid var(--line)}.fact{font-size:14px}.fact strong{display:block;font-size:16px}.two{display:grid;grid-template-columns:repeat(2,1fr);gap:22px}.panel{background:#f5f3f0;padding:30px;border-radius:4px}.panel.dark{background:#4b4b4b;color:#fff}.panel h3{margin-top:0}.previews{display:grid;grid-template-columns:repeat(5,1fr);gap:15px}.previews img{width:100%;aspect-ratio:3/4;object-fit:cover;border:1px solid #ddd}.previews figcaption{font-size:11px;margin-top:8px}.previews figure{margin:0}.author{background:#f7f6f4}.author-grid{display:grid;grid-template-columns:1fr 1fr;gap:50px;align-items:center}.author h2{margin-bottom:15px}.catalog-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:25px}.catalog-item{border:1px solid #eee;padding:20px}.catalog-item img{height:260px;object-fit:contain;width:100%}.catalog-item h3{font-size:15px;line-height:1.5}.footer{background:#f5f4f2;padding:36px 0;color:#555;font-size:12px}.footer a{margin-right:15px}.content{padding:40px 0 70px}.woocommerce div.product .product_title{font-size:30px}.woocommerce div.product p.price,.woocommerce div.product span.price{color:var(--red);font-weight:700}.woocommerce ul.products li.product .price{color:var(--red)}.woocommerce .quantity .qty{padding:10px;width:80px}.woocommerce-message{border-top-color:var(--red)}.woocommerce-info{border-top-color:#777}.woocommerce .woocommerce-breadcrumb{margin:20px 0}h1,h2,h3,h4{font-weight:600}.notice{font-size:12px;color:#777}.footer-links{margin-top:12px}@media(max-width:820px){.head{flex-direction:column;padding-top:15px;padding-bottom:15px;gap:12px}.nav{justify-content:center;gap:12px}.hero-grid{grid-template-columns:1fr;gap:15px}.hero{background-position:65% center}.cover{max-height:370px}.facts{grid-template-columns:repeat(2,1fr)}.previews{grid-template-columns:repeat(3,1fr)}.two,.author-grid{grid-template-columns:1fr}}@media(max-width:500px){.previews{grid-template-columns:repeat(2,1fr)}.hero-grid{padding-top:35px}.hero h1{font-size:45px}}

/* 1.1: responsive hero and tidy WooCommerce catalog */
:root{--whieda-title-size:20px;--whieda-body-size:16px;--whieda-heading-size:38px}
body{font-size:var(--whieda-body-size)}
.hero{background-image:linear-gradient(90deg,rgba(255,255,255,.98) 0%,rgba(255,255,255,.90) 39%,rgba(255,255,255,.20) 100%),url('assets/mountains.png');background-size:cover,auto 100%;background-repeat:no-repeat;background-position:center,right center;background-color:#fbf9f6}
.hero-grid{grid-template-columns:minmax(0,1fr) minmax(260px,370px);gap:32px}
.section h2{font-size:clamp(25px,3vw,var(--whieda-heading-size))}
.woocommerce ul.products{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;margin:0!important}
.woocommerce ul.products::before,.woocommerce ul.products::after{display:none!important}
.woocommerce ul.products li.product{float:none!important;width:auto!important;margin:0!important;min-width:0;text-align:left}
.woocommerce ul.products li.product a img{width:100%;height:260px;object-fit:contain;margin:0 0 14px}
.woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:var(--whieda-title-size)!important;line-height:1.35!important;font-weight:600!important;text-align:left!important;overflow-wrap:break-word;hyphens:auto;padding:0!important;margin:0 0 12px!important}
.woocommerce ul.products li.product .price{font-size:22px!important;line-height:1.3;margin-bottom:12px}
.woocommerce ul.products li.product .button{margin-top:8px}
@media(max-width:950px){.woocommerce ul.products{grid-template-columns:repeat(3,minmax(0,1fr))}.hero{background-position:center,75% center}}
@media(max-width:700px){.woocommerce ul.products{grid-template-columns:repeat(2,minmax(0,1fr))}.hero-grid{grid-template-columns:1fr}.hero{background-size:cover,auto 100%;background-position:center,70% center}}
@media(max-width:440px){.woocommerce ul.products{grid-template-columns:1fr 1fr;gap:14px}.woocommerce ul.products li.product a img{height:180px}.woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:clamp(14px,3.6vw,var(--whieda-title-size))!important}.woocommerce ul.products li.product .price{font-size:18px!important}}

/* 1.2: restored approved composition, real book spreads and real author portrait */
.wh-home .hero{background-position:center,right center;background-size:cover,auto 100%;min-height:510px}
.wh-home .hero-grid{grid-template-columns:minmax(0,1fr) minmax(230px,330px);padding-top:38px;padding-bottom:38px;gap:28px;max-width:1080px}
.wh-home .hero-copy{max-width:540px}.wh-home .hero h1{font-size:clamp(58px,6vw,90px);margin:4px 0}.wh-home .hero h2{font-size:clamp(22px,2.4vw,30px);margin:5px 0 12px}.wh-home .hero .notice{font-weight:700;letter-spacing:.12em}.wh-home .hero-description{max-width:450px;border-left:3px solid #d71920;padding-left:12px}.wh-home .hero-actions{display:flex;gap:15px;align-items:center;flex-wrap:wrap}.wh-home .hero-actions .price{margin:0;font-size:30px}.wh-home .hero-cover-link{display:block}.wh-home .cover{max-height:420px}.wh-home .shipping{display:inline-block;background:#fff1d8;padding:8px 14px;border-radius:30px;color:#9b252a;font-weight:600}
.wh-home .facts{gap:10px}.wh-home .fact{display:flex;gap:12px;align-items:center;line-height:1.4}.wh-home .fact-icon{font-size:36px;color:#d71920;line-height:1}.wh-home .fact strong{font-size:15px}.wh-home .fact span:not(.fact-icon){display:block;font-size:12px}
.wh-home .section{padding-top:40px;padding-bottom:40px}.wh-home .audience h2,.wh-home .book-contents h2{text-align:center}.wh-home .audience .panel{display:flex;gap:18px;border-radius:16px;background:#faf1ec;padding:24px 28px}.wh-home .audience .panel-icon{font-size:48px;color:#d71920;line-height:1}.wh-home .audience h3{font-size:20px;line-height:1.2}.wh-home .audience ul{list-style:none;padding:0;margin:0}.wh-home .audience li{position:relative;padding-left:17px;font-size:13px;line-height:1.6}.wh-home .audience li:before{content:'';position:absolute;left:0;top:.62em;width:7px;height:7px;border-radius:2px;background:#d71920}
.wh-home .real-spreads{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.wh-home .real-spreads figure{margin:0;min-width:0}.wh-home .real-spreads img{display:block;width:100%;height:220px;object-fit:contain;background:#faf7f3;box-shadow:0 4px 10px #0002}.wh-home .real-spreads figcaption{display:flex;align-items:center;gap:10px;background:#fbf2ec;border-radius:12px;padding:12px 10px;margin-top:12px;min-height:70px;font-size:13px;font-weight:600;line-height:1.4}.wh-home .real-spreads figcaption span{font-size:30px;color:#d71920}.wh-home .spread-note{text-align:center;color:#777;font-size:12px}.wh-home .book-contents>.btn{display:table;margin:20px auto 0}
.wh-home .author{background:#f8f5f2}.wh-home .author-new{display:grid;grid-template-columns:155px minmax(0,1fr) 270px;align-items:center;gap:25px}.wh-home .author-portrait{width:150px;height:150px;border-radius:50%;object-fit:cover;object-position:center 21%;border:5px solid white;box-shadow:0 0 0 1px #ded8d5}.wh-home .author-kicker{color:#8d2026;font-size:13px;font-weight:700;letter-spacing:.12em}.wh-home .author h2{font-size:28px;margin:2px 0 6px}.wh-home .author p{font-size:13px;line-height:1.45;margin:5px 0}.wh-home .author-cta{text-align:center}.wh-home .benefits{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;padding-top:22px;padding-bottom:22px;border-bottom:1px solid #eee}.wh-home .benefits>div{display:flex;align-items:center;gap:12px;font-size:11px;line-height:1.5}.wh-home .benefits span{font-size:34px;color:#d71920;line-height:1}
@media(max-width:850px){.wh-home .hero-grid{grid-template-columns:minmax(0,1fr) minmax(180px,260px)}.wh-home .author-new{grid-template-columns:120px 1fr}.wh-home .author-portrait{width:115px;height:115px}.wh-home .author-cta{grid-column:2}.wh-home .benefits{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.wh-home .hero-grid{grid-template-columns:1fr}.wh-home .hero{background-position:center,65% center}.wh-home .cover{max-height:330px}.wh-home .facts{grid-template-columns:repeat(2,1fr)}.wh-home .audience .two{grid-template-columns:1fr}.wh-home .real-spreads{grid-template-columns:1fr}.wh-home .real-spreads img{height:auto;max-height:330px}.wh-home .author-new{grid-template-columns:100px 1fr;gap:14px}.wh-home .author-portrait{width:100px;height:100px}.wh-home .author h2{font-size:22px}.wh-home .author-cta{grid-column:1/-1}.wh-home .benefits{grid-template-columns:1fr 1fr}}

/* 1.3: four genuine spreads and approved contrasting audience panel */
.wh-home .audience .panel.dark{background:#4b4b4b;color:#fff}
.wh-home .audience .panel.dark h3,.wh-home .audience .panel.dark li{color:#fff}
.wh-home .real-spreads{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.wh-home .real-spreads img{height:185px}
.wh-home .real-spreads figcaption{font-size:12px;min-height:78px}
@media(max-width:900px){.wh-home .real-spreads{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.wh-home .real-spreads{grid-template-columns:1fr}.wh-home .real-spreads img{height:auto;max-height:330px}}

/* 1.4: agreed copy, catalog legibility, delivery pictogram and legal links */
.wh-home .shipping{display:inline-flex;align-items:center;gap:8px}.wh-home .delivery-truck{display:inline-flex;color:#d71920;flex:none}
.wh-home .facts{gap:18px}.wh-home .fact{align-items:flex-start}.wh-home .fact strong{font-size:16px;line-height:1.35}.wh-home .fact span:not(.fact-icon){font-size:13px;line-height:1.45;margin-top:4px}
.wh-home .benefits>div{font-size:15px;line-height:1.45;gap:12px}.wh-home .benefits span{font-size:32px;flex:none}
.wh-home #catalog .woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:15px!important;line-height:1.55!important;hyphens:none!important;overflow-wrap:normal!important;word-break:normal!important;max-width:100%;text-wrap:pretty}
.wh-home #catalog .woocommerce ul.products li.product .woocommerce-loop-product__title::first-line{font-weight:700}
.wh-home #catalog .woocommerce ul.products{grid-template-columns:repeat(3,minmax(0,1fr))}
.wh-home #catalog .woocommerce ul.products li.product{max-width:330px}
.legal-links{display:flex;flex-wrap:wrap;gap:8px 18px;margin:16px 0}.legal-links a{margin:0}.seller-details{font-weight:600}
@media(max-width:900px){.wh-home #catalog .woocommerce ul.products{grid-template-columns:repeat(2,minmax(0,1fr))}.wh-home .benefits>div{font-size:14px}}
@media(max-width:550px){.wh-home #catalog .woocommerce ul.products{grid-template-columns:1fr}.wh-home .benefits{grid-template-columns:1fr}.wh-home .facts{grid-template-columns:1fr 1fr}.wh-home .fact span:not(.fact-icon){font-size:12px}}

/* 1.6: new pages and content management */
.content article{max-width:100%;overflow-wrap:break-word}.content .wp-block-image img{height:auto}.content .wp-block-columns{gap:24px}.legal-links .menu-item{list-style:none}.legal-links a{text-decoration:underline}.wh-home .benefits>div{overflow-wrap:anywhere}.whq-prices{padding:12px 15px;margin:12px 0;background:#faf4f0;border-left:3px solid #a72d32;line-height:1.8}


/* 1.7 — WooCommerce single product gallery only. Home page is unchanged. */
body.single-product .content {padding-top:30px}
body.single-product .woocommerce div.product {display:flow-root}
body.single-product .woocommerce div.product div.images,
body.single-product .woocommerce div.product div.summary {box-sizing:border-box;min-width:0}
body.single-product .woocommerce div.product div.images {width:45%;max-width:490px;margin:0 0 36px;float:left;clear:none}
body.single-product .woocommerce div.product div.summary {width:51%;float:right;clear:none;margin:0 0 36px}
body.single-product .woocommerce div.product .woocommerce-product-gallery {overflow:hidden}
body.single-product .woocommerce div.product .woocommerce-product-gallery__wrapper {margin:0!important}
body.single-product .woocommerce div.product .woocommerce-product-gallery__image {text-align:center;background:#faf8f6}
body.single-product .woocommerce div.product .woocommerce-product-gallery__image a {display:flex;align-items:center;justify-content:center;min-height:0;overflow:hidden}
body.single-product .woocommerce div.product .woocommerce-product-gallery__image img {display:block!important;width:100%!important;max-width:100%!important;height:420px!important;object-fit:contain!important;object-position:center;margin:0 auto!important}
/* Flexslider makes one slide visible. This fallback also handles galleries before JS starts. */
body.single-product .woocommerce div.product .woocommerce-product-gallery__wrapper:not(.slides) > .woocommerce-product-gallery__image:not(:first-child) {display:none}
body.single-product .woocommerce div.product .flex-viewport {overflow:hidden!important}
body.single-product .woocommerce div.product .flex-viewport .woocommerce-product-gallery__image {float:left}
body.single-product .woocommerce div.product .flex-control-thumbs {display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;list-style:none!important;margin:14px 0 0!important;padding:0!important;clear:both}
body.single-product .woocommerce div.product .flex-control-thumbs li {float:none!important;width:100%!important;min-width:0;margin:0!important;padding:0!important;list-style:none!important}
body.single-product .woocommerce div.product .flex-control-thumbs li img {display:block!important;width:100%!important;height:94px!important;object-fit:contain!important;object-position:center;background:#faf8f6;border:1px solid #e5ded9;border-radius:5px;padding:4px;opacity:.75;cursor:pointer;transition:opacity .2s,border-color .2s}
body.single-product .woocommerce div.product .flex-control-thumbs li img.flex-active,
body.single-product .woocommerce div.product .flex-control-thumbs li img:hover {opacity:1;border-color:#a72d32}
body.single-product .woocommerce div.product .product_title {font-size:clamp(23px,2.6vw,32px);line-height:1.3}
body.single-product .woocommerce div.product .woocommerce-tabs {clear:both;padding-top:18px}
body.single-product .woocommerce div.product .woocommerce-tabs ul.tabs {padding-left:0}
body.single-product .woocommerce div.product .product_meta {font-size:13px;color:#777}
@media(max-width:850px){
 body.single-product .woocommerce div.product div.images {width:47%}
 body.single-product .woocommerce div.product div.summary {width:49%}
 body.single-product .woocommerce div.product .woocommerce-product-gallery__image img {height:350px!important}
 body.single-product .woocommerce div.product .flex-control-thumbs li img {height:72px!important}
}
@media(max-width:650px){
 body.single-product .woocommerce div.product div.images,
 body.single-product .woocommerce div.product div.summary {width:100%;max-width:none;float:none;clear:both}
 body.single-product .woocommerce div.product .woocommerce-product-gallery__image img {height:360px!important}
 body.single-product .woocommerce div.product .flex-control-thumbs li img {height:82px!important}
}

/* 1.8: self-contained WooCommerce gallery; no FlexSlider dependency. */
body.single-product .woocommerce div.product div.images:has(.whieda-product-gallery) {width:45%;max-width:490px;float:left;margin:0 0 35px;opacity:1!important}
body.single-product .woocommerce div.product div.summary {width:51%;float:right}
.whieda-product-gallery {width:100%;max-width:100%;clear:both}
.whieda-product-gallery__main-link {display:flex;align-items:center;justify-content:center;width:100%;height:390px;padding:15px;background:#faf8f6;border:1px solid #eee6e1;border-radius:8px;overflow:hidden}
body.single-product .woocommerce div.product div.images .whieda-product-gallery__main {display:block;width:100%;height:100%;max-width:100%;object-fit:contain;object-position:center;margin:0;box-shadow:none}
.whieda-product-gallery__thumbs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}
body.single-product .woocommerce div.product div.images button.whieda-product-gallery__thumb {display:flex;align-items:center;justify-content:center;min-width:0;height:92px;padding:5px;border:1px solid #e1d9d3;border-radius:6px;background:#faf8f6;cursor:pointer;box-shadow:none}
body.single-product .woocommerce div.product div.images button.whieda-product-gallery__thumb.is-active,body.single-product .woocommerce div.product div.images button.whieda-product-gallery__thumb:focus-visible {border:2px solid #a72d32;outline-offset:2px}
body.single-product .woocommerce div.product div.images .whieda-product-gallery__thumb img {display:block;width:100%;height:100%;object-fit:contain;max-width:100%;margin:0;opacity:1}
.whieda-product-gallery__hint {font-size:12px;line-height:1.5;color:#666;margin:10px 0 0}
@media(max-width:850px){.whieda-product-gallery__main-link{height:330px}body.single-product .woocommerce div.product div.images button.whieda-product-gallery__thumb{height:75px}}
@media(max-width:650px){body.single-product .woocommerce div.product div.images:has(.whieda-product-gallery),body.single-product .woocommerce div.product div.summary{width:100%;max-width:none;float:none;clear:both}.whieda-product-gallery__main-link{height:340px}body.single-product .woocommerce div.product div.images button.whieda-product-gallery__thumb{height:78px}}

/* WHIEDA 1.9 — gallery dimensions controlled through Appearance > Customize.
   The image is always contained (never cropped); width is bounded on small screens. */
body.single-product .woocommerce div.product div.images:has(.whieda-product-gallery),
body.single-product .woocommerce div.product .woocommerce-product-gallery:has(.whieda-product-gallery) {
    width: min(100%, var(--whieda-gallery-width, 440px)) !important;
    max-width: min(100%, var(--whieda-gallery-width, 440px)) !important;
    box-sizing: border-box !important;
}
body.single-product .woocommerce div.product div.images .whieda-product-gallery,
body.single-product .whieda-product-gallery {
    width: 100% !important;
    max-width: var(--whieda-gallery-width, 440px) !important;
    box-sizing: border-box !important;
}
body.single-product .woocommerce div.product div.images .whieda-product-gallery__main-link,
body.single-product .whieda-product-gallery__main-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: var(--whieda-gallery-height, 520px) !important;
    max-height: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}
body.single-product .woocommerce div.product div.images img.whieda-product-gallery__main,
body.single-product img.whieda-product-gallery__main {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
}
body.single-product .whieda-product-gallery__thumbs {
    display: grid !important;
    grid-template-columns: repeat(var(--whieda-gallery-columns, 4), minmax(0, 1fr)) !important;
}
@media(max-width:650px){
    body.single-product .woocommerce div.product div.images:has(.whieda-product-gallery) {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }
    body.single-product .whieda-product-gallery__main-link {
        height: min(var(--whieda-gallery-height, 520px), 75vh) !important;
    }
}

/* 2.1.1: uncropped catalog covers and custom icons */
.woocommerce ul.products li.product a img{object-fit:contain!important;object-position:center!important;width:100%;height:var(--wh211-cover-height,260px)!important;max-height:none!important;max-width:var(--wh211-cover-width,100%)!important;aspect-ratio:auto!important;display:block;margin:0 auto 14px!important}
.wh-home #catalog .woocommerce ul.products li.product{max-width:none}
.wh211-icon{display:block;width:36px;height:36px;object-fit:contain;flex:none}
@media(max-width:550px){.woocommerce ul.products li.product a img{height:min(var(--wh211-cover-height,260px),220px)!important}}

/* 2.1.2: visible catalog cart link. */
.woocommerce ul.products li.product a.added_to_cart { display:inline-block; margin:8px 0 0; padding:8px 12px; color:var(--red); border:1px solid var(--red); border-radius:3px; font-weight:600; text-decoration:none; line-height:1.4; }
.woocommerce ul.products li.product a.added_to_cart:hover { background:var(--red); color:#fff; }
