/*
Theme Name: Transmatik
Theme URI: https://transmatik.ua
Author: Transmatik
Author URI: https://transmatik.ua
Description: Інтернет-магазин запчастин для АКПП та КПП
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: transmatik
Tags: woocommerce, e-commerce, automotive
*/

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, Arial, sans-serif; background: #fff; color: #111; font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* ===== VARIABLES ===== */
:root {
  --red: #c0392b;
  --red-dark: #a93226;
  --black: #111;
  --bg-warm: #f2ede8;
  --bg-light: #f8f5f0;
  --border: #ece8e2;
}

/* ===== TOPBAR ===== */
.tm-topbar {
  background: var(--red);
  padding: 7px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tm-topbar__info { font-size: 11px; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 8px; }
.tm-topbar__dot { width: 5px; height: 5px; background: rgba(255,255,255,.4); border-radius: 50%; }
.tm-topbar__phones { display: flex; gap: 20px; }
.tm-topbar__phones a { font-size: 12px; color: #fff; font-weight: 700; }
.tm-topbar__phones a:hover { opacity: .8; }
.tm-topbar__socials { display: flex; gap: 8px; }
.tm-topbar__social { width: 24px; height: 24px; background: rgba(255,255,255,.15); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; cursor: pointer; font-weight: 700; transition: background .2s; }
.tm-topbar__social:hover { background: rgba(255,255,255,.3); }

/* ===== HEADER / NAV ===== */
.tm-header {
  background: #fff;
  padding: 0 40px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.tm-logo { display: flex; align-items: center; gap: 14px; }
.tm-logo__icon { width: 44px; height: 44px; background: var(--black); border-radius: 9px; display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; }
.tm-logo__icon::after { content: ''; position: absolute; bottom: -3px; right: -3px; width: 14px; height: 14px; background: var(--red); border-radius: 4px; border: 2px solid #fff; }
.tm-logo__icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tm-logo__text { font-size: 20px; font-weight: 900; letter-spacing: 2px; color: var(--black); line-height: 1; }
.tm-logo__text span { color: var(--red); }
.tm-logo__sub { font-size: 9px; color: #bbb; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }

.tm-nav { display: flex; background: var(--bg-light); border-radius: 12px; padding: 5px; border: 1px solid var(--border); }
.tm-nav a { font-size: 13px; font-weight: 600; color: #888; padding: 8px 18px; border-radius: 8px; transition: all .2s; white-space: nowrap; }
.tm-nav a:hover, .tm-nav a.current-menu-item { background: #fff; color: var(--black); box-shadow: 0 1px 6px rgba(0,0,0,.1); }

.tm-header__right { display: flex; gap: 10px; align-items: center; }
.tm-btn-catalog { background: var(--black); color: #fff; border: none; padding: 11px 20px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .2s; }
.tm-btn-catalog:hover { background: #222; }
.tm-btn-catalog__icon { width: 18px; height: 18px; background: var(--red); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.tm-cart-btn { background: var(--red); color: #fff; border: none; padding: 11px 20px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: background .2s; }
.tm-cart-btn:hover { background: var(--red-dark); }
.tm-cart-count { background: var(--black); color: #fff; font-size: 9px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ===== SEARCH BAR ===== */
.tm-searchbar { background: var(--bg-light); border-bottom: 2px solid var(--border); padding: 14px 40px; display: flex; gap: 16px; align-items: center; }
.tm-searchbar__label { font-size: 10px; font-weight: 700; color: #bbb; letter-spacing: 2px; text-transform: uppercase; white-space: nowrap; }
.tm-searchbar form { flex: 1; display: flex; background: #fff; border-radius: 10px; overflow: hidden; border: 2px solid #e8e3dc; transition: border-color .2s; }
.tm-searchbar form:focus-within { border-color: var(--red); }
.tm-searchbar input { flex: 1; background: transparent; border: none; padding: 11px 18px; font-size: 13px; color: var(--black); outline: none; }
.tm-searchbar input::placeholder { color: #ccc; }
.tm-searchbar button { background: var(--red); color: #fff; border: none; padding: 0 24px; font-size: 12px; font-weight: 700; cursor: pointer; }

/* ===== HERO ===== */
.tm-hero { display: grid; grid-template-columns: 1fr 320px; background: #fff; }
.tm-hero__main { padding: 52px 44px; border-right: 2px solid var(--border); position: relative; overflow: hidden; }
.tm-hero__pattern { position: absolute; top: 0; right: 0; bottom: 0; width: 180px; background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--bg-light) 10px, var(--bg-light) 11px); pointer-events: none; }
.tm-hero__tag { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.tm-hero__tag-dot { width: 5px; height: 5px; background: var(--red); border-radius: 50%; }
.tm-hero__tag span { font-size: 10px; color: #bbb; font-weight: 600; letter-spacing: .5px; }
.tm-hero h1 { font-size: 50px; font-weight: 900; color: var(--black); line-height: 1.0; margin-bottom: 18px; letter-spacing: -2.5px; position: relative; z-index: 1; }
.tm-hero h1 em { color: var(--red); font-style: normal; display: block; }
.tm-hero h1 em::after { content: ''; display: block; width: 64px; height: 5px; background: var(--red); border-radius: 3px; margin-top: 8px; }
.tm-hero__desc { font-size: 14px; color: #777; line-height: 1.75; margin-bottom: 30px; max-width: 420px; position: relative; z-index: 1; }
.tm-hero__checks { display: flex; flex-direction: column; gap: 12px; margin-bottom: 34px; position: relative; z-index: 1; }
.tm-hero__check { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: #555; line-height: 1.4; }
.tm-hero__check-icon { width: 22px; height: 22px; background: #fef2f2; border: 1px solid #f5c5c5; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tm-hero__check-icon::after { content: ''; width: 10px; height: 10px; background: var(--red); border-radius: 2px; }
.tm-hero__btns { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.tm-btn-main { background: var(--black); color: #fff; border: none; padding: 14px 28px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; transition: background .2s; }
.tm-btn-main:hover { background: #222; color: #fff; }
.tm-btn-main__arr { width: 22px; height: 22px; background: var(--red); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.tm-btn-sec { background: var(--bg-light); color: #777; border: 2px solid var(--border); padding: 14px 22px; border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; transition: all .2s; }
.tm-btn-sec:hover { border-color: var(--red); color: var(--red); }

/* ===== HERO SIDEBAR ===== */
.tm-hero__side { background: var(--bg-light); padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.tm-widget { background: #fff; border-radius: 12px; padding: 18px; border: 1px solid var(--border); }
.tm-widget__title { font-size: 10px; font-weight: 700; color: #bbb; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.tm-widget__title::before { content: ''; width: 14px; height: 3px; background: var(--red); border-radius: 2px; flex-shrink: 0; }
.tm-cat-list { display: flex; flex-direction: column; gap: 2px; }
.tm-cat-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .2s; }
.tm-cat-row:hover { background: #fef2f2; }
.tm-cat-row:hover .tm-cat-row__name { color: var(--red); }
.tm-cat-row__left { display: flex; align-items: center; gap: 8px; }
.tm-cat-row__name { font-size: 12px; font-weight: 600; color: #444; transition: color .2s; }
.tm-cat-row__count { font-size: 10px; color: #bbb; background: #f5f5f5; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.tm-contact-widget { background: var(--black); border-radius: 12px; padding: 18px; }
.tm-contact-widget__title { font-size: 10px; font-weight: 700; color: #333; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; }
.tm-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.tm-contact-item:last-of-type { margin: 0; }
.tm-contact-item__icon { width: 28px; height: 28px; background: #1a1a1a; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; border: 1px solid #222; }
.tm-contact-item__text { font-size: 12px; color: #555; line-height: 1.4; }
.tm-contact-item__text strong { display: block; color: #fff; font-size: 13px; font-weight: 700; }
.tm-contact-btn { background: var(--red); color: #fff; border: none; width: 100%; padding: 10px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; margin-top: 14px; letter-spacing: .5px; transition: background .2s; }
.tm-contact-btn:hover { background: var(--red-dark); }

/* ===== STATS BAR ===== */
.tm-stats { background: var(--black); display: grid; grid-template-columns: repeat(3, 1fr); border-top: 4px solid var(--red); }
.tm-stat { padding: 22px 32px; border-right: 1px solid #1e1e1e; display: flex; align-items: center; gap: 16px; }
.tm-stat:last-child { border: none; }
.tm-stat__icon { width: 44px; height: 44px; background: #1a1a1a; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; border: 1px solid #252525; }
.tm-stat__num { font-size: 24px; font-weight: 900; color: #fff; line-height: 1; }
.tm-stat__label { font-size: 10px; color: #444; margin-top: 4px; letter-spacing: .5px; text-transform: uppercase; }

/* ===== SECTION ===== */
.tm-section { padding: 48px 40px; }
.tm-section--alt { background: var(--bg-warm); }
.tm-section--white { background: #fff; }
.tm-section__top { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.tm-section__label { font-size: 10px; font-weight: 700; color: var(--red); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.tm-section__title { font-size: 26px; font-weight: 900; color: var(--black); letter-spacing: -1px; }
.tm-section__link { font-size: 12px; color: #888; font-weight: 600; border-bottom: 1px solid #ddd; padding-bottom: 2px; transition: color .2s; }
.tm-section__link:hover { color: var(--red); border-color: var(--red); }

/* ===== PRODUCT GRID (WooCommerce) ===== */
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 16px !important; margin: 0 !important; padding: 0 !important; list-style: none !important; }
.woocommerce ul.products li.product { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); transition: all .25s; margin: 0 !important; padding: 0 !important; }
.woocommerce ul.products li.product:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.1); }
.woocommerce ul.products li.product .woocommerce-loop-product__link { display: block; }
.woocommerce ul.products li.product img { height: 160px; object-fit: cover; width: 100%; border-bottom: 1px solid var(--border); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 13px !important; font-weight: 700 !important; color: var(--black) !important; padding: 14px 16px 4px !important; margin: 0 !important; line-height: 1.4 !important; }
.woocommerce ul.products li.product .price { font-size: 18px !important; font-weight: 900 !important; color: var(--black) !important; padding: 0 16px !important; display: block; }
.woocommerce ul.products li.product .price del { font-size: 11px !important; color: #ccc !important; font-weight: 400 !important; }
.woocommerce ul.products li.product .price ins { text-decoration: none !important; }
.woocommerce ul.products li.product a.button { background: var(--black) !important; color: #fff !important; border: none !important; border-radius: 8px !important; font-size: 12px !important; font-weight: 700 !important; padding: 9px 14px !important; margin: 10px 16px 16px !important; display: block !important; text-align: center !important; transition: background .2s !important; }
.woocommerce ul.products li.product a.button:hover { background: var(--red) !important; }
.woocommerce ul.products li.product .onsale { background: var(--red) !important; border-radius: 4px !important; font-size: 10px !important; font-weight: 700 !important; top: 10px !important; left: 10px !important; min-height: auto !important; min-width: auto !important; padding: 3px 10px !important; line-height: 1.4 !important; }

/* ===== BRANDS BAR ===== */
.tm-brands { background: #fff; border-bottom: 1px solid var(--border); padding: 18px 40px; display: flex; align-items: center; gap: 24px; }
.tm-brands__label { font-size: 10px; font-weight: 700; color: #bbb; letter-spacing: 2px; text-transform: uppercase; white-space: nowrap; }
.tm-brands__list { display: flex; gap: 28px; flex-wrap: wrap; }
.tm-brands__item { font-size: 12px; font-weight: 900; color: #ccc; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; transition: color .2s; }
.tm-brands__item:hover { color: var(--red); }

/* ===== PAGE HEADER ===== */
.tm-page-header { background: var(--black); padding: 36px 40px; border-bottom: 4px solid var(--red); position: relative; overflow: hidden; }
.tm-page-header__bg { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); font-size: 120px; opacity: .05; font-weight: 900; color: #fff; user-select: none; }
.tm-breadcrumb { font-size: 11px; color: #444; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.tm-breadcrumb a { color: var(--red); }
.tm-breadcrumb a:hover { text-decoration: underline; }
.tm-page-header h1 { font-size: 32px; font-weight: 900; color: #fff; letter-spacing: -1px; position: relative; z-index: 1; }
.tm-page-header p { font-size: 14px; color: #555; margin-top: 6px; position: relative; z-index: 1; }

/* ===== FOOTER ===== */
.tm-footer { background: var(--black); padding: 48px 40px 24px; }
.tm-footer__top { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.tm-footer__brand-name { font-size: 20px; font-weight: 900; letter-spacing: 2px; color: #fff; margin-bottom: 10px; }
.tm-footer__brand-name span { color: var(--red); }
.tm-footer__desc { font-size: 13px; color: #444; line-height: 1.7; margin-bottom: 16px; }
.tm-footer__phones a { display: block; font-size: 13px; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.tm-footer__col h4 { font-size: 10px; font-weight: 700; color: #444; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #1e1e1e; }
.tm-footer__col a { display: block; font-size: 13px; color: #444; margin-bottom: 10px; transition: color .2s; }
.tm-footer__col a:hover { color: var(--red); }
.tm-footer__bottom { border-top: 1px solid #1e1e1e; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tm-footer__copy { font-size: 12px; color: #333; }
.tm-footer__badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 5px 14px; border-radius: 6px; }
.tm-footer__socials { display: flex; gap: 8px; }
.tm-social-btn { width: 32px; height: 32px; background: #1a1a1a; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #444; font-size: 12px; font-weight: 700; border: 1px solid #222; transition: all .2s; cursor: pointer; }
.tm-social-btn:hover { background: var(--red); color: #fff; }

/* ===== SCROLL TOP ===== */
.tm-scroll-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; background: var(--red); color: #fff; border: none; border-radius: 12px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(192,57,43,.4); transition: all .3s; z-index: 200; opacity: 0; pointer-events: none; }
.tm-scroll-top.visible { opacity: 1; pointer-events: all; }
.tm-scroll-top:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ===== WOOCOMMERCE SINGLE PRODUCT ===== */
.woocommerce div.product { padding: 40px; }
.woocommerce div.product .product_title { font-size: 28px; font-weight: 900; color: var(--black); letter-spacing: -1px; }
.woocommerce div.product .price { font-size: 32px; font-weight: 900; color: var(--black); }
.woocommerce div.product .single_add_to_cart_button { background: var(--red) !important; color: #fff !important; border: none !important; border-radius: 10px !important; padding: 14px 32px !important; font-size: 15px !important; font-weight: 700 !important; transition: background .2s !important; }
.woocommerce div.product .single_add_to_cart_button:hover { background: var(--red-dark) !important; }

/* ===== WOOCOMMERCE CART & CHECKOUT ===== */
.woocommerce .cart-collaterals, .woocommerce #customer_details { padding: 0 40px 40px; }
.woocommerce table.shop_table { border-radius: 12px; overflow: hidden; border: 1px solid var(--border) !important; }
.woocommerce table.shop_table th { background: var(--bg-light); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #888; }
.woocommerce button[name="update_cart"], .woocommerce .checkout-button { background: var(--red) !important; color: #fff !important; border-radius: 10px !important; font-weight: 700 !important; border: none !important; padding: 12px 24px !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .tm-topbar { padding: 6px 16px; }
  .tm-topbar__info { display: none; }
  .tm-header { padding: 0 16px; height: 56px; }
  .tm-nav { display: none; }
  .tm-searchbar { padding: 12px 16px; }
  .tm-hero { grid-template-columns: 1fr; }
  .tm-hero__main { padding: 32px 20px; }
  .tm-hero h1 { font-size: 34px; }
  .tm-hero__side { display: none; }
  .tm-stats { grid-template-columns: 1fr; }
  .tm-section { padding: 32px 16px; }
  .woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; }
  .tm-footer { padding: 32px 16px 16px; }
  .tm-footer__top { grid-template-columns: 1fr; }
  .tm-page-header { padding: 24px 16px; }
}
