/*
Theme Name:   cybermarket — Astra Child
Theme URI:    https://cybermarket.gr
Description:  Brand layer over Astra (free) for cybermarket.gr.
Author:       cybermarket.gr
Template:     astra
Version:      1.1.0
Text Domain:  cybermarket-astra
Requires at least: 6.0
Requires PHP: 8.1
*/

/* Brand tokens — brandbook §7 (approved 2026-10-12). Use the vars, never raw hex. */
:root {
    --cm-blue:       #1e5499;
    --cm-blue-deep:  #17447d;
    --cm-charcoal:   #2b2e36;
    --cm-muted:      #5d6470;
    --cm-paper:      #ffffff;
    --cm-mist:       #eef2f7;
    --cm-line:       #dfe4ea;
    --cm-marker:     #ffd84d;
    --cm-fast:       #16794a;
    --cm-fast-bg:    #e6f3ec;
    --cm-font: 'Commissioner', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --cm-wrap: 1240px;

    /* Astra global palette → brand */
    --ast-global-color-0: var(--cm-blue);
    --ast-global-color-1: var(--cm-blue-deep);
    --ast-global-color-2: var(--cm-charcoal);
    --ast-global-color-3: var(--cm-charcoal);
    --ast-global-color-4: var(--cm-paper);
    --ast-global-color-5: var(--cm-paper);
    --ast-global-color-6: var(--cm-mist);
    --ast-global-color-7: var(--cm-muted);
    --ast-global-color-8: var(--cm-charcoal);
}

/* ---------- Base ---------- */
body, button, input, select, textarea,
h1, h2, h3, h4, h5, h6, .entry-title {
    font-family: var(--cm-font);
}
body { background: var(--cm-paper); color: var(--cm-charcoal); }
h1, h2, h3, h4, .entry-title { color: var(--cm-charcoal); font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--cm-blue); }
a:hover { color: var(--cm-blue-deep); }
:focus-visible { outline: 3px solid var(--cm-marker); outline-offset: 2px; }
.cm-wrap { max-width: var(--cm-wrap); margin: 0 auto; padding: 0 16px; }
.cm-ico { width: 22px; height: 22px; flex: none; }

/* Buttons: one primary style everywhere */
.button, button.button, .wp-element-button, .ast-button,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce a.button.alt, .woocommerce button.button.alt,
.wc-block-components-button:not(.is-link) {
    background: var(--cm-blue);
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    padding: 11px 18px;
    line-height: 1.3;
}
.button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover,
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .wp-element-button:hover {
    background: var(--cm-blue-deep);
    color: #fff;
}

/* ---------- Header ---------- */
.cm-header { background: var(--cm-paper); border-bottom: 1px solid var(--cm-line); }
.cm-topbar { background: var(--cm-mist); font-size: 13px; color: var(--cm-muted); }
.cm-topbar .cm-wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; }
.cm-topbar a { color: var(--cm-charcoal); font-weight: 600; text-decoration: none; }
.cm-topbar a:hover { text-decoration: underline; }

.cm-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.cm-logo img { display: block; height: 44px; width: auto; }

.cm-search { display: flex; height: 48px; max-width: 720px; width: 100%; justify-self: center; }
.cm-search input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0 16px;
    font-size: 16px;
    color: var(--cm-charcoal);
    background: var(--cm-paper);
    border: 2px solid var(--cm-charcoal);
    border-right: 0;
    border-radius: 6px 0 0 6px;
}
.cm-search input[type="search"]::placeholder { color: var(--cm-muted); }
.cm-search input[type="search"]:focus { outline: none; border-color: var(--cm-blue); }
.cm-search button {
    display: flex; align-items: center; gap: 8px;
    height: 48px;
    padding: 0 20px;
    background: var(--cm-blue);
    color: #fff;
    border: 0;
    border-radius: 0 6px 6px 0;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}
.cm-search button:hover { background: var(--cm-blue-deep); }

