/*
Theme Name: Atom Food
Theme URI: https://atomdev.ir/
Author: Ali
Author URI: https://atomdev.ir/
Description: قالب وردپرسی رستوران و کافه با پشتیبانی از ووکامرس
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: atom-food
*/


/*font start*/
@font-face{
    font-display: swap;
    font-family: 'iranyekanBakh';
    font-weight:400;
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-04-Regular.eot);
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-04-Regular.eot?#iefix) format("embedded-opentype"),
        url(assets/fonts/woff/Yekan-Bakh-FaNum-04-Regular.woff) format("woff"),
        url(assets/fonts/ttf/Yekan-Bakh-FaNum-04-Regular.ttf) format("truetype");
}
@font-face{
    font-display: swap;
    font-family: 'iranyekanBakh';
    font-weight:500;
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-05-Medium.eot);
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-05-Medium.eot?#iefix) format("embedded-opentype"),
        url(assets/fonts/woff/Yekan-Bakh-FaNum-05-Medium.woff) format("woff"),
        url(assets/fonts/ttf/Yekan-Bakh-FaNum-05-Medium.ttf) format("truetype");
}
@font-face{
    font-display: swap;
    font-family: 'iranyekanBakh';
    font-weight:600;
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-06-Bold.eot);
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-06-Bold.eot?#iefix) format("embedded-opentype"),
        url(assets/fonts/woff/Yekan-Bakh-FaNum-06-Bold.woff) format("woff"),
        url(assets/fonts/ttf/Yekan-Bakh-FaNum-06-Bold.ttf) format("truetype");
}
@font-face{
    font-display: swap;
    font-family: 'iranyekanBakh';
    font-weight:700;
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-07-Heavy.eot);
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-07-Heavy.eot?#iefix) format("embedded-opentype"),
        url(assets/fonts/woff/Yekan-Bakh-FaNum-07-Heavy.woff) format("woff"),
        url(assets/fonts/ttf/Yekan-Bakh-FaNum-07-Heavy.ttf) format("truetype");
}
@font-face{
    font-display: swap;
    font-family: 'iranyekanBakh';
    font-weight:800;
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-08-Fat.eot);
    src:url(assets/fonts/eot/Yekan-Bakh-FaNum-08-Fat.eot?#iefix) format("embedded-opentype"),
        url(assets/fonts/woff/Yekan-Bakh-FaNum-08-Fat.woff) format("woff"),
        url(assets/fonts/ttf/Yekan-Bakh-FaNum-08-Fat.ttf) format("truetype");
}

body.font-iranyekan,
body.font-iranyekan * {
    font-family: 'iranyekanBakh', sans-serif !important;
}

body.font-vazir {
    font-family: 'vazir', sans-serif;
}


 body {
      margin: 0;
      padding: 0;
      background: #d1d1d1; 
      display: flex;
      justify-content: center;
    }
.main-container {
    width: 100%;
    max-width: 600px;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-right: 20px;
    margin-left: 20px;
}






/* --- کاور و لایه پوشاننده --- */
.header-cover {
    position: relative;
    overflow: hidden;
    height: 200px; /* ارتفاع کاور */
}
.header-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
}

/* --- بخش اصلی سربرگ --- */
.header-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 0 20px;
    position: relative;
    margin-top: 5px;
    min-height: 90px;
    height: 90px;
}

/* --- آواتار --- */
.avatar {
    position: relative;
    z-index: 2;
    top: -64px; /* نصف آواتار روی کاور */
}
.avatar .custom-logo-link,
.logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    background: #222;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- اطلاعات سایت --- */
.site-info {
    padding-bottom: 12px;
}
.title {
    margin: 0 0 4px;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
}
.tagline {
    font-size: 14px;
    color: #6b7280;
}

/* --- بخش اضافی (تماس و سبد خرید) --- */
.header-extra {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    padding-bottom: 12px;
}
.contact {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #374151;
}
.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}
.count {
    font-weight: 700;
}

/* --- منو --- */
.nav {
    margin-top: 12px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
}
.menu {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
}
.menu li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    position: relative;
    font-weight: 500;
}
.menu li.current-menu-item a,
.menu li a:hover {
    color: #111827;
}
.menu li.current-menu-item a::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 3px;
    border-radius: 3px;
    background: #111827;
}

/* --- ریسپانسیو --- */
@media (max-width: 768px) {
    .avatar .custom-logo-link,
    .logo-fallback {
        width: 96px;
        height: 96px;
    }
    .header-bar {
        grid-template-columns: auto 1fr;
    }
    .header-extra {
        grid-column: 1/-1;
        justify-content: space-between;
        padding-top: 8px;
    }
    .title {
        font-size: 20px;
    }
}




/* دکمه‌ها */
button, .buy-button, .single-product .button {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}

button:hover, .buy-button:hover, .single-product .button:hover {
    transform: translateY(-2px);
}
/**/
/* استایل جستجو */
.search-wrap {
  margin-bottom: 15px;
}
.search {
  position: relative;
  margin: 0 auto;
}
.search input {
    width: -webkit-fill-available;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s;
}
.search input:focus {
  outline: none;
}
.search-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 101;
}
.search-panel.show {
  display: block;
}
.search-loading {
  padding: 20px;
  text-align: center;
  color: #777;
}
.search-empty {
  padding: 20px;
  text-align: center;
  color: #999;
}

/* گرید نتایج جستجو */
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  padding: 15px;
}
.search-card {
  display: block;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.search-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.search-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
}
/**/



