/*
Theme Name: 2J Commerce
Theme URI: https://tema.2j.com.tr
Author: 2J Commerce
Description: WooCommerce icin hizli, moduler ve Site Editor uyumlu premium blok tema.
Version: 0.2.7
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: twoj-commerce
*/

:root {
  --twoj-header-height: 76px;
  --twoj-mobile-nav-height: 68px;
  --twoj-page-gutter: clamp(18px, 3vw, 46px);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
a { text-underline-offset: 0.18em; }
button, input, select, textarea { font: inherit; }

.wp-site-blocks { min-height: 100vh; }
.twoj-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--twoj-header-height);
  border-bottom: 1px solid var(--wp--preset--color--line);
  background: color-mix(in srgb, var(--wp--preset--color--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}
.admin-bar .twoj-site-header { top: 32px; }
.twoj-site-header .wp-block-site-logo img { max-height: 42px; width: auto; }
.twoj-header-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  width: 100%;
  min-height: var(--twoj-header-height);
}
.twoj-header-grid > .wp-block-navigation { grid-column: 1; grid-row: 1; justify-self: start; }
.twoj-header-grid > .wp-block-woocommerce-customer-account {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  margin-right: 318px;
}
.twoj-header-brand { grid-column: 2; grid-row: 1; justify-self: center; gap: 10px; }
.twoj-header-brand .wp-block-site-title {
  margin: 0;
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.35rem;
  line-height: 1;
  white-space: nowrap;
}
.twoj-header-brand .wp-block-site-title a { text-decoration: none; }
.twoj-header-brand:has(.wp-block-site-logo img) .wp-block-site-title { display: none; }
.twoj-header-actions { grid-column: 3; grid-row: 1; justify-self: end; gap: 12px; }
.twoj-header-actions .wp-block-search { width: min(240px, 18vw); }
.twoj-site-header .wp-block-navigation-item__content { font-weight: 600; }
.twoj-site-header .wp-block-search__inside-wrapper { border-radius: 2px; }

.twoj-announcement { min-height: 34px; }
.twoj-hero { min-height: min(650px, calc(100vh - 150px)); }
.twoj-hero .wp-block-cover__inner-container { width: 100%; }
.twoj-hero-copy { max-width: 650px; }
.twoj-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.twoj-section-heading { max-width: 720px; }
.twoj-section-heading h2 { text-wrap: balance; }
.twoj-trust-strip { border-block: 1px solid var(--wp--preset--color--line); }
.twoj-trust-item { min-height: 92px; }
.twoj-category-tile { overflow: hidden; position: relative; }
.twoj-category-tile img { transition: transform 450ms ease; }
.twoj-category-tile:hover img { transform: scale(1.035); }
.twoj-category-tile .wp-block-cover__inner-container { align-self: flex-end; }
.twoj-category-tile a { color: inherit; text-decoration: none; }
.twoj-promo-grid { gap: clamp(12px, 2vw, 24px); }
.twoj-promo-tile { min-height: clamp(300px, 36vw, 520px); overflow: hidden; }
.twoj-promo-tile img { transition: transform 550ms ease; }
.twoj-promo-tile:hover img { transform: scale(1.03); }
.twoj-promo-tile .wp-block-cover__inner-container { align-self: flex-end; }
.twoj-product-showcase { position: relative; }
.twoj-product-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  margin-bottom: 32px;
}
.twoj-product-tab {
  padding: 8px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--wp--preset--color--contrast);
  cursor: pointer;
  font-weight: 700;
}
.twoj-product-tab[aria-selected="true"] { border-bottom-color: var(--wp--preset--color--accent); }
.twoj-product-panel[hidden] { display: none !important; }
.twoj-category-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: clamp(16px, 2.2vw, 32px);
  overflow-x: auto;
  padding: 4px 2px 18px;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}
