/*
Theme Name: Tapan Tekstil
Description: İş elbisesi ve güvenlik ekipmanları e-ticaret teması — WooCommerce uyumlu.
Version: 2.0
Author: Tapan İş Elbiseleri Ve Güvenlik Malz. San. Tic. Ltd. Şti.
Text Domain: tapan-tekstil
*/

:root {
  --primary: #0c54a0;
  --primary-light: #1a6fc2;
  --primary-dark: #0a4580;
  --primary-50: #eff6ff;
  /* WooCommerce / tema bileşenleri — Tailwind brand-green ile uyumlu mavi */
  --brand-green: var(--primary);
  --font-sans: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Gövde metni: html 100% (16px) iken 13px; tüm sayfa + Hesabım aynı taban */
  --tapan-body-font-size: 0.8125rem;
}

html {
  font-size: 100%;
  /* 100vw tabanlı bloklar (ör. full-bleed marquee) scrollbar ile taşmasın */
  overflow-x: hidden;
}

/*
 * Site shell — tüm sayfa sütunları aynı genişlik (Hesabım hariç, aşağıdaki override).
 * Yatay padding şablonda: px-5 md:px-6 lg:px-10 (header shell, mağaza, Woo şablonları, page).
 */
.max-w-7xl,
.tapan-shop-fullwidth,
.tapan-shell-fullwidth {
  /* vw scrollbar dahil geniş sayar; % ile viewport içi kalır */
  max-width: min(100%, 1920px) !important;
}

/* My Account sayfaları hariç tüm site full width; hesap alanı daha kontrollü */
.woocommerce-account .max-w-7xl,
.woocommerce-account .tapan-shell-fullwidth,
.woocommerce-account .tapan-shop-fullwidth {
  max-width: 86rem !important;
}

/*
 * Hesabım: üst header’ın blur ile birlikte düşen gölgesi alt şeritte “gradient” gibi görünmesin —
 * bu sayfalarda header düz beyaz + gölgesiz; JS’nin scroll’da eklediği shadow-sm da iptal.
 */
/* Masaüstü: aşağı scroll’da üst şerit (Hakkımızda / İletişim) yumuşakça kapanır */
@media (min-width: 1024px) {
  .tapan-header-top-bar {
    max-height: 5rem;
    overflow: hidden;
    transition:
      max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.28s ease,
      border-color 0.28s ease;
  }

  header.tapan-header--top-hidden .tapan-header-top-bar {
    max-height: 0;
    opacity: 0;
    border-bottom-color: transparent;
    pointer-events: none;
  }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .tapan-header-top-bar {
    transition: none;
  }
}

body.woocommerce-account header.sticky {
  background-color: #fff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

body.woocommerce-account .tapan-account-subnav {
  box-shadow: none !important;
  background-color: #fff;
}

/*
 * Hesabım: Tailwind text-xs/sm/base/… rem tabanı html (~16px); body 13px ile aynı hizada değillerdi.
 * Bu sayfalarda utility’leri mağaza yoğunluğuna yakın piksel ölçeğe çek (header ~11–13px).
 */
body.woocommerce-account .text-xs {
  font-size: 11px !important;
  line-height: 1.4 !important;
}
body.woocommerce-account .text-sm {
  font-size: 12px !important;
  line-height: 1.45 !important;
}
body.woocommerce-account .text-base {
  font-size: 13px !important;
  line-height: 1.5 !important;
}
body.woocommerce-account .text-lg {
  font-size: 15px !important;
  line-height: 1.45 !important;
}
body.woocommerce-account .text-xl {
  font-size: 16px !important;
  line-height: 1.35 !important;
}
body.woocommerce-account .text-2xl {
  font-size: 20px !important;
  line-height: 1.25 !important;
}
body.woocommerce-account .text-3xl {
  font-size: 22px !important;
  line-height: 1.2 !important;
}

/* Ürün kartı görsel alanı arka planı */
.tapan-card-media-bg {
  background: #fdfdfd !important;
}

/* Ürün detay: solda liste (gri), sağda indirimli (primary) — WC tutar span renkleri */
.tapan-single-price del.tapan-price-regular,
.tapan-single-price del.tapan-price-regular .woocommerce-Price-amount,
.tapan-single-price del.tapan-price-regular .amount,
.tapan-single-price del.tapan-price-regular bdi {
  color: #9ca3af !important;
}

.tapan-single-price ins.tapan-price-sale,
.tapan-single-price ins.tapan-price-sale .woocommerce-Price-amount,
.tapan-single-price ins.tapan-price-sale .amount,
.tapan-single-price ins.tapan-price-sale bdi {
  color: var(--primary) !important;
}

/* Global site font */
html, body, p, span, div, a, li, ul, ol, dl, dt, dd,
input, textarea, select, button,
.wp-block-button, .wp-block-paragraph, .entry-content,
.site-content, .woocommerce, .woocommerce-page,
.nav-link, .menu-item, .widget-title, .site-title, .site-description {
  font-family: var(--font-sans) !important;
}

body {
  font-weight: 400;
  font-size: var(--tapan-body-font-size);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans) !important;
  font-weight: 700;
}

