/* Base Variables */
:root {
  --primary-purple: #7A1FA2;
  --primary-purple-dark: #61187F;
  --accent-light: #EEDCFF;
  --accent-mid: #D9B8F5;
  --white: #FFFFFF;
  --text-dark: #2F2F2F;
  --text-mid: #555555;
  --border: #E6E3EC;
  --radius-sm: 6px;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --transition: .3s ease;
  --container: 1200px;
}

* { box-sizing: border-box; margin:0; padding:0; }
html { 
  font-family: 'Heebo', sans-serif; 
  scroll-behavior: smooth;
  scroll-padding-top: 140px; /* increased offset for fixed header */
}
body { background:#FFFFFF; color:var(--text-dark); line-height:1.5; }

/* Ensure all sections have proper scroll offset */
section, .shop, .about, .contact, .instagram-hero { 
  scroll-margin-top: 140px;
}

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

.container { max-width:var(--container); margin:0 auto; padding:0 1.25rem; }

/* Header */
.site-header { position:sticky; top:0; background:#fff; box-shadow:0 1px 0 var(--border); z-index:50; }
.header-inner { display:grid; grid-template-columns:auto 1fr auto; column-gap:1.5rem; align-items:center; }
.logo { font-size:1.3rem; font-weight:600; letter-spacing:.5px; color:var(--primary-purple); }
.logo-img { height:94px; max-height:94px; width:auto; vertical-align:middle; margin-left:.4rem; }

.nav-wrapper { display:flex; justify-content:center; }
.main-nav { width:100%; }
.nav-list { margin:0 auto; justify-content:center; display:flex; align-items:center; line-height:1; }

.nav-toggle { display:none; background:none; border:1px solid var(--primary-purple); color:var(--primary-purple); padding:.4rem .7rem; border-radius:var(--radius-sm); font-size:1.1rem; cursor:pointer; }
.nav-list { list-style:none; display:flex; gap:2rem; }
.nav-list a { text-decoration:none; color:var(--text-dark); font-weight:500; position:relative; padding:.4rem .2rem; display:flex; align-items:center; }
.nav-list a::after { content:""; position:absolute; inset:auto 0 0 0; height:3px; background:var(--primary-purple); transform:scaleX(0); transform-origin:center; transition:var(--transition); border-radius:2px; }
.nav-list a:hover::after, .nav-list a:focus::after, .nav-list a.active::after { transform:scaleX(1); }

.header-actions { display:flex; gap:1rem; align-items:center; }

.cart-icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-purple);
  border: 2px solid var(--primary-purple);
  border-radius: 50%;
  color: #fff;
  transition: var(--transition);
  text-decoration: none;
}

.cart-icon:hover {
  background: var(--primary-purple-dark);
  border-color: var(--primary-purple-dark);
  transform: scale(1.05);
}

