/*
 * Tech Empire Storefront v1.3 - styles
 * Brand: black + green from the TE logo.
 *   ink #14181d | green #178a45 (buttons on white) | bright #22e07a (accents on dark)
 *   paper #f5f6f4 | line #dfe3e0 | sale #d33b3b
 */

:root {
  --te-ink: #14181d;
  --te-green: #178a45;
  --te-green-dark: #0f6b34;
  --te-bright: #22e07a;
  --te-paper: #f5f6f4;
  --te-line: #dfe3e0;
  --te-muted: #5b6670;
  --te-sale: #d33b3b;
  --te-radius: 12px;
  --te-cols: 4;
}

/* ---------- Hide the old theme header and footer (our own replace them) ---------- */
body.te-chrome #masthead,
body.te-chrome header.site-header,
body.te-chrome #ast-desktop-header,
body.te-chrome #ast-mobile-header,
body.te-chrome .ast-mobile-header-wrap,
body.te-chrome #colophon,
body.te-chrome footer.site-footer,
body.te-chrome .ehf-header #masthead,
body.te-chrome .hfe-footer,
body.te-chrome .hfe-before-footer-wrap,
body.te-chrome .ehf-footer #colophon,
body.te-chrome #ast-scroll-top {
  display: none !important;
}

/* Homepage: no page title, no side gaps */
body.te-front .entry-header,
body.te-front .ast-archive-description { display: none !important; }
body.te-front #primary { margin: 0 !important; padding: 0 !important; width: 100% !important; }
body.te-front .site-content > .ast-container { max-width: none !important; padding: 0 !important; display: block !important; }
body.te-front .entry-content > * { max-width: none; }
body.te-front .ast-article-single,
body.te-front .entry-content { margin: 0 !important; padding: 0 !important; }

