/* Grid Theme Styles */

/* Custom Header Styles */
.custom-grid-header {
  height: auto !important; /* Yüksekliği içeriğe göre ayarla */
  min-height: 56px;
}

.custom-header-row {
  height: auto !important;
  padding: 16px 16px 10px 16px; /* Üst padding artırıldı */
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* Sol(boş), Orta(logo+başlık), Sağ(butonlar) */
  align-items: center; /* Dikey ortalama */
}

.header-center-content {
  grid-column: 2; /* Ortadaki sütun */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.header-center-content img#header-logo {
  height: 50px; /* Logo yüksekliği */
  margin-bottom: 5px;
  margin-right: 0 !important; /* home.ejs inline stilini ezmek için */
}

.header-center-content .mdl-layout-title {
  line-height: 1.2;
  font-size: 18px;
  white-space: normal; /* Uzun başlıklar alt satıra geçsin */
  text-align: center;
  display: block; /* Span olduğu için block yapalım */
}

.header-right-buttons {
  grid-column: 3; /* Sağdaki sütun */
  justify-self: end; /* Sağa yasla */
  display: flex;
  align-items: center;
}

/* Kategorilerin olduğu satır */
#categories-container {
  justify-content: flex-start; /* Ortala yerine sola hizala */
  padding-left: 16px;
  padding-right: 16px;
}

body {
  background-color: #f5f5f5; /* Default background */
}

/* Grid Layout for Products */
#products-container.mdl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns by default */
  gap: 24px; /* Boşluk artırıldı */
  padding: 0; /* Ürün listesi padding'i 0 yapıldı */
}

/* Override MDL grid classes if necessary, or just use our own classes inside */
.mdl-cell {
  width: 100% !important; /* Force cells to fill grid tracks */
  margin: 0 !important;
}

/* Hide original MDL grid behavior if it conflicts */
@media (min-width: 840px) {
  #products-container.mdl-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 columns on tablet/desktop */
  }
}

@media (min-width: 1024px) {
  #products-container.mdl-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columns on large screens */
  }
}

/* Product Card Styles */
.product-grid-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-grid-card:active {
  transform: scale(0.98);
}

.product-image-container {
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  position: relative;
  background: #eee;
}

.product-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-details {
  padding: 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #333;
}

/* Product Price Overlay */
.product-price-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: white;
  border: 1px solid black;
  color: black;
  padding: 4px 8px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 14px;
  z-index: 2; /* Ensure it's above the image and below the button */
}

/* Remove old product-price styling */
.product-price {
  display: none;
}

/* Update Add Button Style */
.product-grid-card .grid-add-to-cart-button {
  position: absolute; /* Overlay on image */
  bottom: 10px;
  left: 10px; /* Sol alt köşe */
  right: auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.product-grid-card .grid-add-to-cart-button i {
  /* color: white; /* Ensure icon is white */
}

/* Category Grid Styles */
#main-categories-grid.mdl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns for categories */
  gap: 16px;
  padding: 0; /* Sağ ve sol padding kaldırıldı */
  margin: 0; /* Tüm marginler kaldırıldı */
}

/* Category Grid Card Styles */
.category-grid-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  height: 200px; /* Fixed height for categories */
}

.category-grid-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.category-grid-card .category-image {
  width: 100%;
  height: 100%;
}

.category-grid-card .category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.category-grid-card:hover .category-image img {
  transform: scale(1.05);
}

.category-name-box {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background-color: white;
  border: 1px solid black;
  padding: 0; /* Padding 0 yapıldı */
  border-radius: 8px;
  color: black;
  font-family: 'Montserrat', sans-serif;
  z-index: 1; /* Ensure it's above the image */
  /* max-width: calc(100% - 40px); */ /* Tekrar sıfırlandı */
}

.category-name-box h3 {
  margin: 0;
  font-size: 16px;
  font-weight: normal; /* Bold kaldırıldı */
  white-space: nowrap; /* Prevent text wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  /* max-width kaldırıldı */
}

/* Remove old overlay style */
.category-title-overlay {
  display: none;
}

/* Product Options Modal Styling */
#product-options-modal {
  border-radius: 16px;
  padding: 0;
  border: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden; /* Header ve footer için */
}

#product-options-modal .mdl-dialog__title {
  background-color: #f5f5f5;
  padding: 16px 24px;
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
}

#product-options-modal .mdl-dialog__content {
  padding: 24px;
  color: #555;
}

#modal-product-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-color, #ff5722); /* Vurgu rengi */
  margin-bottom: 20px;
  text-align: center;
  display: block;
}

#product-options-modal h6 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-top: 20px;
  margin-bottom: 10px;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
  display: inline-block; /* Çizgi sadece yazı kadar olsun */
}

#modal-variations-container label,
#modal-ingredients-container label,
#modal-extras-container label {
  margin-bottom: 12px !important;
  padding: 0 0 0 24px; /* Sol padding eklendi, diğerleri 0 */
  border-radius: 8px;
  transition: background-color 0.2s;
  cursor: pointer;
  display: flex; /* Flexbox kullan */
  align-items: center; /* Ortala */
  justify-content: space-between; /* İsim sola, fiyat sağa */
}

#modal-variations-container label input,
#modal-ingredients-container label input,
#modal-extras-container label input {
  margin-right: 10px; /* Input ile yazı arasına boşluk */
  flex-shrink: 0; /* Input'un küçülmesini engelle */
}

#modal-variations-container .mdl-radio__label,
#modal-ingredients-container .mdl-checkbox__label,
#modal-extras-container .mdl-checkbox__label {
  flex-grow: 1 !important; /* Yazının kalan alanı doldurmasını zorla */
  width: auto !important; /* MDL'in width ayarını ez */
  position: static !important; /* MDL'in position ayarını ez */
  white-space: normal; /* Uzun metinlerin alt satıra geçmesine izin ver */
}

.modal-option-price {
  font-weight: 600;
  color: #333;
  margin-left: 10px; /* Fiyatın soldan boşluğu */
  flex-shrink: 0; /* Fiyatın küçülmesini engelle */
  padding-right: 24px; /* Sağdan boşluk */
}

#modal-variations-container label:hover,
#modal-ingredients-container label:hover,
#modal-extras-container label:hover {
  background-color: #f9f9f9;
}

#product-options-modal .mdl-dialog__actions {
  padding: 16px 24px;
  background-color: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#product-options-modal .mdl-button {
  height: 40px;
  line-height: 40px;
  border-radius: 8px;
  text-transform: none; /* Caps lock'u kaldır */
  font-weight: 600;
}
