/* =========================================================
   layout.css — Sayfa iskelet düzeni ve responsive kurallar
   ========================================================= */

/* --- Standart Katalog Ürün Kartı (urunler.html için) --- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: inherit;
}

.card-visual {
  height: 240px;
  position: relative;
}

.card-body {
  padding: 14px 14px 16px;
}

.card-body h3 {
  font-family: var(--font-body) !important;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}

/* =========================================================
   Mobile & Tablet Drawer (Tablet ve Mobilde Görünür)
   ========================================================= */
.mobile-drawer {
  display: none !important;
}

@media (max-width: 1200px) {

  /* Masaüstü Navigasyonu Tablet ve Mobilde Gizle */
  .nav {
    display: none !important;
  }

  html.menu-open,
  body.menu-open {
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    touch-action: none;
    overscroll-behavior: none;
  }

  /* Full Screen Soldan Gelen Mobile & Tablet Drawer */
  .mobile-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    min-height: 100vh;
    min-height: 100dvh;
    background: #FAF7F2;
    z-index: 999999;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease;
    box-shadow: 10px 0 35px rgba(44, 36, 32, 0.22);
  }

  .mobile-drawer.open {
    transform: translateX(0);
    visibility: visible;
  }

  /* Mobil Menü Üst Çubuğu (Logo & Kapatma Butonu) */
  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(250, 247, 242, 0.98);
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .drawer-logo-img {
    height: 38px;
    max-width: 190px;
    width: auto;
    object-fit: contain;
  }

  .mobile-drawer-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .mobile-drawer-close:active {
    transform: scale(0.92);
    background: rgba(44, 36, 32, 0.08);
  }

  .mobile-drawer-close svg {
    width: 20px;
    height: 20px;
  }

  /* Mobil Menü İçerik Alanı (Tam Ekran) */
  .mobile-drawer-content {
    padding: 20px 16px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Yatay Sıralı Görsel Kategoriler (Büyütülmüş & Ferah) */
  .mobile-visual-cats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .mobile-cat-card {
    position: relative;
    height: 84px;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    text-decoration: none;
    border: 1px solid rgba(228, 217, 204, 0.85);
    box-shadow: 0 4px 14px rgba(44, 36, 32, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .mobile-cat-card:active {
    transform: scale(0.98);
  }

  .mobile-cat-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
  }

  .mobile-cat-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(32, 24, 20, 0.86) 0%, rgba(32, 24, 20, 0.42) 55%, rgba(32, 24, 20, 0.76) 100%);
  }

  .mobile-cat-title {
    position: relative;
    z-index: 2;
    color: #fffdf9;
    font-family: var(--font-heading);
    font-size: 1.32rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  }

  .mobile-cat-icon {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 253, 249, 0.24);
    border: 1px solid rgba(255, 253, 249, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fffdf9;
    flex-shrink: 0;
  }

  /* Mobil Menü Link Listesi */
  .mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }

  .mobile-link-item {
    width: 100%;
    border-bottom: 1px solid rgba(228, 217, 204, 0.6);
  }

  .mobile-link-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 8px;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-body);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.15s ease;
  }

  .mobile-link-title.indirim {
    color: #c0392b;
    font-weight: 600;
  }

  .mobile-link-item .chevron {
    width: 14px;
    height: 14px;
    opacity: 0.65;
    flex-shrink: 0;
    transition: transform 0.25s ease, color 0.15s ease, opacity 0.15s ease;
  }

  .mobile-link-item.open .chevron {
    transform: rotate(180deg);
    color: var(--accent);
    opacity: 1;
  }

  .mobile-link-sub {
    display: none;
    flex-direction: column;
    padding: 4px 0 12px 16px;
    gap: 10px;
    border-left: 2px solid var(--gold);
    margin: 4px 0 12px 6px;
  }

  .mobile-link-item.open .mobile-link-sub {
    display: flex;
  }

  .mobile-link-sub a {
    color: var(--ink-soft);
    font-size: 0.94rem;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.15s;
  }

  .mobile-link-sub a:hover {
    color: var(--accent);
  }

  /* Mobil Menü Alt Destek Butonları */
  .mobile-menu-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .mobile-menu-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(44, 36, 32, 0.04);
  }

  .mobile-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-radius: 10px;
    background: #25D366;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
  }

  .site-header .wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 16px !important;
  }

  .header-inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 8px;
    padding: 0 !important;
  }

  .header-left {
    order: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
  }

  .menu-btn {
    display: grid !important;
  }

  .site-header .logo {
    order: 2;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
  }

  .site-header .site-logo-img {
    height: 40px;
    max-width: 180px;
  }

  .header-actions {
    order: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    z-index: 2;
  }

  #fav-btn {
    display: none !important;
  }
}

/* Tablet Dikey & Küçük Tablet (<= 991px) */
@media (max-width: 991px) {
  .top-bar-badges .top-bar-badge:not(:first-child) {
    display: none;
  }

  .site-header .wrap {
    padding: 0 12px !important;
  }

  .header-inner {
    height: 64px;
    gap: 6px;
    padding: 0 !important;
  }

  .site-header .site-logo-img {
    height: 42px;
    max-width: 185px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .icon-btn svg {
    width: 19px;
    height: 19px;
  }
}

/* Mobil Telefonlar (<= 640px) */
@media (max-width: 640px) {
  .top-bar {
    display: none !important;
  }

  .site-header .wrap {
    padding: 0 8px !important;
  }

  /* Mobilde header alanının köşelere yaklaşması ve ferah durması */
  .header-inner {
    height: 62px;
    gap: 4px;
    padding: 0 !important;
  }

  .site-header .logo {
    gap: 0;
    min-width: 0;
  }

  .site-header .site-logo-img {
    height: 40px !important;
    max-width: 175px !important;
    object-fit: contain;
  }

  .header-left,
  .header-actions {
    gap: 1px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .header-sep {
    display: none;
  }
}

/* Küçük Mobil Telefonlar (<= 380px) */
@media (max-width: 380px) {
  .site-header .wrap {
    padding: 0 4px !important;
  }

  .header-inner {
    height: 58px;
    gap: 2px;
    padding: 0 !important;
  }

  .site-header .site-logo-img {
    height: 35px !important;
    max-width: 150px !important;
  }

  .header-left,
  .header-actions {
    gap: 0;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Footer Logo İzolasyonu (Sayfa İçi Kayma Koruması) */
.site-footer .footer-logo,
.site-footer .logo,
.footer-brand-block .footer-logo,
.footer-brand-block .logo {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  margin: 0 0 1rem 0 !important;
  display: inline-block !important;
  order: initial !important;
  z-index: auto !important;
}