/*
Theme Name: Çetinkaya Motors
Theme URI: https://ornek.com
Author: Salih & ChatGPT
Description: Çetinkaya Motors için WooCommerce uyumlu premium e-ticaret teması.
Version: 1.2
Text Domain: cetinkaya-motors
*/

:root {
  --cm-primary: #0f172a;
  --cm-accent: #16a34a;
  --cm-accent-soft: #dcfce7;
  --cm-text-main: #0f172a;
  --cm-text-muted: #6b7280;
  --cm-border: #e5e7eb;
  --cm-bg: #ffffff;
  --cm-bg-soft: #f9fafb;
  --cm-radius-xl: 24px;
  --cm-radius-lg: 18px;
  --cm-radius-md: 12px;
  --cm-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --cm-shadow-card: 0 14px 35px rgba(15, 23, 42, 0.06);
}

/* RESET + GENEL --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", sans-serif;
  background: var(--cm-bg);
  color: var(--cm-text-main);
}

a {
  color: inherit;
}

/* Genel container */

.cm-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 16px;
}

/* HEADER / MENU --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cm-border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 12px;
}

/* Branding */

.site-branding {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--cm-primary);
}

/* Fallback logo (CM yuvarlak) */

.site-logo-circle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 0%, #22c55e, #16a34a);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

/* Custom Logo stilleri */

.site-branding .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.site-branding .custom-logo {
  height: 40px;
  width: auto;
  display: block;
}

/* Menü --------------------------------------------------------- */

.cm-primary-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

/* wp_nav_menu <li> reset */
.cm-primary-nav li {
  list-style: none;
}

/* Menü linkleri */
.cm-primary-nav a {
  text-decoration: none;
  color: var(--cm-text-muted);
  font-weight: 500;
  position: relative;
  padding-block: 4px;
  padding-inline: 2px;
}

/* Hover alt çizgi */
.cm-primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--cm-accent);
  transition: width 0.22s ease;
}

.cm-primary-nav a:hover {
  color: var(--cm-primary);
}

.cm-primary-nav a:hover::after {
  width: 100%;
}

/* Aktif menü maddesi */
.cm-primary-nav li.current-menu-item > a,
.cm-primary-nav li.current-menu-ancestor > a {
  color: var(--cm-primary);
  font-weight: 600;
}

.cm-primary-nav li.current-menu-item > a::after,
.cm-primary-nav li.current-menu-ancestor > a::after {
  width: 100%;
}

/* Sepet butonu ------------------------------------------------ */

.cm-cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--cm-border);
  font-size: 13px;
  text-decoration: none;
  color: var(--cm-primary);
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    border-color 0.12s ease, background 0.12s ease;
}

.cm-cart-link:hover {
  transform: translateY(-1px);
  border-color: var(--cm-accent);
  background: var(--cm-accent-soft);
  box-shadow: var(--cm-shadow-soft);
}

/* MOBILE HEADER -------------------------------------------------------- */

.cm-mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 6px;
  border-radius: 999px;
}

.cm-mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cm-primary);
  border-radius: 999px;
  position: relative;
}

.cm-mobile-toggle span::before,
.cm-mobile-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--cm-primary);
  border-radius: 999px;
}

.cm-mobile-toggle span::before {
  top: -6px;
}

.cm-mobile-toggle span::after {
  top: 6px;
}

@media (max-width: 768px) {
  .site-header-inner {
    gap: 10px;
  }

  .cm-primary-nav {
    position: fixed;
    inset-inline: 0;
    top: 56px;
    background: #fff;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--cm-border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .cm-primary-nav.cm-open {
    transform: translateY(0%);
    opacity: 1;
    pointer-events: auto;
  }

  .cm-mobile-toggle {
    display: block;
  }
}

/* HERO (sadece görsel) -------------------------------------------------- */

.cm-hero {
  margin-top: 16px;
  margin-bottom: 16px;
}

.cm-hero-link {
  display: block;
  border-radius: var(--cm-radius-xl);
  overflow: hidden;
  box-shadow: var(--cm-shadow-soft);
  position: relative;
  background: #0b1120; /* görsel yüklenmezse koyu arka plan */
}

.cm-hero-img-wrapper {
  position: relative;
  padding-top: 41.5%; /* 16:9 oran */
  width: 100%;
}

