/*
Theme Name: Chonin Digital Menu
Theme URI: https://chonin.cafe
Author: Chonin Cafe
Description: نسخه جدید تم چون این با طراحی الهام‌گرفته از رستوران‌های مدرن. منوی دیجیتال، هیرو با عکس تابلو، دسته‌بندی‌های کاروسلی مستطیلی و کارت‌های محصول دقیق مطابق رفرنس.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: chonin-digital
Tags: rtl, persian, woocommerce, restaurant, digital-menu, modern
*/

/* ===== فقط فونت Vazirmatn (رایگان و فوری) ===== */
:root {
  --font-primary: 'Vazirmatn', system-ui, -apple-system, sans-serif;

  --color-red: #C8102E;
  --color-dark-green: #0D3B2E;
  --color-light-bg: #F4F6F8;
  --color-white: #FFFFFF;
  --color-text: #1F2937;
  --color-text-light: #6B7280;
  --color-border: #E5E7EB;
  --color-accent: #0D3B2E;

  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

html {
  direction: rtl;
}

/* اعمال فونت Vazirmatn به تمام المان‌ها از همان ابتدا */
body,
button,
input,
select,
textarea,
.button,
.woocommerce,
.woocommerce-page,
.woocommerce input,
.woocommerce button,
.woocommerce a.button {
  font-family: var(--font-primary) !important;
}

body {
  font-family: var(--font-primary) !important;
  background: var(--color-light-bg);
  color: var(--color-text);
  margin: 0;
  line-height: 1.6;
}

/* Top Light Bar (Sticky) */
.top-bar {
  background: #F8FAFC;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 101;
}

.top-bar .logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-dark-green);
  display: flex;
  align-items: center;
}

/* لوگو: تصویر اصلی پرکیفیت آپلود شود؛ ابعاد نمایش این‌جا محدود می‌شود تا واضح بماند */
.top-bar .logo img,
.top-bar .logo .custom-logo {
  height: 48px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}
.top-bar .logo a {
  display: inline-flex;
  align-items: center;
}

.top-bar .icons-left {
  display: flex;
  gap: 1.1rem;
  font-size: 1.4rem;
  align-items: center;
}

.top-bar .icons-left a {
  text-decoration: none;
  color: #1F2937;
  font-size: 1.4rem;
  line-height: 1;
}

.top-bar .cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.top-bar .cart-count {
  position: absolute;
  top: -6px;
  left: -10px;
  background: #C8102E;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Red Navigation Bar */
.nav-red {
  background: #6b210f;
  color: white;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: sticky;
  top: 56px;
  z-index: 100;
}

.nav-red .hamburger {
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.nav-red .nav-links {
  display: flex;
  gap: 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-red .nav-links a {
  color: white;
  text-decoration: none;
}

/* Hero */
.hero {
  width: 100%;
  height: 420px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.35));
}
/* Category Cards - Stable (فقط ۱۰٪ کوچکتر) */
.category-section {
  margin: -60px 1rem 2rem;
  position: relative;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.category-section::-webkit-scrollbar { display: none; }
.category-section { -ms-overflow-style: none; scrollbar-width: none; }

.category-section:has(.category-carousel) {
  display: block;
  overflow-x: visible;
  padding: 0;
}

.category-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* فقط این بخش تغییر کرد - ۱۰٪ کوچکتر */
.category-card,
.category-tab {
  flex: 0 0 144px;           /* ۱۰٪ کوچکتر از 160 */
  height: 142px;              /* ۱۰٪ کوچکتر از 158 */
  min-height: 142px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.1rem 0.9rem;     /* کمی کوچکتر برای تناسب */
  text-align: center;
  box-shadow: var(--shadow-md);
  scroll-snap-align: start;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}

.category-card.active,
.category-tab.active {
  border-color: var(--color-dark-green);
  background: #F0FAF5;
  box-shadow: 0 6px 16px rgba(13, 59, 46, 0.12);
}

.category-card .icon,
.category-tab .tab-icon {
  width: 52px;
  height: 52px;
  background: #F1F5F9;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.65rem;
  font-size: 1.7rem;
  flex-shrink: 0;
}

.category-card h4,
.category-tab .tab-label {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-dark-green);
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Product Card */
.product-card {
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #F1F5F9;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.product-card .pc-top {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 0.9rem;
}

.product-card .product-image {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  flex-shrink: 0;
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
}

.product-card .pc-info {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.product-card h3 {
  font-size: 1.12rem;
  font-weight: 800;
  color: #1F2937;
  margin: 0 0 0.3rem;
  line-height: 1.35;
}

.product-card h3 a {
  color: inherit;
  text-decoration: none;
}

.product-card h3 a:hover {
  color: #0D3B2E;
}

.product-card p {
  font-size: 0.88rem;
  color: #6B7280;
  line-height: 1.55;
  margin: 0;
}

.product-card .pc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 1rem;
}

.product-card .pc-price {
  font-weight: 800;
  font-size: 1.05rem;
  color: #1F2937;
  white-space: nowrap;
}

.add-btn {
  border: 1.8px solid #0D3B2E;
  color: #0D3B2E;
  background: transparent;
  padding: 0.48rem 0.69rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  
  /* FIX: ۴۰٪ کوچکتر */
  flex: 0 0 35%;
  max-width: 35%;
  text-align: center;
}

.add-btn:hover {
  background: #0D3B2E;
  color: white;
}

/* Responsive */
@media (max-width: 640px) {
  .category-card {
    flex: 0 0 140px;
    height: 142px;
    min-height: 142px;
  }
  .add-btn {
    flex: 0 0 38%;
    max-width: 38%;
  }
}

/* Single Product Page */
.single-product-wrap {
  max-width: 720px;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
}

.sp-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #F1F5F9;
  padding: 2rem 1.5rem;
  text-align: center;
}

.sp-image {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 1.5rem;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.sp-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.sp-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0D3B2E;
  margin: 0 0 1rem;
}

.sp-desc {
  font-size: 0.98rem;
  color: #4B5563;
  line-height: 1.8;
  margin: 0 auto 1.25rem;
  max-width: 560px;
}

.sp-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1F2937;
  margin-bottom: 1.5rem;
}

.sp-price del {
  color: #9CA3AF;
  font-weight: 600;
  margin-left: 0.4rem;
}

.sp-add {
  margin-bottom: 1.5rem;
}

.sp-add form.cart {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.sp-add .quantity input {
  width: 64px;
  padding: 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-primary);
}

.sp-add button.single_add_to_cart_button,
.sp-add .single_add_to_cart_button {
  background: #6b210f !important;
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: background 0.2s ease;
}

.sp-add button.single_add_to_cart_button:hover {
  background: #C8102E;
}

.sp-back {
  display: inline-block;
  color: #6B7280;
  text-decoration: none;
  font-size: 0.95rem;
}

.sp-back:hover {
  color: #0D3B2E;
}
/* -------------------------------------------------------
   آیکون و لیبل داخل category-tab (inject شده توسط JS)
------------------------------------------------------- */
.category-tab .tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: #F1F5F9;
  border-radius: 9999px;
  font-size: 1.75rem;
  margin: 0 auto 0.6rem;
  flex-shrink: 0;
  line-height: 1;
}

.category-tab.active .tab-icon {
  background: #D7F0E3;
}

.category-tab .tab-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-dark-green);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}
