/*==============================================================
  Ana sayfa (Ekim 2026) — yalnız ana sayfada yüklenir (header.php $isHomePage)
  - Ürün kartı .pcard (index.php homeProductCard)
  - Bölüm başlıkları, kategoriler şeridi, sekmeler, ızgara, kaydırmalı
    şeritler, Haftanın Promosyon karuseli, tasarım/teklif bandı
  Marka renkleri: pembe #e6007e, mavi #1FA9E0.
==============================================================*/
:root {
  --home-pink: #e6007e;
  --home-pink-dark: #c4006b;
  --home-blue: #1FA9E0;
  --home-ink: #111827;
  --home-text: #374151;
  --home-muted: #6b7280;
  --home-line: #eceef2;
  --home-soft: #f6f7f9;
}

/* =================================================================
   Ürün kartı (.pcard)
================================================================= */
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0; /* uzun kelime kartı genişletmesin */
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 14px;
  background: #fff;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.pcard:hover {
  border-color: #e2e5ea;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .08);
  transform: translateY(-2px);
}

/* --- Görsel alanı --- */
.pcard__media {
  position: relative;
  border-bottom: 1px solid var(--home-line);
  background: #fff;
}
.pcard__img {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  padding: 14px;
}
.pcard__img img {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: contain;
  transition: opacity .3s ease, transform .4s ease;
}
.pcard__img-alt {
  opacity: 0;
}
.pcard:hover .pcard__img-main {
  transform: scale(1.04);
}
.pcard:hover .pcard__img-alt {
  opacity: 1;
}
.pcard:hover .pcard__img-alt ~ .pcard__img-main,
.pcard:hover .pcard__img-main:has(+ .pcard__img-alt) {
  opacity: 0;
}

.pcard__stock {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #047857;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
}
.pcard__stock::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pcard__stock--out {
  color: #b45309;
}

/* Tema .gi-btn-group stillerini kart içinde nötrle */
.pcard .gi-btn-group {
  position: static;
  margin: 0;
  box-shadow: none;
  transform: none;
  opacity: 1;
}
.pcard__fav.gi-btn-group {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--home-text);
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .08);
  cursor: pointer;
  transition: color .2s ease, transform .2s ease;
}
.pcard__fav.gi-btn-group:hover {
  color: var(--home-pink);
  transform: scale(1.08);
}
.pcard__fav i,
.pcard__tool i,
.pcard__cart i {
  display: block;
  line-height: 1;
}

.pcard__tools {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.pcard:hover .pcard__tools,
.pcard:focus-within .pcard__tools {
  opacity: 1;
  transform: none;
}
.pcard__tool.gi-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .95);
  color: var(--home-ink);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .08);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.pcard__tool.quickview {
  flex: 1 1 auto;
}
.pcard__tool.gi-btn-group:hover {
  background: var(--home-ink);
  color: #fff;
}
/* Dokunmatik cihazda hover yok: araçlar gizli, kart tıklaması ürüne gider */
@media (hover: none) {
  .pcard__tools {
    display: none;
  }
}

/* --- Gövde --- */
.pcard__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 12px 14px 14px;
}
.pcard__cat {
  margin-bottom: 4px;
  overflow: hidden;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}