/* ---------- Shared bits ---------- */
.te-wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.te-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.te-skip { position: absolute; left: -9999px; top: 0; background: #fff; color: var(--te-ink); padding: 10px 14px; z-index: 100000; }
.te-skip:focus { left: 8px; top: 8px; }
.te-icon { flex: none; }

.te-btn {
  display: inline-block;
  background: var(--te-green);
  color: #fff;
  border: 2px solid var(--te-green);
  border-radius: 8px;
  padding: 12px 22px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.te-btn:hover, .te-btn:focus { background: var(--te-green-dark); border-color: var(--te-green-dark); color: #fff; }
.te-btn--light { background: #fff; color: var(--te-ink); border-color: #fff; }
.te-btn--light:hover, .te-btn--light:focus { background: var(--te-bright); border-color: var(--te-bright); color: var(--te-ink); }
.te-btn--ghost { background: transparent; color: var(--te-green); }
.te-btn--ghost:hover, .te-btn--ghost:focus { background: var(--te-green); color: #fff; }
.te-btn--small { padding: 10px 14px; font-size: 14px; }

body.te-chrome a:focus-visible,
body.te-chrome button:focus-visible,
body.te-chrome input:focus-visible { outline: 3px solid var(--te-bright); outline-offset: 2px; }

/* ---------- Announcement bar ---------- */
.te-announce { background: var(--te-green); color: #fff; font-size: 14px; }
.te-announce__row { display: flex; align-items: center; justify-content: center; min-height: 38px; }
.te-announce p { margin: 0; padding: 8px 0; text-align: center; }
.te-sep { opacity: .6; margin: 0 6px; }

/* ---------- Header ---------- */
.te-header { background: #fff; border-bottom: 1px solid var(--te-line); position: relative; z-index: 50; }
.te-header__row { display: flex; align-items: center; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
.te-logo { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.te-logo__img { height: 54px; width: auto; border-radius: 8px; display: block; }
.te-logo__text { font-weight: 800; font-size: 1.4rem; color: var(--te-ink); }
.te-burger { display: none; background: none; border: 0; padding: 6px; color: var(--te-ink); cursor: pointer; }

.te-search { flex: 1; max-width: 640px; display: flex; margin: 0 auto; }
.te-search input[type="search"] {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 2px solid var(--te-ink);
  border-right: 0; border-radius: 8px 0 0 8px; background: #fff; color: var(--te-ink); font-size: 15px; box-shadow: none;
}
.te-search button {
  width: 54px; height: 46px; border: 2px solid var(--te-ink); background: var(--te-ink); color: #fff;
  border-radius: 0 8px 8px 0; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.te-search button:hover { background: var(--te-green); border-color: var(--te-green); }

.te-wapill {
  display: flex; align-items: center; gap: 10px; flex: none; padding: 7px 18px 7px 12px;
  border: 1px solid var(--te-line); border-radius: 999px; background: #fff; color: #1fa855; text-decoration: none;
}
.te-wapill span { display: flex; flex-direction: column; line-height: 1.2; color: var(--te-ink); }
.te-wapill small { font-size: 12px; color: var(--te-muted); }
.te-wapill strong { font-size: 15px; }
.te-wapill:hover { border-color: var(--te-green); background: var(--te-paper); }

.te-actions { display: flex; gap: 6px; flex: none; }
.te-action {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; color: var(--te-ink); font-size: 12px; font-weight: 600; text-decoration: none; border-radius: 8px;
}
.te-action:hover { background: var(--te-paper); color: var(--te-green-dark); }
.te-cart-count {
  position: absolute; top: 0; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  display: grid; place-items: center; border-radius: 999px; background: var(--te-bright); color: var(--te-ink); font-size: 11px; font-weight: 800;
}
.te-cart-total { font-size: 12px; font-weight: 700; }
.te-cart-total .woocommerce-Price-currencySymbol { font-weight: 600; }

/* ---------- Navigation bar ---------- */
.te-nav { background: var(--te-ink); color: #fff; }
.te-nav__row { display: flex; align-items: center; gap: 8px; }
.te-nav__links { display: flex; flex-wrap: wrap; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.te-nav__links > li > a,
.te-dd__btn {
  display: flex; align-items: center; gap: 6px; padding: 17px 14px; color: #fff; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: -.2px; text-transform: uppercase; text-decoration: none;
}
.te-nav__links > li > a:hover, .te-dd__btn:hover, .te-dd:hover > .te-dd__btn { color: var(--te-bright); }
.te-dd { position: relative; }
.te-dd__list {
  display: none; position: absolute; left: 0; top: 100%; min-width: 260px; margin: 0; padding: 8px 0; list-style: none;
  background: #fff; border: 1px solid var(--te-line); border-top: 0; border-radius: 0 0 var(--te-radius) var(--te-radius);
  box-shadow: 0 12px 30px rgba(20, 24, 29, .18); z-index: 60;
}
.te-dd:hover .te-dd__list, .te-dd.te-open .te-dd__list, .te-dd:focus-within .te-dd__list { display: block; }
.te-dd__list a { display: flex; justify-content: space-between; gap: 16px; padding: 11px 20px; color: var(--te-ink); text-decoration: none; font-weight: 600; }
.te-dd__list a span { color: var(--te-muted); font-weight: 400; }
.te-dd__list a:hover { background: var(--te-paper); color: var(--te-green-dark); }
.te-nav__social { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.te-nav__social a { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; border-radius: 8px; }
.te-nav__social a:hover { color: var(--te-bright); background: rgba(255, 255, 255, .08); }

/* ---------- Homepage ---------- */
.te-home { background: #fff; }
.te-section { padding-top: 44px; padding-bottom: 8px; }
.te-section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.te-section__head h2 { margin: 0; font-size: 1.6rem; line-height: 1.2; color: var(--te-ink); }
.te-section__head--center { justify-content: center; }
.te-section__head--center h2 { text-decoration: underline; text-decoration-color: var(--te-green); text-underline-offset: 8px; text-decoration-thickness: 3px; }
.te-more { display: flex; justify-content: center; margin: 22px 0 0; }

/* popular categories: automatic sliding carousel (like a slider), unframed images */
.te-carousel { position: relative; }
.te-cats {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; padding: 4px 0 8px;
}
.te-cats::-webkit-scrollbar { display: none; }
.te-cats.is-dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.te-cat {
  flex: 0 0 calc((100% - 7 * 12px) / 8); scroll-snap-align: start; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; color: var(--te-ink);
}
.te-cat__img { width: 100%; max-width: 115px; height: 95px; display: flex; align-items: center; justify-content: center; background: #fff; }
.te-cat__img img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.te-cat strong { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.te-cat:hover strong { color: var(--te-green-dark); }
.te-carousel__nav {
  position: absolute; top: 38%; z-index: 4; width: 40px; height: 40px; transform: translateY(-50%);
  display: grid; place-items: center; padding: 0; border: 1px solid var(--te-line); border-radius: 50%;
  background: #fff; color: var(--te-ink); box-shadow: 0 4px 14px rgba(20, 24, 29, .15); cursor: pointer;
}
.te-carousel__nav:hover { background: var(--te-ink); color: #fff; border-color: var(--te-ink); }
.te-carousel__nav--prev { left: -14px; }
.te-carousel__nav--next { right: -14px; }
.te-carousel.is-static .te-carousel__nav { display: none; }

/* product cards (homepage) */
.te-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.te-card {
  position: relative; display: flex; flex-direction: column; background: #f4f4f4; border: 1px solid var(--te-line);
  border-radius: 15px; padding: 12px; overflow: hidden;
}
.te-card__img { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: #fff; margin-bottom: 12px; }
.te-card__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.te-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--te-sale); color: #fff;
  font-size: 12px; font-weight: 800; line-height: 1; padding: 6px 8px; border-radius: 6px;
}
.te-card__cat { display: block; margin-bottom: 4px; font-size: 12px; color: var(--te-muted); }
.te-card__title { margin: 0 0 6px; font-size: 15px; line-height: 1.35; font-weight: 700; min-height: 2.7em; }
.te-card__title a { color: var(--te-ink); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.te-card__title a:hover { color: var(--te-green-dark); }
.te-card__price { margin-bottom: 12px; font-weight: 800; color: var(--te-ink); }
.te-card__price ins { color: var(--te-green); text-decoration: none; }
.te-card__price del { color: var(--te-muted); font-weight: 400; margin-right: 6px; }
.te-ask { color: var(--te-muted); font-weight: 600; font-size: 14px; }
.te-card__cta { margin-top: auto; }

/* condition badge (New / Used / Imported Used ...) */
.te-cond {
  position: absolute; top: 8px; right: 8px; z-index: 3; padding: 6px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700; line-height: 1; color: #fff; background: #3b4650;
}
.te-cond--new, .te-cond--new_box_packed { background: var(--te-green); }
.te-cond--used, .te-cond--imported_used { background: #b45309; }
.te-cond--open_box, .te-cond--slightly_used { background: #3b4650; }
.te-cond-line { margin: 0 0 12px; font-weight: 600; }
.te-cond-line .te-cond { position: static; display: inline-block; margin-left: 6px; }

/* steps to order */
.te-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: none; }
.te-steps li { background: var(--te-paper); border: 1px solid var(--te-line); border-radius: var(--te-radius); padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.te-steps li span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--te-ink); color: var(--te-bright); font-weight: 800; margin-bottom: 6px; }
.te-steps li p { margin: 0; color: var(--te-muted); font-size: 14px; line-height: 1.5; }

/* customer reviews */
.te-reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.te-review { margin: 0; padding: 22px; background: #fff; border: 1px solid var(--te-line); border-radius: var(--te-radius); display: flex; flex-direction: column; gap: 10px; }
.te-review__stars { display: flex; gap: 2px; color: #f5a623; }
.te-review p { margin: 0; line-height: 1.55; }
.te-review footer { margin-top: auto; font-size: 14px; color: var(--te-muted); display: flex; flex-direction: column; gap: 2px; }
.te-review footer a { color: var(--te-green-dark); text-decoration: none; }

.te-section--last { padding-bottom: 8px; }

/* ---------- Footer ---------- */
.te-footer { background: var(--te-ink); color: #cfd6d2; margin-top: 56px; }
.te-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-top: 56px; padding-bottom: 44px; }
.te-footer h2 { margin: 0 0 16px; color: #fff; font-size: 1.05rem; }
.te-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.te-footer a { color: #cfd6d2; text-decoration: none; }
.te-footer a:hover { color: var(--te-bright); }
.te-footer__brand p { margin: 14px 0 0; line-height: 1.7; max-width: 44ch; }
.te-footer__points { margin-top: 14px !important; }
.te-footer__points li { position: relative; padding-left: 22px; }
.te-footer__points li::before { content: "\2713"; position: absolute; left: 0; color: var(--te-bright); font-weight: 800; }
.te-footer__contact { margin-top: 18px !important; }
.te-footer__contact strong { color: #fff; }
.te-footer__social { display: flex; gap: 8px; margin-top: 20px; }
.te-footer__social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--te-ink); }
.te-footer__social a:hover { background: var(--te-bright); color: var(--te-ink); }
.te-footer .te-btn--light { color: var(--te-ink); }
.te-footer__form input[type="email"], .te-footer__form input[type="text"] {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--te-line); border-radius: 8px; background: #fff; color: var(--te-ink); box-sizing: border-box;
}
.te-footer__form label { color: #fff; font-size: 13px; }
.te-footer__form button, .te-footer__form input[type="submit"] {
  height: 44px; padding: 0 24px; margin-top: 8px; background: var(--te-green); color: #fff; border: 0; border-radius: 8px; font-weight: 700; cursor: pointer;
}
.te-footer__bar { border-top: 1px solid rgba(255, 255, 255, .12); }
.te-footer__bar .te-wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; font-size: 14px; }
.te-footer__bar p { margin: 0; }

/* ---------- Shop / category pages (Astra + WooCommerce) ---------- */
body.te-chrome.woocommerce ul.products,
body.te-chrome .woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(var(--te-cols), minmax(0, 1fr)) !important;
  gap: 18px !important;
  margin: 0 !important;
}
body.te-chrome ul.products::before,
body.te-chrome ul.products::after { display: none !important; }
body.te-chrome ul.products li.product {
  position: relative; width: auto !important; float: none !important; margin: 0 !important; padding: 12px 12px 16px;
  background: #f4f4f4; border: 1px solid var(--te-line); border-radius: 15px; overflow: hidden; display: flex; flex-direction: column;
}
body.te-chrome ul.products li.product a img { aspect-ratio: 1 / 1; width: 100%; object-fit: contain; background: #fff; margin-bottom: 12px; border-radius: 12px; }
body.te-chrome ul.products li.product .woocommerce-loop-product__title {
  color: var(--te-ink); font-size: 15px; font-weight: 700; line-height: 1.35; padding: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
body.te-chrome ul.products li.product .price { color: var(--te-ink); font-weight: 800; padding: 0; }
body.te-chrome ul.products li.product .price ins { color: var(--te-green); text-decoration: none; }
body.te-chrome ul.products li.product .price del { color: var(--te-muted); font-weight: 400; }
body.te-chrome ul.products li.product .button { margin: auto 0 0; display: block; text-align: center; }
body.te-chrome .woocommerce a.button,
body.te-chrome .woocommerce button.button,
body.te-chrome .woocommerce a.button.alt,
body.te-chrome .woocommerce button.button.alt,
body.te-chrome .woocommerce #respond input#submit {
  background: var(--te-green); color: #fff; border-radius: 8px; font-weight: 700;
}
body.te-chrome .woocommerce a.button:hover,
body.te-chrome .woocommerce button.button:hover,
body.te-chrome .woocommerce a.button.alt:hover,
body.te-chrome .woocommerce button.button.alt:hover { background: var(--te-green-dark); color: #fff; }
body.te-chrome .woocommerce span.onsale {
  background: var(--te-sale); color: #fff; border-radius: 6px; min-height: 0; min-width: 0; line-height: 1; padding: 7px 9px; font-weight: 800; top: 10px; left: 10px; right: auto;
}

.te-density { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 16px; font-size: 14px; color: var(--te-muted); }
.te-density button {
  width: 34px; height: 34px; border: 1px solid var(--te-line); background: #fff; color: var(--te-ink); border-radius: 8px; font-weight: 700; cursor: pointer; padding: 0;
}
.te-density button[aria-pressed="true"] { background: var(--te-ink); color: #fff; border-color: var(--te-ink); }

/* ---------- Logo size (WooCommerce sets img height:auto on shop pages) ---------- */
body.te-chrome .te-logo .te-logo__img { height: 54px !important; width: auto !important; max-width: none !important; }

/* ---------- White background behind every product image, never cropped ---------- */
body.te-chrome .te-card__img,
body.te-chrome .te-cat__img,
body.te-chrome ul.products li.product a img,
body.te-chrome .woocommerce-product-gallery,
body.te-chrome .woocommerce-product-gallery__image,
body.te-chrome .woocommerce-product-gallery__image a,
body.te-chrome .woocommerce-cart-form img,
body.te-chrome .woocommerce-checkout-review-order img,
body.te-chrome .woocommerce-mini-cart img { background: #fff !important; }
body.te-chrome .woocommerce div.product div.images .woocommerce-product-gallery__image img,
body.te-chrome .woocommerce-product-gallery__image img { aspect-ratio: 1 / 1; width: 100%; object-fit: contain; background: #fff; }
body.te-chrome .woocommerce-product-gallery__image { border: 1px solid var(--te-line); }

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .te-wapill small { display: none; }
  .te-cat { flex-basis: calc((100% - 3 * 12px) / 4); }
  .te-grid { grid-template-columns: repeat(3, 1fr); }
  .te-steps { grid-template-columns: repeat(2, 1fr); }
  .te-reviews { grid-template-columns: repeat(2, 1fr); }
  .te-footer__grid { grid-template-columns: 1fr 1fr; }
  .te-footer__brand { grid-column: 1 / -1; }
  body.te-chrome .woocommerce ul.products, body.te-chrome.woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .te-header__row { flex-wrap: wrap; gap: 10px 12px; padding-top: 10px; padding-bottom: 10px; }
  .te-burger { display: block; order: 1; }
  .te-logo { order: 2; margin-right: auto; }
  .te-logo__img, body.te-chrome .te-logo .te-logo__img { height: 44px !important; }
  .te-wapill { display: none; }
  .te-actions { order: 3; }
  .te-action span:not(.te-cart-count):not(.te-cart-total) { display: none; }
  .te-cart-total { display: none; }
  .te-search { order: 4; flex: 0 0 100%; max-width: none; }
  .te-nav { display: none; }
  .te-nav.te-open { display: block; }
  .te-nav__row { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .te-nav__links { flex-direction: column; padding: 4px 20px; }
  .te-nav__links > li > a, .te-dd__btn { padding: 12px 0; width: 100%; justify-content: space-between; }
  .te-dd__list { position: static; box-shadow: none; border: 0; border-radius: 0; background: transparent; }
  .te-dd__list a { color: #fff; padding: 10px 12px; }
  .te-dd__list a span { color: #cfd6d2; }
  .te-dd:hover .te-dd__list { display: none; }
  .te-dd.te-open .te-dd__list { display: block; }
  .te-nav__social { margin: 0; padding: 4px 16px 14px; }

  .te-cats { gap: 10px; }
  .te-cat { flex-basis: calc((100% - 2 * 10px) / 3); }
  .te-carousel__nav { display: none; }
  .te-cat__img { height: 80px; }
  .te-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .te-steps, .te-reviews { grid-template-columns: 1fr; }
  .te-section { padding-top: 32px; }
  .te-footer__grid { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
  .te-density { display: none; }
  body.te-chrome .woocommerce ul.products, body.te-chrome.woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .te-btn { transition: none; }
}