.twoj-category-chip { min-width: 0; scroll-snap-align: start; text-align: center; }
.twoj-category-chip img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 350ms ease;
}
.twoj-category-chip:hover img { transform: scale(1.025); }
.twoj-category-chip a { text-decoration: none; }
.twoj-editorial-band { overflow: hidden; }
.twoj-editorial-band .wp-block-columns { gap: 0; }
.twoj-editorial-band .wp-block-image,
.twoj-editorial-band .wp-block-image img { height: 100%; }
.twoj-editorial-band .wp-block-image img { min-height: 500px; object-fit: cover; }
.twoj-editorial-copy { display: flex; flex-direction: column; justify-content: center; min-height: 500px; }
.twoj-social-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.twoj-social-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.woocommerce ul.products,
.wc-block-product-template {
  gap: clamp(18px, 2vw, 30px);
}
.woocommerce ul.products li.product,
.wc-block-product {
  margin: 0 !important;
}
.woocommerce ul.products li.product img,
.wc-block-components-product-image img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--wp--preset--color--muted);
}
.woocommerce-loop-product__title,
.wc-block-components-product-name {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.35;
}
.woocommerce .price,
.wc-block-components-product-price { font-weight: 700; }
.woocommerce span.onsale {
  min-width: auto;
  min-height: auto;
  margin: 12px !important;
  padding: 6px 9px;
  border-radius: 2px;
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--contrast);
  font-size: 0.72rem;
  line-height: 1;
}
.woocommerce div.product .woocommerce-product-gallery img { background: var(--wp--preset--color--muted); }
.woocommerce div.product .summary { position: sticky; top: calc(var(--twoj-header-height) + 28px); }
.woocommerce button.button,
.woocommerce a.button,
.wc-block-components-button {
  min-height: 46px;
  border-radius: 2px !important;
  font-weight: 700;
}

.twoj-footer { border-top: 1px solid var(--wp--preset--color--line); }
.twoj-footer .wp-block-columns { gap: clamp(28px, 5vw, 76px); }
.twoj-footer .wp-block-navigation__container { gap: 8px; }
.twoj-footer a { text-decoration: none; }
.twoj-footer a:hover { text-decoration: underline; }
.twoj-mobile-nav { display: none; }

:focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
}

@media (max-width: 782px) {
  :root { --twoj-header-height: 64px; }
  .admin-bar .twoj-site-header { top: 46px; }
  .twoj-site-header { min-height: var(--twoj-header-height); }
  .twoj-site-header:has(.wp-block-navigation__responsive-container.is-menu-open) {
    backdrop-filter: none;
  }
  .twoj-header-grid { grid-template-columns: 1fr auto 1fr; min-height: var(--twoj-header-height); }
  .twoj-header-grid > .wp-block-woocommerce-customer-account { display: none; }
  .twoj-header-actions .wp-block-search { display: none; }
  .twoj-site-header .wp-block-navigation__responsive-container.is-menu-open {
    inset: 0;
    z-index: 200;
    box-sizing: border-box;
    width: 100vw;
    min-height: 100dvh;
    padding: 28px 22px calc(var(--twoj-mobile-nav-height) + 28px);
    color: var(--wp--preset--color--contrast);
    background: var(--wp--preset--color--surface) !important;
  }
  .twoj-site-header .wp-block-navigation__responsive-container-content {
    align-items: flex-start !important;
  }
  .twoj-site-header .wp-block-navigation__container {
    align-items: flex-start !important;
    width: 100%;
    gap: 0;
  }
  .twoj-site-header .wp-block-navigation-item { width: 100%; }
  .twoj-site-header .wp-block-navigation-item__content {
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--wp--preset--color--line);
    text-align: left;
  }
  .twoj-header-brand .wp-block-site-title { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .twoj-hero {
    min-height: clamp(520px, calc(100svh - 150px), 620px) !important;
  }
  .twoj-hero-copy { max-width: 92%; }
  .twoj-hero-copy h1 {
    font-size: clamp(2.45rem, 12vw, 3.25rem) !important;
    line-height: 1.02;
  }
  .twoj-hero-copy .has-large-font-size {
    font-size: 1.08rem !important;
    line-height: 1.5;
  }
  .twoj-hero-copy .wp-block-buttons { gap: 10px; }
  .twoj-trust-strip .wp-block-columns { display: grid; grid-template-columns: 1fr 1fr; }
  .twoj-trust-item { min-height: 78px; }
  .twoj-promo-grid { display: grid !important; grid-template-columns: 1fr; }
  .twoj-promo-tile { min-height: 420px; }
  .twoj-category-scroller { grid-auto-columns: minmax(132px, 42vw); margin-right: -20px; }
  .twoj-editorial-band .wp-block-columns { display: flex; flex-direction: column; }
  .twoj-editorial-band .wp-block-image img { min-height: 380px; }
  .twoj-editorial-copy { min-height: auto; padding: 44px 22px !important; }
  .twoj-social-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .woocommerce div.product .summary { position: static; }
  .twoj-mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: var(--twoj-mobile-nav-height);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--wp--preset--color--line);
    background: var(--wp--preset--color--surface);
  }
  .twoj-mobile-nav a {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 48px;
    padding: 8px 3px;
    color: var(--wp--preset--color--contrast);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
  }
  body { padding-bottom: calc(var(--twoj-mobile-nav-height) + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
