/* ============ VITRIN (orijinal CSS'e dokunmadan) ============ */

.category-title {
  max-width: 80%;
  margin: 24px auto 10px;
  padding: 0 20px;
  font-weight: 900;
}

.add-to-cart {
  width: 100%;
  border: none;
  padding: 10px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

/* product-info'yu referans gibi ortala */
.product-info {
  margin-top: 12px !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  text-align: center !important;
  width: 100%;
  display: grid !important;
  gap: 8px;
  justify-items: center;
}

/* Ürün adı */
.product-name {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
  max-width: 95%;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}

/* Kapsül */
.meta-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #111;
  font-size: 15px;
  font-weight: 600;
}

/* Mobil kısıt: 2 sütun + 30vh */
@media (max-width: 550px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .product-card {
    height: 30vh !important;
  }

  .product-image img {
    height: 100%;
    object-fit: contain;
  }

  .product-info {
    gap: 6px;
    margin-top: 8px !important;
  }

  .product-name {
    font-size: 12px;
  }

  .meta-pill {
    font-size: 11px;
    padding: 5px 9px;
  }
}

/* ============ SEPET (DRAWER) ============ */

.cart-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1003;
  background: #000;
  color: #fff;
  border: none;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 10px;
}

.cart-count {
  background: red;
  color: #fff;
  border-radius: 50%;
  padding: 2px 7px;
  font-size: 12px;
  margin-left: 6px;
  display: inline-block;
  min-width: 22px;
  text-align: center;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 1000;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 460px;
  height: 100vh;
  background: #fff;
  border-left: 2px solid #000;
  padding: 16px;
  transition: .25s;
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.cart-panel {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cart-panel.open {
  right: 0;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  gap: 10px;
}

.cart-item-name {
  font-size: 13px;
  flex: 1;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.qty-controls button {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}

.total {
  font-weight: bold;
  margin: 10px 0;
  padding: 10px;
  border-radius: 10px;
  background: #f3f4f6;
  font-size: 18px;
}

.cart-panel form input,
.cart-panel form button {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  font-size: 18px;
  border: 1px solid #ddd;
}

.cart-panel form button {
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
}

/* Sepet açıkken sağ üst buton gizlensin */
body.cart-open .cart-button {
  opacity: 0;
  pointer-events: none;
}

/* Sepet panel üst başlık barı */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.cart-title {
  font-size: 16px;
  font-weight: 700;
}

.cart-close {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cart-close:active {
  transform: scale(0.98);
}

/* Sepet açıkken arka plan scroll kilidi */
body.cart-open {
  overflow: hidden;
  touch-action: none;
}


/* === BOTTOM SHEET SEPET === */
.cart-panel {
  left: 0;
  right: 0;
  bottom: -100%;
  top: auto;

  width: 100%;
  height: 85vh;

  border-radius: 16px 16px 0 0;
  transition: bottom .35s ease;
}

.cart-panel {
  will-change: transform;
}

/* Açık hali */
.cart-panel.open {
  bottom: 0;
}

/* Form butonları yan yana */
.cart-panel form .form-actions {
  display: flex;
  gap: 10px;
}

.cart-panel form .form-actions button {
  flex: 1;
}

/* Görsel önizleme açıkken scroll kilidi */
body.img-preview-open {
  overflow: hidden;
  touch-action: none;
}

.success-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(-18px);
  background: #16a34a;
  color: #fff;
  padding: 14px 18px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transition: .35s ease;
  z-index: 9999;
  min-width: 300px;
  max-width: min(680px, calc(100vw - 24px));
}

.success-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.toast-text {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.toast-text strong {
  font-size: 15px;
}

.toast-text span {
  font-size: 13px;
  opacity: .92;
}

/* Tablet + Desktop: daha büyük */
@media (min-width: 768px) {
  .success-toast {
    top: 28px;
    padding: 22px 28px;
    /* kart daha iri */
    border-radius: 20px;
    min-width: 520px;
    /* belirgin fark */
  }

  .toast-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .toast-text {
    font-size: 17px;
  }

  .toast-text strong {
    font-size: 18px;
  }

  .toast-text span {
    font-size: 15px;
  }
}



/* ==========================
   MASAUSTU: SEPET BUYUTME
   ========================== */
@media (min-width: 1025px) {

  /* Ürün satırları */
  .cart-item {
    padding: 14px !important;
    gap: 14px;
  }

  .cart-item-name {
    font-size: 15px;
    line-height: 1.4;
  }

  /* Fiyat */
  .cart-item-name span {
    font-size: 13px !important;
  }

  /* +/- alanı */
  .qty-controls {
    gap: 10px;
  }

  .qty-controls button {
    padding: 6px 14px;
    font-size: 16px;
  }

  /* Toplam alanı */
  .total {
    font-size: 20px;
    padding: 14px;
  }


  body .cart-panel {
    width: clamp(420px, 25vw, 560px) !important;

    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;

    height: 100vh !important;
    border-radius: 0 !important;

    transform: translateX(110%) !important;
    /* kapali */
    transition: transform .25s ease !important;
  }

  /* Acik durum */
  body .cart-panel.open {
    transform: translateX(0) !important;
  }
}



/* ==========================
   SEPET: MASAUSTU ZORLA SAGDAN
   ========================== */
@media (min-width: 551px) {
  .cart-panel {
    top: 0 !important;
    right: -380px !important;
    left: auto !important;
    bottom: auto !important;

    width: 360px !important;
    height: 100vh !important;

    border-radius: 0 !important;
    transform: none !important;

    transition: right .25s ease !important;
  }

  .cart-panel.open {
    right: 0 !important;
    bottom: auto !important;
    /* baska dosyadan bottom gelirse iptal */
  }

  /* ==========================
   TABLET: SEPET BUTONU BUYUTME
   ========================== */
  .cart-button {
    padding: 14px 18px;
    /* buton alanı */
    font-size: 16px;
    /* yazı */
    border-radius: 14px;
    /* daha yumuşak */
  }

  /* Eğer ikon varsa (svg / i) */
  .cart-button svg,
  .cart-button i {
    width: 20px;
    height: 20px;
  }
}


@media (max-width: 550px) {

  /* Sepet butonu */
  .cart-button {
    font-size: 16px;
    padding: 12px 14px;
  }

  .cart-count {
    font-size: 14px;
    padding: 3px 9px;
    min-width: 26px;
  }

  /* Sepet panel başlık ve toplam */
  .cart-panel h2 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .total {
    font-size: 16px;
  }

  /* Form alanı (input + submit) */
  .cart-panel form input,
  .cart-panel form button {
    font-size: 19px;
    padding: 12px;
  }

  /* +/- kontrolü (sepetteki adet butonları) */
  .qty-controls {
    font-size: 16px;
  }

  .qty-controls button {
    font-size: 18px;
    padding: 6px 12px;
  }

  .product-info {
    gap: 10px !important;
    justify-content: flex-end;
  }

  /* Ürün adı biraz daha okunaklı */
  .product-name {
    font-size: 15px;
    line-height: 1.3;
  }

  /* Fiyat kapsülü biraz öne çıksın */
  .meta-pill {
    font-size: 15px;
    padding: 6px 12px;
  }

  /* Buton her zaman alta yaslansın */
  .product-card {
    justify-content: space-between;
  }

  .add-to-cart {
    margin-top: 6px;
  }

  .cart-panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: -100%;

    width: 100%;
    height: 85vh;

    border-radius: 16px 16px 0 0;
    transition: bottom .35s ease;
  }

  .cart-panel.open {
    bottom: 0;
  }

  .shop-wrap,
  #shopRoot {
    width: 100% !important;
    max-width: 100% !important;

    /* KRITIK */
    height: auto !important;
    overflow: visible !important;
  }

  .product-card {
    height: 50vh !important;
  }

  /* Ana kapsayıcı full genişlik */
  .shop-wrap,
  #shopRoot {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Asıl kısıt burasıydı: grid %80'e sıkışıyordu */
  .product-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 12px 24px !important;
  }

  /* (Varsa) kategori başlığı da %80 kısıtlıydı */
  .category-title {
    max-width: 100% !important;
    margin: 16px 0 8px !important;
    padding: 0 12px !important;
  }

  .img-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .img-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
  }


}