.cm-actions { display: flex; gap: 6px; }
.cm-act {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 10px;
    color: var(--cm-charcoal);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
}
.cm-act:hover { background: var(--cm-mist); color: var(--cm-charcoal); }
.cm-count {
    position: absolute; top: -2px; right: 6px;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 10px;
    background: var(--cm-marker);
    color: var(--cm-charcoal);
    font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.cm-count[hidden] { display: none; }

.cm-cats { border-top: 1px solid var(--cm-line); }
.cm-cats .cm-wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cm-cats .cm-wrap::-webkit-scrollbar { display: none; }
.cm-cats a {
    flex: none;
    padding: 11px 12px;
    color: var(--cm-charcoal);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}
.cm-cats a:hover { border-bottom-color: var(--cm-blue); color: var(--cm-charcoal); }
.cm-cats .cm-cat-offers { font-weight: 700; }

@media (max-width: 860px) {
    .cm-topbar .cm-wrap > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cm-bar { grid-template-columns: 1fr auto; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
    .cm-logo img { height: 36px; }
    .cm-search { grid-column: 1 / -1; grid-row: 2; max-width: none; height: 44px; }
    .cm-search input[type="search"], .cm-search button { height: 44px; }
    .cm-search button { padding: 0 14px; }
    .cm-search button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .cm-act span:not(.cm-count) { display: none; }
    .cm-act { padding: 8px; }
}

/* ---------- Content shell ---------- */
.ast-container { max-width: var(--cm-wrap); }
.site-content > .ast-container { padding-left: 16px; padding-right: 16px; }
.ast-separate-container .ast-article-single, .ast-separate-container .ast-article-post { background: transparent; }

/* ---------- Prices: the marker ---------- */
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price, .woocommerce div.product span.price {
    color: var(--cm-charcoal);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.woocommerce ul.products li.product .price { font-size: 22px; }
.woocommerce div.product p.price, .woocommerce div.product span.price { font-size: 34px; }
.price del { color: var(--cm-muted); font-weight: 400; font-size: 0.6em; opacity: 1; }
/* A real deal (sale price) gets the highlighter stroke — the brand's one bold element */
.price ins,
.woocommerce ul.products li.product .price ins,
.woocommerce div.product p.price ins, .woocommerce div.product span.price ins {
    text-decoration: none;
    background: linear-gradient(transparent 40%, var(--cm-marker) 40%, var(--cm-marker) 88%, transparent 88%);
    padding: 0 4px;
}
.woocommerce span.onsale, .woocommerce ul.products li.product .onsale,
.woocommerce .ast-onsale-card, .ast-on-card-button.ast-onsale-card {
    background: var(--cm-charcoal);
    color: #fff;
    border-radius: 4px;
    min-height: 0; min-width: 0;
    padding: 3px 8px;
    line-height: 1.4;
    font-size: 13px;
    font-weight: 700;
    top: 10px; left: 10px; right: auto; margin: 0;
}

/* ---------- Delivery lanes ---------- */
.cm-lane {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}
.cm-lane--fast { color: var(--cm-fast); background: var(--cm-fast-bg); }
.cm-lane--economy { color: var(--cm-charcoal); background: var(--cm-mist); }

/* ---------- Product cards ---------- */
.woocommerce ul.products li.product {
    border: 1px solid var(--cm-line);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    background: var(--cm-paper);
}
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img,
.woocommerce ul.products li.product a img { border-radius: 4px; background: var(--cm-mist); }
.woocommerce ul.products li.product .astra-shop-summary-wrap { display: flex; flex-direction: column; gap: 6px; flex: 1; padding-top: 10px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--cm-charcoal); }
.woocommerce ul.products li.product .ast-woo-product-category { font-size: 12px; color: var(--cm-muted); }
.woocommerce ul.products li.product .price { margin: 0; }
.woocommerce ul.products li.product .cm-lane { align-self: flex-start; }
.woocommerce ul.products li.product .button { margin-top: auto; width: 100%; text-align: center; }
.woocommerce ul.products li.product .astra-shop-summary-wrap > .button,
.woocommerce ul.products li.product .astra-shop-summary-wrap > a.added_to_cart { margin-top: auto; }

/* ---------- Single product ---------- */
.woocommerce div.product .product_title { font-size: 28px; line-height: 1.25; }
.cm-promise {
    list-style: none;
    margin: 4px 0 20px;
    padding: 14px 16px;
    display: grid;
    gap: 6px;
    border: 1px solid var(--cm-line);
    border-radius: 8px;
    font-size: 15px;
}
.cm-promise a { color: var(--cm-charcoal); }
.woocommerce div.product form.cart .button { padding: 14px 28px; font-size: 16px; }

/* Variation swatches (free plugin) in brand colours */
.woo-variation-swatches .variable-items-wrapper .variable-item:not(.radio-variable-item) { border-radius: 6px; box-shadow: 0 0 0 1px var(--cm-line); }
.woo-variation-swatches .variable-items-wrapper .variable-item:not(.radio-variable-item).selected { box-shadow: 0 0 0 2px var(--cm-blue); }

/* ---------- Home ---------- */
.home .entry-content > * { max-width: none; }
.cm-intro { padding: 40px 0 8px; max-width: 760px; }
.cm-intro h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; margin: 0 0 14px; }
.cm-intro p { font-size: 18px; color: var(--cm-muted); margin: 0 0 20px; max-width: 60ch; }
.cm-intro__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
.cm-intro__facts b { font-weight: 700; }
.home .entry-content h2 { font-size: 22px; margin: 44px 0 16px; }
.woocommerce ul.products li.product-category { padding: 0; overflow: hidden; }
.woocommerce ul.products li.product-category a { display: block; color: var(--cm-charcoal); }
.woocommerce ul.products li.product-category .woocommerce-loop-category__title { font-size: 15px; font-weight: 600; padding: 10px 12px; margin: 0; }
.woocommerce ul.products li.product-category mark.count { background: none; color: var(--cm-muted); font-weight: 400; }

/* ---------- Footer ---------- */
.cm-footer { background: var(--cm-charcoal); color: #d6d9de; margin-top: 64px; font-size: 15px; }
.cm-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 32px; }
.cm-footer__brand img { display: block; height: 36px; width: auto; margin-bottom: 12px; }
.cm-footer h2 { color: #fff; font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.cm-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cm-footer a { color: #d6d9de; text-decoration: none; }
.cm-footer a:hover { color: #fff; text-decoration: underline; }
.cm-footer__legal { border-top: 1px solid #40444e; padding-top: 16px; padding-bottom: 20px; font-size: 13px; color: #a3a8b1; }
@media (max-width: 700px) {
    .cm-footer__grid { grid-template-columns: 1fr 1fr; }
    .cm-footer__brand { grid-column: 1 / -1; }
}

/* ---------- Empty cart: the light touch ---------- */
.woocommerce-cart .cart-empty.woocommerce-info,
.wc-block-cart__empty-cart__title { font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- Astra overrides (round 2) ---------- */
body, .ast-separate-container, .ast-plain-container, .ast-page-builder-template { background: var(--cm-paper); }
.entry-content .cm-intro__facts { margin-left: 0; }
.woocommerce ul.products li.product-category { background: var(--cm-paper); }
.woocommerce ul.products li.product-category img { background: var(--cm-mist); margin: 0; }
.woocommerce ul.products li.product-category .woocommerce-loop-category__title,
.woocommerce ul.products li.product .woocommerce-loop-category__title {
    position: static;
    background: none;
    text-transform: none;
    letter-spacing: 0;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: var(--cm-charcoal);
    padding: 10px 12px 12px;
}
.woocommerce ul.products li.product-category .woocommerce-loop-category__title .count {
    display: block; text-transform: none; font-size: 13px; font-weight: 400; color: var(--cm-muted); background: none; padding: 0;
}
/* One sale badge: ours (−X% / Προσφορά) — hide Astra's duplicate card badge */
.woocommerce .ast-onsale-card { display: none; }
.woocommerce div.product > span.onsale, .woocommerce div.product .woocommerce-product-gallery span.onsale,
.woocommerce div.product span.onsale { font-size: 14px; min-height: 0; min-width: 0; padding: 4px 10px; line-height: 1.4; top: 12px; left: 12px; }
.woocommerce div.product .woocommerce-product-details__short-description { color: var(--cm-muted); }
.entry-content ul.cm-intro__facts { margin: 0; padding: 0; }

/* ---------- Footer legal identity ---------- */
.cm-footer__legal p { margin: 0 0 4px; }
.cm-footer__legal a { color: #d6d9de; }

/* ---------- Contact / quote form ---------- */
.cm-form { display: grid; gap: 14px; max-width: 720px; margin-top: 8px; }
.cm-form label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; color: var(--cm-charcoal); }
.cm-form label small { font-weight: 400; color: var(--cm-muted); }
.cm-form input[type="text"], .cm-form input[type="email"], .cm-form input[type="tel"], .cm-form textarea {
    width: 100%; padding: 10px 12px; font: 400 16px var(--cm-font); color: var(--cm-charcoal);
    border: 1px solid #b9c0ca; border-radius: 6px; background: var(--cm-paper);
}
.cm-form input:focus, .cm-form textarea:focus { outline: 2px solid var(--cm-blue); outline-offset: 0; border-color: var(--cm-blue); }
.cm-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .cm-form__row { grid-template-columns: 1fr; } }
.cm-form .button { justify-self: start; padding: 12px 24px; }
.cm-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cm-form__msg { padding: 12px 14px; border-radius: 6px; margin: 0; }
.cm-form__msg--ok { background: var(--cm-fast-bg); color: var(--cm-fast); }
.cm-form__msg--err { background: #fdecec; color: #a12020; }
.cm-ext-img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--cm-paper); }

/* ---- 2026-10-25 site review fixes (data/website-review-2026-10-25/REVIEW.md) ---- */
/* Top bar: about/contact next to B2B (the WP menu location isn't printed by this header). */
.cm-toplinks { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end; }
@media (max-width: 640px) {
    .cm-topbar .cm-wrap > span:first-child { display: none; }  /* tagline was cut off on phones */
    .cm-topbar .cm-wrap { justify-content: center; }
    .cm-toplinks { justify-content: center; }
}
/* Category bar scrolls sideways on phones: fade at the edge so it reads as "more". */
@media (max-width: 768px) {
    .cm-cats { position: relative; }
    .cm-cats::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 32px; pointer-events: none;
                      background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--cm-paper)); }
}
/* Mobile cart/checkout: the blocks sat at -4px…354px on a 390px screen (alignwide margins). */
@media (max-width: 768px) {
    .woocommerce-cart .entry-content > .wp-block-woocommerce-cart,
    .woocommerce-checkout .entry-content > .wp-block-woocommerce-checkout {
        margin-left: 0 !important; margin-right: 0 !important; width: auto !important; max-width: 100% !important;
    }
}
/* Product titles: no mid-word hyphenation, at most 2 lines on cards. */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    -webkit-hyphens: manual; hyphens: manual; overflow-wrap: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Stock text: the default light green failed contrast. */
.woocommerce div.product .stock.in-stock { color: var(--cm-fast); font-weight: 600; }
/* Back-in-stock box in brand colours (was the plugin's lighter blue). */
.cwginstock-subscribe-form .cwginstock-panel-primary { border: 1px solid var(--cm-line) !important; border-radius: 8px; box-shadow: none; }
.cwginstock-subscribe-form .cwginstock-panel-heading { background: var(--cm-mist) !important; color: var(--cm-charcoal) !important;
    border-color: var(--cm-line) !important; font-family: var(--cm-font); }
