/*
Theme Name: Kiremit Menu
Theme URI: https://kiremitrestaurant.com
Author: Kiremit Restaurant
Author URI: https://kiremitrestaurant.com
Description: Dijital restoran menüsü teması - mobil öncelikli, admin panelli, TR/EN çift dil destekli
Version: 1.0.6
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kiremit-menu
Tags: restaurant, menu, mobile-first, food, bilingual
*/

/* =========================================
   DESIGN TOKENS
   ========================================= */
:root {
  /* Kiremit Color Palette */
  --primary: #C0533A;          /* Kiremit kırmızısı */
  --primary-light: #D4735C;    /* Açık kiremit */
  --primary-dark: #9B3E2A;     /* Koyu kiremit */
  --primary-ultra-light: #FBF0EE; /* Çok açık kiremit */
  
  /* Neutrals */
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F5F3F0;
  --border: #EAE6E1;
  --text-primary: #1A1714;
  --text-secondary: #6B6560;
  --text-muted: #9E9894;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  /* Transitions */
  --transition: 0.2s ease;
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
}

/* =========================================
   LAYOUT
   ========================================= */
.site-wrapper {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.container {
  padding: 0 20px;
}

/* =========================================
   HEADER
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(10px);
}

.site-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.site-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.3px;
  line-height: 1;
}

.site-logo-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  background: var(--surface-2);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 16px;
  color: var(--text-secondary);
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.lang-btn.active {
  background: var(--primary);
  color: white;
}

.lang-btn:hover:not(.active) {
  color: var(--primary);
}

/* =========================================
   SEARCH BAR
   ========================================= */
.search-section {
  padding: 16px 20px 12px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface-2);
  transition: all var(--transition);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(192, 83, 58, 0.12);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
}

.search-input:not(:placeholder-shown) + .search-icon + .search-clear {
  opacity: 1;
}

/* =========================================
   CATEGORIES
   ========================================= */
.categories-section {
  padding: 8px 0 16px;
  position: relative;
}

.categories-scroll {
  display: flex;
  gap: 16px;
  padding: 8px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 90px;
  width: 90px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.category-card:hover {
  transform: translateY(-2px);
}

.category-card:active {
  transform: scale(0.96);
}

.category-img-wrap {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--surface-2);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.category-card.active .category-img-wrap {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(192, 83, 58, 0.2);
}

.category-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.category-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--primary-ultra-light), var(--surface-2));
}

.category-name {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.3;
  transition: color var(--transition);
}

.category-card.active .category-name {
  color: var(--primary);
  font-weight: 700;
}

/* Scroll arrows */
.cat-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.cat-arrow:hover {
  background: var(--primary-dark);
  transform: translateY(-50%) scale(1.1);
}

.cat-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

.cat-arrow-left { left: 4px; }
.cat-arrow-right { right: 4px; }

/* =========================================
   DIVIDER
   ========================================= */
.section-divider {
  height: 6px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 4px 0;
}

/* =========================================
   PRODUCTS
   ========================================= */
.products-section {
  padding: 8px 0 60px;
}

.category-group {
  padding: 0 20px;
}

.category-group-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =========================================
   PRODUCT CARD
   ========================================= */
.product-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  border-radius: 0;
}

.product-card:last-child {
  border-bottom: none;
}

.product-card:hover:not(.out-of-stock) {
  background: var(--primary-ultra-light);
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: var(--radius-md);
}

.product-card.out-of-stock {
  opacity: 0.6;
  filter: grayscale(100%);
  cursor: not-allowed;
  pointer-events: none;
}

.product-img-wrap {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
  position: relative;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-img-wrap.fallback-logo img {
  object-fit: contain;
  padding: 12px;
  opacity: 0.8;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.product-placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--primary-ultra-light), var(--surface-2));
}

.product-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-badge.no-img-badge {
  position: static;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  margin-bottom: 2px;
}

.out-of-stock-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.out-of-stock-text-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  vertical-align: middle;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 8px;
}

.product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.product-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* =========================================
   NO RESULTS
   ========================================= */
.no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 16px;
}

.no-results.visible {
  display: flex;
}

.no-results-icon {
  font-size: 56px;
  opacity: 0.4;
}

.no-results-text {
  font-size: 16px;
  color: var(--text-muted);
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer strong {
  color: var(--primary);
}

/* =========================================
   MODAL (Product Detail)
   ========================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.modal-img.fallback-logo {
  object-fit: contain;
  padding: 24px;
}

.modal-img-placeholder {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  background: linear-gradient(135deg, var(--primary-ultra-light), var(--surface-2));
}

.modal-body {
  padding: 24px 20px;
}

.modal-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.modal-sheet-inner {
  position: relative;
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* =========================================
   SCROLL TO TOP
   ========================================= */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  font-size: 18px;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}

.scroll-top:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

/* =========================================
   LOADING SKELETON
   ========================================= */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* =========================================
   UTILITIES
   ========================================= */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (min-width: 768px) {
  .site-wrapper {
    margin: 24px auto;
    border-radius: var(--radius-xl);
    min-height: calc(100vh - 48px);
  }
}

/* Karanlık mod (dark mode) CSS kuralları kaldırılarak sitenin her zaman açık renkli görünmesi sağlandı */