/* Preserve WordPress dashicons */
.ab-icon:before { font-family: 'dashicons' !important; }

/* Product image */
.product-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  padding: 8px;
  transition: opacity .3s;
}
.group:hover .product-img { opacity: 0.88; }

/* Ürün kartı rozetleri — beyaz cam, ince çizgi, kurumsal mavi metin */
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 6px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(10, 69, 128, 0.22);
  color: #0a4580;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.badge-out {
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.35);
  background: rgba(255, 255, 255, 0.88);
}

/* Liste kartı — indirim yüzdesi (sağ üst) */
.tapan-discount-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(10, 69, 128, 0.22);
  color: #0a4580;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Ürün detay — satır içi rozet (galeri yanı) */
.tapan-pill-inline {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 5px 10px;
  border-radius: 6px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(10, 69, 128, 0.18);
  color: #0a4580;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Line clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { animation: fadeIn 0.3s ease-out; }

/* Tab styling */
.tab-btn { cursor: pointer; }

/* ── Single product: Add to cart wrap ─────────────────────────── */
/* wc_get_stock_html() formun üstünde — qty/satır ile aralık */
.tapan-atc-wrap > p.stock,
.tapan-atc-wrap .stock {
  display: block;
  margin: 0 0 0.75rem 0 !important;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.tapan-atc-wrap .quantity { display: inline-flex; align-items: center; }
.tapan-atc-wrap .qty {
  width: 56px;
  height: 48px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.tapan-atc-wrap .qty:focus { border-color: #0c54a0; }

/* Sepet satırı + toptan CTA (functions: woocommerce_before/after_add_to_cart_form) */
.tapan-atc-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.tapan-atc-actions-row form.cart:not(.variations_form):not(.grouped_form) {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}

.tapan-atc-actions-row form.variations_form.cart,
.tapan-atc-actions-row form.grouped_form.cart {
  display: block;
  flex: 1 1 260px;
  margin: 0;
  min-width: 0;
}

.tapan-atc-wrap form.variations_form.cart,
.tapan-atc-wrap form.grouped_form.cart {
  display: block;
}

.tapan-atc-wrap .single_add_to_cart_button {
  flex: 0 1 auto !important;
  height: 48px;
  background: #0c54a0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  white-space: nowrap;
  max-width: 100%;
}

.tapan-atc-wrap .single_add_to_cart_button:hover { background: #0a4580; }
.tapan-atc-wrap .single_add_to_cart_button:active { transform: scale(0.98); }

.tapan-wholesale-cta {
  flex: 1 1 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  box-sizing: border-box;
  border: 1px solid rgba(12, 84, 160, 0.4);
  border-radius: 10px;
  background: #fff;
  color: #0c54a0;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tapan-wholesale-cta:hover {
  background: #0c54a0;
  color: #fff;
  border-color: #0c54a0;
}

.tapan-wholesale-cta__icon {
  flex-shrink: 0;
}

.tapan-wholesale-cta__label {
  display: block;
}

@media (max-width: 520px) {
  .tapan-atc-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .tapan-atc-actions-row form.cart:not(.variations_form):not(.grouped_form) {
    flex-wrap: wrap;
  }
  .tapan-wholesale-cta {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* Mobil menü: hamburger → X (yumuşak geçiş) */
.tapan-burger__inner {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 1rem;
}

.tapan-burger__bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transform-origin: center;
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    top 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.tapan-burger__bar:nth-child(1) {
  top: 1px;
}

.tapan-burger__bar:nth-child(2) {
  top: 7px;
}

.tapan-burger__bar:nth-child(3) {
  top: 13px;
}

.tapan-burger.is-open .tapan-burger__bar:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.tapan-burger.is-open .tapan-burger__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.15);
}

.tapan-burger.is-open .tapan-burger__bar:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

/* Ana sayfa hero: Swiper (dot pagination) */
.tapan-hero-swiper.swiper {
  overflow: visible;
}

.tapan-hero-swiper {
  position: relative;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 3.25rem;
}

.tapan-hero-swiper .swiper-slide {
  height: auto;
}

.tapan-hero-swiper__pagination {
  bottom: 0.75rem !important;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding-top: 0.25rem;
  box-sizing: content-box;
}

.tapan-hero-swiper__pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.45);
  opacity: 1;
}

.tapan-hero-swiper__pagination .swiper-pagination-bullet-active {
  background: #fff;
  transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
  .tapan-hero-swiper .swiper-wrapper {
    transition-duration: 0.01ms !important;
  }
}