.cwginstock-subscribe-form .cwginstock-panel-heading h4 { color: var(--cm-charcoal) !important; font-size: 1rem; }
.cwginstock-subscribe-form .cwgstock_button { background: var(--cm-blue) !important; border-color: var(--cm-blue) !important;
    color: #fff !important; font-family: var(--cm-font); border-radius: 6px; }
.cwginstock-subscribe-form .cwgstock_button:hover { background: var(--cm-blue-deep) !important; }
.cwginstock-subscribe-form input { font-family: var(--cm-font); }

/* ---- 2026-10-25 design (owner-approved): brand yellow, USP strip, cards, reading width, footer ---- */
mark.cm-marker { background: linear-gradient(transparent 55%, var(--cm-marker) 55%, var(--cm-marker) 92%, transparent 92%);
    color: inherit; padding: 0 .08em; }
.cm-lane--fast { color: var(--cm-charcoal); background: var(--cm-marker); }
.cm-intro { padding-top: 20px; }
.home .entry-content h2 { margin-top: 32px; }
.cm-usp { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 900px; }
.cm-usp li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--cm-mist); border-radius: 8px; font-size: 15px; }
.cm-usp svg { flex: none; color: var(--cm-blue); }
@media (max-width: 640px) { .cm-usp { grid-template-columns: 1fr; } }
.entry-content ul.cm-usp { margin-left: 0; }
/* Product cards: same white square image area for every product. */
.woocommerce ul.products li.product a img { aspect-ratio: 1; object-fit: contain; background: var(--cm-paper); width: 100%; }
/* Info pages: comfortable reading width. */
body.page:not(.home):not(.woocommerce-page) .entry-content > :is(p, ul, ol, h2, h3, h4, table, blockquote, figure, .wp-block-group) { max-width: 720px; }
/* Footer: payment methods + underlined links (not colour alone). */
.cm-footer__pay { padding-bottom: 16px; font-size: 14px; color: #d6d9de; }
.cm-footer__pay span { color: #fff; font-weight: 600; }
.cm-footer a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(214, 217, 222, .45); }
.cm-footer a:hover { text-decoration-color: #fff; }