.cart-count {
  position: absolute;
  top: -5px;
  left: -5px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.header-social { display:flex; gap:.6rem; align-items:center; margin-inline-start:1rem; }
.header-social a { width:38px; height:38px; display:flex; align-items:center; justify-content:center; background:var(--accent-light); border:1px solid var(--accent-mid); border-radius:50%; transition:var(--transition); }
.header-social a:hover { background:var(--primary-purple); border-color:var(--primary-purple); }
.header-social img { width:24px; height:24px; display:block; }

/* Hero */
.hero, .instagram-hero { width:100%; padding:6rem 0 4rem; position:relative; }
.hero::after { display:none; }
.hero-overlay-content, .hero-text { display:contents; }
.hero.main-hero { 
  background:url('../images/back2.webp') center 15%/cover no-repeat; 
  padding: 4rem 0;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero.main-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}

.hero-content-plain { 
  max-width:var(--container); 
  margin:0 auto; 
  padding:0 1.25rem; 
  color:#fff; 
  text-align:center; 
  position: relative;
  z-index: 1;
}
.hero-inline-title { font-size:3rem; line-height:1.1; margin-bottom:1rem; text-shadow:0 4px 18px rgba(0,0,0,0.35); }
.hero-inline-sub { font-size:1.25rem; margin:0 0 2rem; color:#f5f5f5; text-shadow:0 2px 10px rgba(0,0,0,0.4); }
.hero-inline-btn { box-shadow:0 4px 18px rgba(0,0,0,0.35); }
.instagram-feed-section { background:#fff; padding:1rem 0; margin-bottom: 2rem; }
.instagram-feed-wrapper.standalone { 
  margin:0 auto; 
  min-height: 500px;
  direction: ltr;
}
behold-widget {
  width: 100%;
  display: block;
  min-height: 500px;
}
  width: 100%;
  display: block;
  min-height: 500px;
} 
  grid-gap: 1rem !important;
}
.elfsight-app-a230e2ce-ccd9-4ccb-8baf-a0e73d0e0b87 .es-widget-layout { 
  gap: 1rem !important; 
}
.elfsight-app-a230e2ce-ccd9-4ccb-8baf-a0e73d0e0b87 .eapps-instagram-feed-posts-grid {
  gap: 1rem !important;
  grid-gap: 1rem !important;
}
.elfsight-app-a230e2ce-ccd9-4ccb-8baf-a0e73d0e0b87 .eapps-instagram-feed-posts-item {
  padding: 0 !important;
}

/* Mobile Instagram - 2x2 grid */
@media (max-width: 768px) {
  .elfsight-app-a230e2ce-ccd9-4ccb-8baf-a0e73d0e0b87 .eapps-instagram-feed-posts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .elfsight-app-a230e2ce-ccd9-4ccb-8baf-a0e73d0e0b87 .es-widget-item {
    padding: 0.25rem !important;
  }
}

.btn { display:inline-block; cursor:pointer; border:none; font-family:inherit; font-size:1rem; padding:.85rem 1.6rem; border-radius:var(--radius-sm); font-weight:500; text-decoration:none; transition:var(--transition); }
.btn.primary { background:var(--primary-purple); color:#fff; box-shadow:var(--shadow); }
.btn.primary:hover { background:var(--primary-purple-dark); }
.btn.secondary { background:var(--accent-light); color:var(--primary-purple-dark); }
.btn.secondary:hover { background:var(--accent-mid); }

/* Sections */
section { padding:4.5rem 0 3.5rem; position:relative; }
.section-title { font-size:2rem; margin-bottom:1rem; letter-spacing:.5px; }
.section-subtitle { color:var(--text-mid); margin-bottom:2.5rem; }

/* Shop Category Nav + File Grid */
.shop { background:#fff; }
.shop-category-nav { margin:0 0 2rem; overflow-x:auto; }
.shop-cat-list { list-style:none; display:flex; gap:.75rem; padding:0; margin:0; justify-content:center; flex-wrap:wrap; }
.shop-cat-btn { background:var(--accent-light); color:var(--primary-purple-dark); border:1px solid var(--accent-mid); padding:.65rem 1.2rem; border-radius:50px; font:inherit; cursor:pointer; transition:var(--transition); font-weight:500; }
.shop-cat-btn:hover { background:var(--accent-mid); }
.shop-cat-btn.active { background:var(--primary-purple); color:#fff; border-color:var(--primary-purple); }
.product-panels { position:relative; }
.product-panel { animation:fadeIn .4s ease; }
.product-panel.hidden { display:none; }
.purchase-action { margin-top:1.2rem; display:flex; justify-content:center; }
@keyframes fadeIn { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }

/* Shop file grid: fixed 3 columns on desktop */
.file-grid { display:grid; gap:1.4rem; grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:1.5rem; }
/* Tablet: 2 columns */
@media (max-width:900px) {
  .file-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* Mobile: single column */
@media (max-width:700px) {
  .file-grid { grid-template-columns:1fr; }
}
.file-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:.9rem .9rem 1.2rem; display:flex; flex-direction:column; align-items:center; text-align:center; box-shadow:var(--shadow); transition:box-shadow .3s ease; position:relative; }
.file-card:hover { box-shadow:0 4px 16px rgba(122,31,162,0.12); }

/* Free Gift Badge */
.free-gift-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: white;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(238, 90, 111, 0.3);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: help;
  transition: transform 0.2s ease;
}

.free-gift-badge:hover {
  transform: scale(1.05);
}

/* Tooltip for gift badge */
.free-gift-badge::after {
  content: "הוסיפו לסל וקבלו קובץ זה ללא עלות - מתנה ממני!";
  position: absolute;
  top: 120%;
  right: 50%;
  transform: translateX(50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.free-gift-badge:hover::after {
  opacity: 1;
  visibility: visible;
}

.free-gift-badge::before {
  content: "🎁";
  font-size: 1.8rem;
  display: inline-block;
  animation: wiggle 2s ease-in-out infinite;
}

.file-card > a:first-of-type {
  position: relative;
}

.price-strike {
  text-decoration: line-through;
  color: #999;
  font-size: 0.9em;
  margin-left: 0.5rem;
}

.free-price {
  color: #27ae60;
  font-weight: 700;
}

.file-card.in-cart { border: 3px solid #27ae60; background: #f0fff4; }
.file-card.in-cart::after {
  content: '✓ בסל';
  position: absolute;
  top: 10px;
  left: 10px;
  background: #27ae60;
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.file-card > a:first-of-type { text-decoration:none; color:inherit; flex-grow:1; display:flex; flex-direction:column; align-items:center; width:100%; }
.file-card img { width:100%; aspect-ratio:1/1; height:auto; object-fit:cover; border-radius:var(--radius-sm); margin-bottom:.6rem; background:#fff; border:1px solid var(--accent-light); transition:none; transform:none; }

.product-image-container {
  position: relative;
  width: 100%;
}

.product-image-container img,
.product-image-container video {
  transition: opacity 0.2s ease-in-out;
}

.product-image-container .fade-out {
  opacity: 0;
}

.product-image-container .fade-in {
  opacity: 1;
}

.preview-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  pointer-events: none;
  z-index: 1;
}

.preview-icon svg {
  width: 18px;
  height: 18px;
  color: #7A1FA2;
}

.file-card h4 { font-size:.95rem; margin:.4rem 0 .5rem; color:var(--primary-purple-dark); line-height:1.3; }
.file-card .file-desc { font-size:.95rem; color:var(--text-mid); line-height:1.6; margin:0 0 .8rem; min-height:3.2rem; display:flex; align-items:center; justify-content:center; }
.file-card .btn { width:100%; padding:.6rem 0; margin-top:.5rem; }

/* (Carousel styles removed – using grid cards now) */

/* About */
.about { background:linear-gradient(135deg, #FFFFFF, var(--accent-light)); padding:3rem 0; }
.about-layout { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:2.5rem; align-items:center; }
.about-image-wrapper { max-width:380px; }
.about-image { width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:24px; box-shadow:0 10px 28px rgba(0,0,0,0.08); border:4px solid var(--accent-light); }
.about-text-block .section-title { margin-bottom:1.5rem; }
.about-text-block p { margin-bottom:1rem; }
.about-text { max-width:820px; font-size:1.05rem; color:var(--text-mid); }

/* Contact */
.contact { background:var(--accent-light); }
.contact-form { max-width:520px; display:grid; gap:1.1rem; }
.form-row { display:flex; flex-direction:column; gap:.4rem; }
.form-row input, .form-row textarea { padding:.75rem .9rem; border:1px solid var(--border); border-radius:var(--radius-sm); font-family:inherit; font-size:1rem; background:#fff; }
.form-row input:focus, .form-row textarea:focus { outline:2px solid var(--accent-mid); }

/* FAQ */
.faq-list { max-width:820px; display:grid; gap:.9rem; }
.faq-list details { border:1px solid var(--border); padding:.9rem 1rem; border-radius:var(--radius-sm); background:#fff; }
.faq-list summary { cursor:pointer; font-weight:500; color:var(--primary-purple-dark); }
.faq-list summary::marker { color:var(--primary-purple); }
.faq-list p { margin-top:.6rem; color:var(--text-mid); line-height:1.45; }

/* Footer */
.site-footer { background:#FFFFFF; color:var(--text-dark); padding:2.2rem 0; box-shadow:0 -1px 0 var(--border); }
.footer-inner { display:flex; flex-direction:column; align-items:center; gap:1rem; }
.footer-inner.row-layout { flex-direction:row; justify-content:space-between; align-items:center; gap:2rem; }
.footer-col { display:flex; align-items:center; }
.footer-center { justify-content:center; flex:1; }
.footer-right { justify-content:flex-start; }
.footer-left { justify-content:flex-end; }
.site-footer .social-links { display:flex; flex-direction:row; flex-wrap:wrap; justify-content:center; align-items:center; gap:1rem; }
.site-footer .social-icon { width:72px; height:72px; }
.site-footer .social-icon img { width:40px; height:40px; }
.site-footer .social-links { margin-top:.4rem; text-align:center; }

/* Removed old hero overlay styles */

/* Developer Notes: Header uses grid for perfect centering: [logo][nav-flex][social]. */
/* ======================================= */

@media (max-width: 900px) {
  .carousel-btn.prev { right:10px; margin:0; }
  .carousel-btn.next { left:10px; margin:0; }
  .carousel-btn { top:auto; bottom:8px; transform:none; background:var(--primary-purple); color:#fff; opacity:.9; }
}

/* Product Detail Page */
.add-to-cart-btn.in-cart {
  background: #27ae60 !important;
}

.add-to-cart-btn.in-cart:hover {
  background: #229954 !important;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-logo {
  width: 120px;
  margin-bottom: 1.5rem;
}

.modal-content h2 {
  color: var(--primary-purple);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.modal-content p {
  color: var(--text-mid);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.modal-close-btn {
  background: var(--primary-purple);
  color: #fff;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--primary-purple-dark);
}

/* =============================
  הערות למפתחת/מפתח עתידי:
  1. הוספת קטגוריה בחנות:
    - שכפל בלוק div.product-category.
    - עדכן את הטקסט בכותרת h3 ואת התיאור.
    - שנה את data-cat לערך ייחודי (למשל data-cat="science").
    - הקרוסלה: שמור על מבנה .carousel > .carousel-track > .slide... ודאג שלשקופית אחת תהיה עם class="slide active".
    - הכפתור לרכישה מפנה ל purchase.html?cat=<value> – ניתן להרחיב מיפוי בדף הרכישה.
  2. החלק העליון (Hero):
    - רקע התמונה מוגדר ב .hero.main-hero (כרגע: images/back2.webp). להחלפה: החלף את הקובץ או כתוב background:url('../images/NEW.webp').
    - האוברליי (שכבת לבן שקוף) נשלט על ידי ::before והאטימות background:rgba(255,255,255,0.35). ניתן לשנות שקיפות.
    - הקופסה הפנימית .hero-text משתמשת ב background:rgba(255,255,255,0.85). אפשר להעלות/להוריד לצמצום ערפל.
  3. קרוסלה:
    - כרגע כל השקופיות האחרות display:none ורק .active מוצגת. ההחלפה מתבצעת ב js/carousel.js.
    - להוספת שקופיות: הוסף div.slide עם <img>. אין צורך לעדכן את ה-JS.
  4. פוקוס על קטגוריה:
    - הקוד ב js/main.js מאזין ללחיצה על .product-category ומסתיר אחרות. כפתור #backToAll מחזיר תצוגה מלאה.
    - אם לא רוצים פוקוס, ניתן להסיר את מאזיני הלחיצה או למחוק את הקוד בתוך ה-IIFE של product search.
  5. חיפוש:
    - בזמן פוקוס על קטגוריה החיפוש מושבת (מתעלם מקלט) כדי לא לבלבל את המשתמש.
  ============================= */