.catbar {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  top: 0;   /* می‌چسبه به بالای viewport */
  z-index: 100;
  scrollbar-width: none;
  width: 100%;
  transition: all 0.3s ease;
  padding: 10px 0;
  
}
.catbar.sticky {
    position: fixed;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: auto !important;
    background: #fff;
    padding: 12px;
    border-radius: 10px;
}
.catbar.sticky .cat-chip {
	padding: 3px;
}
/* هر دسته */
.cat-chip {
  flex: 0 0 auto;
  text-align: center;
  text-decoration: none;
  color: #444;
  transition: all 0.3s ease;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  min-width: 94px;
}

/* عکس */
.cat-img-wrap {
  width: 70px;
  height: 70px;
  margin: 0 auto 8px;
  border-radius: 50%;
  overflow: hidden;
  background: #fafafa;
  transition: all 0.3s ease;
}
.cat-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* متن */
.cat-name {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  display: block;
  transition: color 0.3s ease;
}

/* هاور و اکتیو */
.cat-chip:hover,
.cat-chip.active {
  border-color: #4a89dc;
  background: #f9fbff;
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.cat-chip:hover .cat-img-wrap,
.cat-chip.active .cat-img-wrap {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.cat-chip:hover .cat-name,
.cat-chip.active .cat-name {
  color: #4a89dc;
}




/**/

.section-title {
  margin: 0;
  font-size: 1.5rem;
}

.section-meta {
  color: #666;
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.card-top {
  display: flex;
  padding: 10px;
  gap: 10px;
  flex-direction: row-reverse; 
}
.card-body {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-title {
  margin: 0 0 5px 0;
  font-size: 1.1rem;
}

.card-excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

.card-img {
  flex: 1;
  position: relative;
}
.card-img img {
  width: 100%;
  height: auto;
  display: block;
}
.badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: red;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.card-bottom {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #eee;
}

.price-container {
  display: flex;
  align-items: stretch;
  flex: 1;
  order: 1; 
  gap: 8px; 
}

.discount-percent {
  background-color: #ff4444;
  color: white;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;  
  justify-content: center;
  align-items: center; 
}

.price-left {
  display: flex;
  flex-direction: column;
}

.sale-price {
  font-weight: bold;
  font-size: 1.1rem;
}

.regular-price {
  text-decoration: line-through;
  color: #888;
  font-size: 0.9rem;
}

.single-price {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 1.1rem;
}

.quantity-control {
  order: 2; 
}


.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
}


/***/
#coming-soon-footer-banner {
    width: auto;
}




/*****/



.quantity-control {
  display: flex;
  justify-content: center;
  align-items: center;
}

.quantity-wrap {
  display: flex;
  align-items: center;
}

.add-to-cart-btn {
  background-color: #27ae60;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-to-cart-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.qty-btn {
  width: 36px;
  height: 36px;
	padding:0px;
  border-radius: 50%;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* دکمه منفی */
.qty-btn[data-action="decrease"] {
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
}

.qty-btn[data-action="decrease"]:hover {
  background-color: #f0f0f0;
}

/* دکمه مثبت */
.qty-btn[data-action="increase"] {
  background-color: #27ae60;
  color: #fff;
}

.qty-btn[data-action="increase"]:hover {
  background-color: #2ecc71;
}

/* ورودی تعداد */
.qty-input {
  width: 40px;
  text-align: center;
  border: none;
  font-weight: bold;
  font-size: 16px;
  background: transparent;
  pointer-events: none;
  color: #333;
}

#floating-cart-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    padding: 15px;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box; /* خیلی مهم */
}

 
@media (max-width: 600px) {
	.cat-chip {
    min-width: 70px;
}
	.cat-img-wrap {
    width: 40px;
    height: 40px;
	}
	  body {
    display: block; /* دیگه flex نباشه */
    justify-content: unset; /* حذف justify-content */
    margin: 0;
    padding: 0;
    background: #d1d1d1; /* اگه میخوای رنگ پس‌زمینه هم همون بمونه */
  }

  .main-container {
    margin: 0; /* حذف margin های دسکتاپ */
    width: 100%; /* مطمئن می‌شیم کامل صفحه رو می‌گیره */
    max-width: 100%; /* محدودیت 600px حذف میشه */
    overflow: visible; /* یا hidden بسته به نیازت */
    min-height: auto; /* ارتفاع حداقل حذف می‌شه */
    flex-direction: column; /* معمولا همین میمونه */
  }
}




/******/
/* --- موبایل استایل --- */
@media (max-width: 600px) {
.header-bar {
    height: 150px;
}
  body {
    padding: 0px;
    max-width: 100%;
  }

  /* دکمه‌ها */
  button, .buy-button, .single-product .button, .add-to-cart-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
  }

  /* جستجو */
  .search input {
    font-size: 14px;
  }
  .search-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0;
  }
  .search-card img {
    height: 120px;
  }

  /* دسته‌بندی */
  .catbar {
    padding: 8px 0;
    gap: 10px;
  }
  .cat-chip {
    min-width: 70px;
    padding: 4px;
    font-size: 12px;
  }
  .cat-img-wrap {
    width: 40px;
    height: 40px;
  }
  .cat-name {
    font-size: 11px;
  }

  /* گرید کارت‌ها */
  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card-top {
    gap: 8px;
  }
  .card-title {
    font-size: 1rem;
  }
  .card-excerpt {
    font-size: 0.85rem;
  }
  .badge {
    font-size: 0.7rem;
    padding: 2px 4px;
  }

  /* قیمت و دکمه‌ها */
  .price-left .sale-price,
  .single-price {
    font-size: 1rem;
  }
  .regular-price {
    font-size: 0.8rem;
  }

  /* کنترل تعداد */
  .qty-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .qty-input {
    width: 30px;
    font-size: 14px;
  }

  /* عنوان بخش‌ها */
  .section-title {
    font-size: 1.3rem;
  }
  .section-meta {
    font-size: 0.8rem;
  }
}

/***************************/