.pcard__cat:hover {
  color: var(--home-pink);
}
.pcard__title {
  min-height: 2.7em;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.pcard__title a {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--home-ink);
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.pcard__title a:hover {
  color: var(--home-pink);
}
/* Admin "turuncu" vurgusu (urunler.turuncu) */
.pcard__title a.pcard__title--accent {
  color: #ea580c;
}
.pcard__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
  margin: 8px 0 10px;
}
.pcard__chip {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.pcard__chip--qty { background: #fff4e5; color: #9a5b00; }
.pcard__chip--print { background: #e8f6fc; color: #0e7aa6; }
.pcard__chip--design { background: #fde8f3; color: #b0005f; }
.pcard__chip--sale { background: #e7f7ef; color: #047857; }

.pcard__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.pcard__price {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.pcard__price-label {
  color: var(--home-muted);
  font-size: 10.5px;
  font-weight: 500;
}
.pcard__price-amount {
  color: var(--home-ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.pcard__price-tax {
  color: var(--home-muted);
  font-size: 11px;
  font-weight: 500;
}
.pcard__price-text {
  color: var(--home-text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}
.pcard__cart {
  display: flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--home-pink);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.pcard__cart:hover {
  background: var(--home-pink-dark);
  color: #fff;
  transform: translateY(-1px);
}
.pcard__cart--disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}
.pcard__cart--disabled:hover {
  background: #e5e7eb;
  color: #9ca3af;
  transform: none;
}
.pcard__note {
  margin-top: 8px;
  color: var(--home-pink);
  font-size: 11.5px;
  font-weight: 600;
}

/* =================================================================
   Bölümler
================================================================= */
.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.home-section-title {
  margin: 0;
  color: var(--home-ink);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
}
.home-section-title span {
  color: var(--home-pink);
}
.home-section-sub {
  margin: 4px 0 0;
  color: var(--home-muted);
  font-size: 14px;
}
.home-budget,
.home-rail-section--recent {
  background: #f8fafc;
}

/* --- Kategoriler --- */
.home-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 18px 12px;
}
.home-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--home-text);
  text-align: center;
  text-decoration: none;
}
.home-cat__img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 2px solid #f1f5f9;
  border-radius: 50%;
  background: var(--home-soft);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.home-cat__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-cat__img i {
  color: var(--home-pink);
  font-size: 34px;
  line-height: 1;
}
.home-cat__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.home-cat:hover .home-cat__img {
  border-color: var(--home-pink);
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(230, 0, 126, .12);
}
.home-cat:hover .home-cat__name {
  color: var(--home-pink);
}

/* --- Sekmeler --- */
.home-tabs {
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.home-tabs::-webkit-scrollbar {
  display: none;
}
.home-tabs .nav-link {
  flex: 0 0 auto;
  padding: 8px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: var(--home-text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.home-tabs .nav-link:hover {
  border-color: var(--home-pink);
  color: var(--home-pink);
}
.home-tabs .nav-link.active {
  border-color: var(--home-ink);
  background: var(--home-ink);
  color: #fff;
}

/* --- Izgara --- */
.home-grid {
  --bs-gutter-x: 16px;
  --bs-gutter-y: 16px;
}
.home-grid > .col {
  display: flex;
}
.home-more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 20px;
  border: 1px solid var(--home-ink);
  border-radius: 999px;
  color: var(--home-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.home-more-link:hover {
  background: var(--home-ink);
  color: #fff;
}

/* --- Haftanın Promosyon karuseli (slick) --- */
.home-deal__carousel .slick-list {
  margin: 0 -8px;
}
.home-deal__carousel .slick-track {
  display: flex;
}
.home-deal__carousel .slick-slide {
  height: auto;
}
/* Tema slaytı flex yapıyor; slick'in iç sarmalayıcısı içeriğe göre daralıp
   genişlemesin (uzun kelimeli kart daha geniş çıkıyordu) */
.home-deal__carousel .slick-slide > div {
  width: 100%;
  height: 100%;
}
.home-deal__carousel .gi-product-content {
  display: flex !important;
  height: 100%;
  margin: 0;
  padding: 2px 8px 6px;
}

/* --- Kaydırmalı şeritler --- */
.home-rail-nav {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.home-rail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: #fff;
  color: var(--home-text);
  font-size: 18px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.home-rail-btn:hover {
  border-color: var(--home-ink);
  color: var(--home-ink);
}
.home-rail {
  display: flex;
  gap: 16px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
/* Fareyle sürükleyerek kaydırma (index.php betiği) */
@media (hover: hover) and (pointer: fine) {
  .home-rail { cursor: grab; }
}
.home-rail.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}
.home-rail.is-dragging a {
  cursor: grabbing;
}
.home-rail__item {
  display: flex;
  flex: 0 0 calc((100% - 5 * 16px) / 6);
  scroll-snap-align: start;
}

/* --- Tasarım / teklif bandı --- */
.home-cta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.home-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.home-cta:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, .15);
}
.home-cta--pink { background: linear-gradient(135deg, #e6007e, #ff4fa3); }
.home-cta--blue { background: linear-gradient(135deg, #1FA9E0, #3cc4f5); }
.home-cta--dark { background: linear-gradient(135deg, #111827, #374151); }
.home-cta__icon {
  display: flex;
  flex: 0 0 52px;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  font-size: 24px;
}
.home-cta__icon i {
  line-height: 1;
}
.home-cta__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.home-cta__text strong {
  font-size: 16px;
  font-weight: 700;
}
.home-cta__text span {
  font-size: 13px;
  line-height: 1.4;
  opacity: .9;
}
.home-cta__arrow {
  flex: 0 0 auto;
  font-size: 20px;
}

/* =================================================================
   Duyarlı
================================================================= */
@media (max-width: 1199.98px) {
  .home-rail__item { flex-basis: calc((100% - 4 * 16px) / 5); }
}
@media (max-width: 991.98px) {
  .home-rail__item { flex-basis: calc((100% - 3 * 16px) / 4); }
  .home-cta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .home-section-title { font-size: 20px; }
  .home-section-head { margin-bottom: 14px; }
  /* Kategoriler: tek satır yatay kaydırma — ürünler ilk ekranda görünsün */
  .home-cats {
    display: flex;
    gap: 12px;
    margin: 0 -12px;
    padding: 0 12px 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .home-cats::-webkit-scrollbar { display: none; }
  .home-cat {
    flex: 0 0 78px;
    scroll-snap-align: start;
  }
  .home-cat__img {
    width: 68px;
    height: 68px;
  }
  .home-cat__name { font-size: 11.5px; }
  .home-rail-nav { display: none; }
  .home-rail { gap: 12px; }
  .home-rail__item { flex-basis: calc((100% - 2 * 12px) / 2.4); }
  .home-grid { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
  .home-cta { padding: 16px; }
  .home-deal__carousel .slick-list { margin: 0 -6px; }
  .home-deal__carousel .gi-product-content { padding: 2px 6px 6px; }
  /* Kart: dar ekranda sıkı ama okunur */
  .pcard { border-radius: 12px; }
  .pcard__img,
  .pcard__img img { padding: 0; }
  .pcard__img img { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
  .pcard__body { padding: 10px 10px 12px; }
  .pcard__title { font-size: 13px; }
  .pcard__price-amount { font-size: 15px; }
  .pcard__cart { flex-basis: 34px; width: 34px; height: 34px; font-size: 14px; }
  .pcard__chip { font-size: 10px; }
  .pcard__fav.gi-btn-group { width: 30px; height: 30px; font-size: 13px; }
}