.cm-hero-img-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.5s ease;
}

.cm-hero-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(22, 163, 74, 0.14),
    transparent 55%
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.cm-hero-link:hover img {
  transform: scale(1.06);
}

/* HERO ALT BANT --------------------------------------------------------- */

.cm-feature-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.cm-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--cm-radius-md);
  background: var(--cm-bg-soft);
  border: 1px solid var(--cm-border);
  font-size: 13px;
  color: var(--cm-text-muted);
}

.cm-feature-item strong {
  display: block;
  color: var(--cm-primary);
  font-size: 13px;
}

.cm-feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
  font-size: 14px;
}

@media (max-width: 960px) {
  .cm-feature-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cm-feature-strip {
    grid-template-columns: 1fr;
  }
}

/* BÖLÜM BAŞLIKLARI ------------------------------------------------------ */

.cm-section {
  padding-block: 32px;
}

.cm-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.cm-section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cm-primary);
}

.cm-section-sub {
  font-size: 13px;
  color: var(--cm-text-muted);
}

.cm-section-link {
  font-size: 13px;
  text-decoration: none;
  color: var(--cm-accent);
  font-weight: 500;
}

/* ÜRÜN GRID ------------------------------------------------------------- */

.cm-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 1100px) {
  .cm-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cm-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cm-products-grid {
    grid-template-columns: 1fr;
  }
}

/* WooCommerce ürün kartı override -------------------------------------- */

.cm-product-card,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  list-style: none;
  background: #fff;
  border-radius: var(--cm-radius-lg);
  border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow-card);
  overflow: hidden;
  position: relative;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Ana sayfa gridinde .product kartlarının da dikey hizalanması */
.cm-products-grid .product,
.cm-products-grid .cm-product-card {
  display: flex;
  flex-direction: column;
}

/* Link ve içerik */

.woocommerce ul.products li.product a,
.woocommerce-page ul.products li.product a {
  text-decoration: none;
}

.cm-product-inner,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

/* Görsel */

.cm-product-thumb,
.woocommerce ul.products li.product img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #f9fafb;
  padding: 18px;
  transition: transform 0.22s ease;
}

/* Gövde */

.cm-product-body {
  padding: 14px 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  min-height: 80px; /* başlık + fiyat için boş alan */
}

.cm-product-title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cm-primary);
  margin: 0 0 4px 0;
  line-height: 1.35;
}

.cm-product-price,
.woocommerce ul.products li.product .price {
  color: var(--cm-accent);
  font-weight: 600;
  font-size: 14px;
}

.cm-product-meta {
  font-size: 12px;
  color: var(--cm-text-muted);
}

/* Footer */

.cm-product-footer {
  padding: 0 16px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.cm-badge-pill {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
}

/* Butonlar */

.cm-btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: none;
  padding: 9px 16px;
  background: var(--cm-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease,
    opacity 0.12s ease;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  white-space: nowrap;
}

.cm-btn-outline {
  background: #fff;
  color: var(--cm-primary);
  border: 1px solid var(--cm-border);
  box-shadow: none;
}

.cm-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.18);
  background: #111827;
  color: #fff;
}

/* Kart hover */

.cm-product-card:hover .cm-product-thumb,
.woocommerce ul.products li.product:hover img {
  transform: scale(1.03) translateY(-4px);
}

/* SINGLE PRODUCT -------------------------------------------------------- */

.cm-single-wrapper {
  padding-block: 28px 40px;
}

.cm-single-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 34px;
}

@media (max-width: 900px) {
  .cm-single-grid {
    grid-template-columns: 1fr;
  }
}

.cm-single-gallery {
  border-radius: var(--cm-radius-lg);
  border: 1px solid var(--cm-border);
  background: var(--cm-bg-soft);
  padding: 16px;
}

.cm-single-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cm-single-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cm-single-price {
  font-size: 20px;
  color: var(--cm-accent);
  font-weight: 700;
}

.cm-single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.cm-tag-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--cm-border);
  background: #fff;
  color: var(--cm-text-muted);
}

.cm-single-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Woo single iç elementler */

.woocommerce div.product form.cart {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.woocommerce div.product .quantity .qty {
  width: 70px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--cm-border);
}

/* Breadcrumb ------------------------------------------------------------ */

