/*
Theme Name: Hamtefun
Theme URI: https://hamtefun.ir
Author: Hamtefun
Author URI: https://hamtefun.ir
Description: قالب فروشگاهی حامتفان — فروشگاه لوازم جانبی موبایل. راست‌چین، فارسی، پالت پاستلی، سازگار با ووکامرس.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hamtefun
Tags: e-commerce, rtl, custom-logo, woocommerce
Requires at least: 6.0
Requires PHP: 7.4
*/

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Digikala';
  src: url('assets/fonts/digikala-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DigikalaFat';
  src: url('assets/fonts/digikala-variable.woff2') format('woff2-variations');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variables ---------- */
:root {
  /* Pastel palette: primary pastel green + sky / peach / lavender / mint / butter accents (no pink) */
  --primary: #A9DCC3;
  --primary-hover: #93CFA9;
  --primary-deep: #3E7D5B;
  --primary-deeper: #356B4D;
  --primary-light: #DFF3E6;
  --primary-pale: #EFF9F2;
  --mint: #C9EDD9;
  --mint-deep: #4F9C70;
  --mint-light: #EAF8F1;
  --mint-pale: #F3FBF6;
  --lavender: #C9BFF2;
  --lavender-deep: #8579C6;
  --lavender-light: #E6DFFB;
  --lavender-pale: #F1EDFC;
  --peach: #FFD9AE;
  --peach-deep: #CE9046;
  --peach-light: #FFE9CF;
  --peach-pale: #FFF3E1;
  --sky: #AEDFF7;
  --sky-deep: #5E97BC;
  --sky-light: #D9F0FC;
  --sky-pale: #EBF7FD;
  --butter: #FBEFC3;
  --butter-deep: #BFA13C;
  --ink: #4A3F45;
  --text: #57474F;
  --muted: #8C717D;
  --bg: #FFFBF7;
  --surface: #ffffff;
  --bg-soft: #FBF1EA;
  --border: #F1E2D9;
  --gold: #f59e0b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(62, 125, 91, .13);
  --shadow-card: 0 4px 18px rgba(74, 63, 69, .07);
  --font: 'Digikala', Tahoma, sans-serif;
  --font-fat: 'DigikalaFat', 'Digikala', Tahoma, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  line-height: 1.9;
  font-size: 16px;
}
a { color: var(--primary-deep); text-decoration: none; }
a:hover { color: var(--primary-deeper); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-fat); color: var(--ink); line-height: 1.5; margin: 0 0 .5em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 14px; border: 2px solid transparent;
  font-family: var(--font-fat); font-size: 16px; cursor: pointer;
  transition: all .2s ease; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: var(--ink); }
.btn-primary:hover { background: var(--primary-hover); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: rgba(74,63,69,.45); }
.btn-outline:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.btn-green { background: var(--primary); color: var(--ink); }
.btn-green:hover { background: var(--primary-hover); color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; transition: box-shadow .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(74,63,69,.10); }
.header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 0;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--primary); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.logo-text { line-height: 1.25; }
.logo-text .fa-name { font-family: var(--font-fat); font-size: 24px; color: var(--primary-deep); display: block; }
.logo-text .en-name { font-size: 12px; letter-spacing: 3px; color: var(--muted); display: block; }
.logo-text .tagline { font-size: 11px; color: var(--muted); display: block; }

