/*
Theme Name: uPress Template Shop
Theme URI: https://github.com/stech-il/upress-template-store
Author: STECH
Author URI: https://stech.il
Description: תבנית RTL לחנות טמפלטי אתרים עם WooCommerce — עמוד בית, קטלוג מוצרים ועיצוב מותאם ל-uPress Site Provisioner.
Version: 1.3.3
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: upress-template-shop
Tags: e-commerce, rtl-language-support, woocommerce, custom-menu, full-width-template
*/

:root {
  --primary: #2f8fff;
  --primary-dark: #1a6fd4;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #f0f4fa;
  --card: #fff;
  --border: #e2e8f0;
  --success: #16a34a;
  --error: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1100px, 92vw); margin: 0 auto; }

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.logo { font-size: 1.25rem; font-weight: 700; color: var(--text); text-decoration: none; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.nav a { color: var(--text); font-weight: 500; }

.hero {
  background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 45%, var(--bg) 100%);
  padding: 56px 0 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(47, 143, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -30% auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(47, 143, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-badge {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  background: rgba(47, 143, 255, 0.12);
  color: var(--primary-dark);
  border: 1px solid rgba(47, 143, 255, 0.25);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0 0 12px; }

.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 auto 24px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(47, 143, 255, 0.35); }
.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(47, 143, 255, 0.35);
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  text-decoration: none;
  border-color: #bfdbfe;
  background: #f8fbff;
  transform: translateY(-2px);
}

.section { padding: 48px 0; }
.section-muted { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 28px; }
.section-title { text-align: center; margin: 0 0 8px; font-size: 1.5rem; }
.section-lead { margin: 0; color: var(--muted); font-size: 1rem; }

.section-templates { padding-top: 40px; }

.templates-grid-wrap {
  display: flex;
  justify-content: center;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  border-color: #bfdbfe;
}

.step-card span {
  display: inline-flex;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.page-content { padding: 32px 0 48px; }

.site-footer {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* WooCommerce — כרטיסי מוצר קומפקטיים בעמוד הבית */
.templates-grid-wrap .woocommerce,
.templates-grid-wrap {
  width: 100%;
}

.templates-grid-wrap ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 260px));
  justify-content: center;
  gap: 24px;
  width: 100%;
  margin: 0 !important;
  padding: 0;
  list-style: none;
  flex-wrap: unset !important;
}

.templates-grid-wrap ul.products::before,
.templates-grid-wrap ul.products::after {
  display: none !important;
  content: none !important;
}

.templates-grid-wrap ul.products li.product {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin: 0 !important;
  width: auto !important;
  max-width: 260px;
  float: none !important;
  clear: none !important;
  flex: unset !important;
  display: flex;
  flex-direction: column;
  text-align: right;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.templates-grid-wrap ul.products li.product:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(47, 143, 255, 0.14);
  border-color: #bfdbfe;
}

.templates-grid-wrap ul.products li.product a img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.templates-grid-wrap ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem;
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.35;
}

.templates-grid-wrap ul.products li.product .price {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--primary-dark);
  font-weight: 700;
}

.templates-grid-wrap ul.products li.product .button {
  margin-top: auto;
  width: 100%;
  text-align: center;
  padding: 10px 16px !important;
  font-size: 0.95rem;
}

.templates-grid-wrap .woocommerce span.onsale,
.templates-grid-wrap span.onsale {
  background: var(--primary);
  border-radius: 999px;
  min-height: auto;
  min-width: auto;
  line-height: 1.2;
  padding: 6px 10px;
  font-size: 0.8rem;
  top: 22px;
  right: 22px;
  left: auto;
}

@media (min-width: 768px) {
  .templates-grid-wrap ul.products.columns-3 {
    grid-template-columns: repeat(3, minmax(0, 260px));
  }
}

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.woocommerce ul.products li.product {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 0 !important;
  width: 100% !important;
}

.woocommerce span.onsale { background: var(--primary); }

.woocommerce div.product .product_title { font-size: 1.75rem; }

.woocommerce .button, .woocommerce button.button {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 8px !important;
}

.woocommerce-message, .woocommerce-info {
  border-top-color: var(--primary);
}

.upress-sp-order-box {
  background: #eef5ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.upress-sp-status.pending { color: #b45309; }
.upress-sp-status.success { color: var(--success); font-weight: 600; }
.upress-sp-status.error { color: var(--error); }

#upress-sp-checkout-field {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

#upress-sp-checkout-field h3 { margin-top: 0; }

body.upress-direct-checkout .widget_shopping_cart,
body.upress-direct-checkout .wc-block-mini-cart,
body.upress-direct-checkout .wc-block-cart-link {
  display: none !important;
}

/* Checkout — עמוד תשלום RTL + מרכוז */
body.upress-checkout-rtl .page-content,
body.upress-checkout-rtl .site-main {
  padding-top: 24px;
  direction: rtl;
  text-align: right;
}

body.woocommerce-checkout .page-content {
  display: block;
}

body.woocommerce-checkout .page-content > .woocommerce {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

body.upress-checkout-rtl .woocommerce-billing-fields__field-wrapper {
  display: grid;
  gap: 8px;
  direction: rtl;
}

body.woocommerce-checkout .form-row-wide input.input-text,
body.woocommerce-checkout .form-row-wide input[type="email"],
body.woocommerce-checkout .form-row-wide input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