.cm-breadcrumb-bar {
  padding-top: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cm-border);
  background: var(--cm-bg-soft);
}

.cm-breadcrumb-bar .cm-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.cm-breadcrumb {
  font-size: 12px;
  color: var(--cm-text-muted);
}

.cm-breadcrumb a {
  color: var(--cm-text-muted);
  text-decoration: none;
}

.cm-breadcrumb a:hover {
  color: var(--cm-primary);
}

/* Kategoriler / Shop sayfası -------------------------------------------- */

.cm-shop-header {
  padding-block: 26px 16px;
}

.cm-shop-title {
  font-size: 22px;
  font-weight: 700;
}

.cm-shop-sub {
  font-size: 13px;
  color: var(--cm-text-muted);
}

.cm-shop-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.cm-shop-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--cm-text-muted);
}

.cm-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--cm-border);
  background: #fff;
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--cm-border);
  padding-block: 24px 18px;
  margin-top: 40px;
  background: var(--cm-bg-soft);
  font-size: 12px;
  color: var(--cm-text-muted);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Basit fade-up animasyonu --------------------------------------------- */

.cm-fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.cm-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Çetinkaya Motors - Standart Sayfa Düzeni */

.site-main {
    padding: 40px 0; /* İçeriğin üst ve altından boşluk bırakır */
    background-color: #f9f9f9; /* Sayfa arka plan rengi (isteğe bağlı) */
}

.cetinkaya-container {
    width: 100%;
    max-width: 1200px; /* İçeriğin yayılacağı maksimum genişlik */
    margin: 0 auto; /* İçeriği sayfada ortalar */
    padding-left: 15px; /* Mobilde kenara yapışmaması için sol boşluk */
    padding-right: 15px; /* Mobilde kenara yapışmaması için sağ boşluk */
    box-sizing: border-box;
}

/* Sayfa Başlığı Stili */
.entry-header h1 {
    margin-bottom: 20px;
    font-size: 2rem;
    color: #333;
    text-align: center; /* Başlığı ortalar */
}

/* Editörden gelen HTML içeriği için genel kurallar */
.entry-content {
    background: #fff; /* İçeriğin arkası beyaz olsun */
    padding: 30px; /* İçerik kutusunun iç boşluğu */
    border-radius: 8px; /* Köşeleri yumuşat */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Hafif gölge */
    line-height: 1.6; /* Okunabilir satır aralığı */
}

/* Resimlerin taşmasını engellemek için */
.entry-content img {
    max-width: 100%;
    height: auto;
}

/* Mobil Cihazlar İçin Ayarlama (Tablet ve Telefon) */
@media (max-width: 768px) {
    .site-main {
        padding: 20px 0;
    }
    .entry-content {
        padding: 15px; /* Mobilde iç boşluğu azalt */
    }
}

/* Başlık Alanını Ortala */
.entry-header {
    text-align: center; /* İçindeki her şeyi ortalar */
    margin-bottom: 30px; /* İçerik ile başlık arasına boşluk koyar */
    width: 100%;
}

/* Başlık Metnini Garanti Olarak Ortala */
.entry-header h1.entry-title {
    text-align: center;
    display: block; /* Tam genişlik kaplamasını sağlar */
    margin: 0 auto;
}

/* --- WooCommerce Galeri Düzenlemeleri --- */

/* 1. Alttaki "1 2" veya noktaları gizle */
.woocommerce-product-gallery .flex-control-nav {
    display: none !important;
}

/* 2. Büyüteç butonunu tüm resmin üzerine yay ve görünmez yap */
.woocommerce-product-gallery {
    position: relative; /* Referans noktası */
}

.woocommerce-product-gallery__trigger {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;   /* Tüm genişliği kapla */
    height: 100% !important;  /* Tüm yüksekliği kapla */
    opacity: 0 !important;    /* Tamamen görünmez yap */
    z-index: 100 !important;  /* En üstte dursun */
    right: auto !important;   /* Varsayılan sağa yaslamayı iptal et */
    cursor: pointer !important; /* Tıklanabilir el işareti çıksın */
    background: transparent !important;
}

/* Resmin kendisine tıklandığında (zoom özelliği varsa) çakışmayı önle */
.woocommerce-product-gallery__image img {
    cursor: pointer;
}