.header-search { flex: 1; max-width: 460px; }
.header-search form { display: flex; background: var(--bg-soft); border: 1.5px solid var(--border); border-radius: 14px; overflow: hidden; }
.header-search input[type="search"] {
  flex: 1; border: 0; background: transparent; padding: 10px 16px;
  font-family: var(--font); font-size: 14px; outline: none;
}
.header-search button {
  border: 0; background: var(--primary); color: var(--ink); padding: 0 18px; cursor: pointer;
  display: flex; align-items: center;
}
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-action { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--text); position: relative; line-height: 1.5; }
.header-action:hover { color: var(--primary-deep); }
.header-action svg { width: 24px; height: 24px; }
.cart-count {
  position: absolute; top: -6px; inset-inline-start: 2px;
  background: var(--primary); color: var(--ink); font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.btn-login { background: var(--primary); color: var(--ink) !important; padding: 10px 20px; border-radius: 12px; font-family: var(--font-fat); font-size: 14px; flex-shrink: 0; margin-inline-start: auto; white-space: nowrap; }
.btn-login:hover { background: var(--primary-hover); }

.header-nav { border-top: 1px solid var(--border); }
.header-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 10px 0; flex-wrap: wrap; }
.header-nav a { color: var(--text); font-size: 14px; }
.header-nav a:hover { color: var(--primary-deep); }
.search-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, #DFF3E6 0%, #FFFBF0 52%, #FFE9D2 100%);
  color: var(--ink); overflow: hidden; position: relative;
}
.hero-inner {
  display: flex; align-items: center; gap: 32px;
  padding: 56px 0 64px; position: relative; z-index: 2;
}
.hero-text { flex: 1; max-width: 560px; }
.hero-text h1 { color: var(--ink); font-size: 40px; margin-bottom: 14px; }
.hero-text p { font-size: 17px; opacity: .88; margin: 0 0 26px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-visual { flex: 1; display: flex; justify-content: center; }
.hero-art { position: relative; width: 380px; height: 300px; }
.hero-phone {
  position: absolute; bottom: 0; inset-inline-start: 50%; transform: translateX(50%);
  width: 130px; height: 250px; border-radius: 26px;
  background: #fff; box-shadow: 0 24px 50px rgba(74,63,69,.22);
  border: 6px solid #4A3F45;
}
.hero-phone::after {
  content: ''; position: absolute; inset: 14px 10px;
  border-radius: 16px; background: linear-gradient(160deg, var(--primary-light), #fff);
}
.hero-case {
  position: absolute; width: 62px; height: 110px; border-radius: 14px;
  box-shadow: 0 12px 26px rgba(74,63,69,.18);
}
.hero-case::before {
  content: ''; position: absolute; top: 10px; inset-inline-start: 10px;
  width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.55);
}
.case-1 { background: #A9DCC3; top: 6px; inset-inline-start: 6px; transform: rotate(-12deg); }
.case-2 { background: #FFD9AE; top: 0; inset-inline-start: 92px; transform: rotate(8deg); }
.case-3 { background: #AEDFF7; top: 26px; inset-inline-end: 66px; transform: rotate(14deg); }
.case-4 { background: #C9BFF2; top: 128px; inset-inline-start: 0; transform: rotate(-18deg); }
.case-5 { background: #C9EDD9; top: 118px; inset-inline-end: 6px; transform: rotate(10deg); }
.hero-badge {
  position: absolute; bottom: 18px; inset-inline-end: 24px;
  background: #fff; color: var(--primary-deep); border-radius: 14px;
  padding: 8px 16px; font-family: var(--font-fat); font-size: 14px;
  box-shadow: var(--shadow-card);
}

/* ---------- Categories ---------- */
.categories { padding: 42px 0 8px; }
.categories-row {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.category-item { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 108px; color: var(--text); }
.category-item:hover { color: var(--primary-deep); }
.category-circle {
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--cat-bg, var(--primary-pale));
  display: flex; align-items: center; justify-content: center;
  transition: all .2s ease;
}
.category-item:hover .category-circle { background: var(--cat-bg-hover, var(--primary-light)); transform: translateY(-4px); }
.category-circle svg { width: 42px; height: 42px; stroke: var(--cat-ink, var(--primary-deep)); }
/* Per-category pastel tints */
.tint-green { --cat-bg: var(--primary-light); --cat-bg-hover: var(--primary); --cat-ink: var(--primary-deep); }
.tint-sky { --cat-bg: var(--sky-light); --cat-bg-hover: var(--sky); --cat-ink: var(--sky-deep); }
.tint-peach { --cat-bg: var(--peach-light); --cat-bg-hover: var(--peach); --cat-ink: var(--peach-deep); }
.tint-lavender { --cat-bg: var(--lavender-light); --cat-bg-hover: var(--lavender); --cat-ink: var(--lavender-deep); }
.tint-mint { --cat-bg: var(--mint-light); --cat-bg-hover: var(--mint); --cat-ink: var(--mint-deep); }
.tint-butter { --cat-bg: var(--butter); --cat-bg-hover: #F5DF94; --cat-ink: var(--butter-deep); }
.category-item span { font-family: var(--font-fat); font-size: 15px; }

/* ---------- Brands ---------- */
.brands { padding: 30px 0 6px; text-align: center; }
.brands h3 { font-size: 16px; color: var(--muted); font-family: var(--font); }
.brands-row { display: flex; justify-content: center; align-items: center; gap: 56px; flex-wrap: wrap; padding: 8px 0 4px; }
.brand-logo { font-size: 27px; color: var(--ink); letter-spacing: 1px; }
.brand-anker { font-weight: 900; font-style: italic; font-family: Arial, sans-serif; color: var(--sky-deep); }
.brand-baseus { font-weight: 700; font-family: Arial, sans-serif; color: var(--primary-deep); }
.brand-spigen { font-weight: 600; font-family: Arial, sans-serif; text-transform: lowercase; color: var(--lavender-deep); }

/* ---------- Sections & product cards ---------- */
.section { padding: 38px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 26px; margin: 0; }
.section-head .view-all { font-size: 14px; font-family: var(--font-fat); }
.products-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  list-style: none; margin: 0; padding: 0;
}
.product-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center; box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.product-card .thumb { display: block; margin-bottom: 12px; }
.product-card .thumb img { border-radius: var(--radius-sm); max-height: 180px; width: auto; margin: 0 auto; }
.product-card h3, .product-card .woocommerce-loop-product__title { font-size: 16px; margin: 0 0 6px; }
.product-card .star-rating { margin: 0 auto 8px; color: var(--gold); }
.product-card .price { color: var(--primary-deep); font-family: var(--font-fat); font-size: 17px; margin-top: auto; }
.product-card .price del { color: var(--muted); font-size: 13px; font-family: var(--font); }
.product-card .button, .product-card .add_to_cart_button {
  margin-top: 12px; background: var(--primary); color: var(--ink); border-radius: 12px;
  padding: 10px 18px; font-family: var(--font-fat); display: inline-block;
}
.product-card .button:hover { background: var(--primary-hover); color: var(--ink); }
.star-rating { position: relative; display: inline-block; font-size: 14px; line-height: 1; }

/* ---------- Service band ---------- */
.service-band { background: linear-gradient(90deg, var(--primary-pale), var(--primary-light)); color: var(--ink); }
.service-band-inner {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 0; font-family: var(--font-fat); font-size: 15px; text-align: center;
}
.service-band .sep { opacity: .55; color: var(--primary-deep); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px;
  padding: 44px 0 30px;
}
.footer-grid h4 { font-size: 17px; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--text); font-size: 14px; }
.footer-grid a:hover { color: var(--primary-deep); }
.footer-about p { color: var(--muted); font-size: 14px; }
.footer-contact li { font-size: 14px; color: var(--text); }
.copyright {
  border-top: 1px solid var(--border); padding: 16px 0;
  text-align: center; color: var(--muted); font-size: 13px;
}

/* ---------- Mobile bottom nav ---------- */
.mobile-bottom-nav {
  display: none; position: fixed; bottom: 0; right: 0; left: 0; z-index: 120;
  background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(74,63,69,.08);
}
.mobile-bottom-nav ul { display: flex; list-style: none; margin: 0; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.mobile-bottom-nav li { flex: 1; }
.mobile-bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--muted);
}
.mobile-bottom-nav a.active, .mobile-bottom-nav a:hover { color: var(--primary-deep); }
.mobile-bottom-nav svg { width: 23px; height: 23px; }

/* ---------- Content pages ---------- */
.page-content { padding: 36px 0 56px; }
.page-content .entry-title { font-size: 30px; }
.entry-content { max-width: 820px; }
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.woocommerce-ordering select, .woocommerce .quantity input {
  font-family: var(--font); padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 10px;
}

/* WooCommerce single product */
.single-product-wrap { padding: 36px 0 56px; }
.woocommerce div.product .summary .price { color: var(--primary-deep); font-family: var(--font-fat); font-size: 24px; }
.woocommerce div.product form.cart .button,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  background: var(--primary); color: var(--ink); border-radius: 12px; font-family: var(--font-fat);
}
.woocommerce div.product form.cart .button:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--primary-hover); color: var(--ink); }
.woocommerce-tabs ul.tabs li.active a { color: var(--primary-deep); }
.onsale {
  background: #ef4444 !important; border-radius: 10px !important;
  font-family: var(--font-fat); padding: 4px 10px !important; min-height: 0 !important; line-height: 1.6 !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-text h1 { font-size: 32px; }
}
@media (max-width: 768px) {
  body { padding-bottom: 64px; }
  .mobile-bottom-nav { display: block; }
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .logo { order: 1; }
  .header-actions { order: 2; gap: 12px; }
  .search-toggle { order: 3; display: block; flex-shrink: 0; }
  .btn-login { order: 4; }
  .header-search { order: 5; flex-basis: 100%; max-width: none; display: none; }
  .header-search.open { display: block; }
  .header-action .label { display: none; }
  .logo-text .tagline { display: none; }
  .header-nav { display: none; }
  .hero-inner { flex-direction: column; text-align: center; padding: 38px 0 48px; }
  .hero-text { max-width: none; }
  .hero-ctas { justify-content: center; }
  .hero-art { width: 300px; height: 250px; transform: scale(.88); }
  .categories-row { justify-content: center; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .section-head h2 { font-size: 21px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr 1fr; }
  .btn-login { padding: 8px 14px; font-size: 13px; }
  .header-inner { gap: 10px; }
  .logo { gap: 7px; }
  .logo-mark { width: 36px; height: 36px; border-radius: 11px; }
  .logo-text .fa-name { font-size: 19px; }
  .logo-text .en-name { font-size: 10px; letter-spacing: 2px; }
  .header-actions { gap: 9px; }
}
/* ---------- Shop archive grid = homepage grid (fix 2026-11-25) ---------- */
.woocommerce ul.products {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin: 0; padding: 0; list-style: none;
}
.woocommerce ul.products::before, .woocommerce ul.products::after { content: none !important; }
.woocommerce ul.products li.product-card {
  float: none !important; width: auto !important; margin: 0 !important; min-width: 0;
}
@media (max-width: 992px) {
  .woocommerce ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
/* ---------- Header: one single row on mobile (fix 2026-11-25) ---------- */
@media (max-width: 768px) {
  .site-header .container { padding: 0 10px; }
  .header-inner { flex-wrap: nowrap; gap: 7px; padding: 10px 0; position: relative; }
  .logo { gap: 6px; min-width: 0; }
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; }
  .logo-text .fa-name { font-size: 17px; white-space: nowrap; }
  .logo-text .en-name { display: none; }
  .header-actions { gap: 9px; flex-shrink: 0; }
  .header-action svg { width: 21px; height: 21px; }
  .ham-theme-toggle { width: 34px; height: 34px; flex-shrink: 0; }
  .ham-theme-toggle svg { width: 17px; height: 17px; }
  .search-toggle { flex-shrink: 0; }
  .search-toggle svg { width: 21px; height: 21px; }
  .btn-login { padding: 7px 10px; font-size: 12px; flex-shrink: 0; }
  .header-search { display: none; }
  .header-search.open {
    display: block; position: absolute; top: 100%; inset-inline: 0;
    z-index: 101; background: var(--surface); padding: 8px 2px;
  }
}
@media (max-width: 400px) {
  .header-actions { gap: 7px; }
  .logo-text .fa-name { font-size: 16px; }
  .btn-login { padding: 6px 8px; font-size: 11px; }
}

/* ---------- Mobile menu strip: visible, one scrollable line (fix 2026-11-25) ---------- */
@media (max-width: 768px) {
  .header-nav { display: block; border-top: 1px solid var(--border); }
  .header-nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 18px; padding: 8px 0; scrollbar-width: none; }
  .header-nav ul::-webkit-scrollbar { display: none; }
  .header-nav a { white-space: nowrap; font-size: 13.5px; }
}
/* ---------- Nav sub-menu: products categories dropdown (fix 2026-11-25) ---------- */
.header-nav li { position: relative; }
.header-nav .sub-menu {
  display: none; position: absolute; top: 100%; inset-inline-start: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: 8px 0; min-width: 180px;
  flex-direction: column; gap: 0; z-index: 130; list-style: none; margin: 0;
}
.header-nav .sub-menu li a { display: block; padding: 7px 16px; white-space: nowrap; }
.header-nav li:hover .sub-menu, .header-nav li.open .sub-menu { display: flex; }
@media (max-width: 768px) {
  .header-nav ul { overflow: visible; }
}
/* ---------- Footer: two columns side by side on mobile (fix 2026-11-25) ---------- */
@media (max-width: 768px) {
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; }
}


/* ---------- Articles page: card grid like Diva blog (fix 2026-11-25) ---------- */
.page-id-25 .wp-block-post-template { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 0; padding: 0; list-style: none; }
.page-id-25 .wp-block-post { background: #fff; border: 1px solid #e7e2da; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; margin: 0; box-shadow: 0 4px 18px rgba(60, 50, 30, .05); }
.page-id-25 .wp-block-post-featured-image { order: -1; margin: 0; }
.page-id-25 .wp-block-post-featured-image img { width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; display: block; }
.page-id-25 .wp-block-post-title { font-size: 17px; line-height: 1.7; margin: 14px 16px 6px; }
.page-id-25 .wp-block-post-excerpt { margin: 0 16px 10px; }
.page-id-25 .wp-block-post-excerpt p { font-size: 13.5px; line-height: 1.9; color: #777; margin: 0; }
.page-id-25 .wp-block-post-date { font-size: 12px; color: #999; margin: auto 16px 14px; }
@media (max-width: 992px) { .page-id-25 .wp-block-post-template { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .page-id-25 .wp-block-post-template { grid-template-columns: 1fr; } }
