/* ====================================================
   Safe House VS — extra.css
   RTL fixes, mini-cart, animations, feature icons
   ==================================================== */

/* ── GLOBAL RTL / TEXT-ALIGN FIX ────────────────── */
body,
body h1, body h2, body h3, body h4, body h5, body h6,
body p, body li, body a, body span, body label,
body .entry-content, body .entry-summary,
body .woocommerce-product-details__short-description,
body .product_meta,
body .woocommerce-loop-product__title,
body .woocommerce-breadcrumb,
body .woocommerce-pagination,
body .woocommerce-ordering {
  text-align: right;
  direction: rtl;
}

/* Specific containers that need direction */
.sh-hero__content,
.sh-hero__stats,
.sh-feature-card__body,
.sh-cat-card__body,
.sh-app__text,
.sh-footer__brand,
.sh-footer__col,
.sh-footer__links,
.sh-footer__contact-list,
.sh-page-header,
.sh-breadcrumb,
.wc-main,
.sh-products__header,
.entry-content,
.entry-summary {
  direction: rtl;
  text-align: right;
}

/* Section headers — centered */
.section-header { text-align: center; }
.section-title  { text-align: center; }

/* Hero RIGHT side text */
.sh-hero__title,
.sh-hero__subtitle,
.sh-hero__badge { text-align: right; }
.sh-hero__btns  { justify-content: flex-end; }
.sh-hero__stats { justify-content: flex-end; }

/* ── HERO: image LEFT, text RIGHT ────────────────── */
.sh-hero {
  grid-template-columns: 45% 55%;
  direction: ltr;
}
.sh-hero__visual  { direction: ltr; }
.sh-hero__content { direction: rtl; }

/* ── APP SECTION: image LEFT, text RIGHT ─────────── */
.sh-app__grid {
  grid-template-columns: 45% 55%;
  direction: ltr;
  gap: 4rem;
  align-items: center;
}
.sh-app__mockup { order: 1; }
.sh-app__text   { order: 2; direction: rtl; text-align: right; }
.sh-app__title  { text-align: right; }

/* Features list: text RIGHT, V circle flush right */
.sh-app__features        { direction: ltr; padding: 0; margin: 0 0 1.5rem; }
.sh-app__features li     {
  display: flex;
  align-items: center;
  gap: .75rem;
  direction: ltr;
  justify-content: flex-end;
  color: #9AB4CC;
  font-size: .9375rem;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sh-app__features li:last-child { border-bottom: none; }
.sh-app__features li::after {
  content: '';
  width: 22px; height: 22px; min-width: 22px;
  background: var(--blue);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3 4 7-8' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 60%; background-position: center; background-repeat: no-repeat;
  flex-shrink: 0;
}
.sh-app__download-title  { text-align: right; margin-bottom: .75rem; }
.sh-app__btns {
  display: flex;
  direction: ltr;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .875rem;
}

/* ── FEATURE CARDS: icon centered at image/text border ── */
.sh-features-grid { direction: rtl; }
.sh-feature-card  {
  position: relative;
  padding-top: 0;
}
.sh-feature-card__img-wrap {
  position: relative;
  overflow: visible; /* allow icon to overflow */
}
.sh-feature-card__img-wrap .sh-feature-card__img {
  width: 100%; height: 190px; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: transform .45s ease;
  display: block;
}
.sh-feature-card:hover .sh-feature-card__img { transform: scale(1.04); }

/* Icon badge — sits right at the border (50% on image, 50% on body) */
.sh-feature-card__icon-badge {
  position: absolute;
  bottom: -24px;       /* half outside the image bottom */
  left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 4px 20px rgba(0,0,0,.16), 0 0 0 4px var(--blue-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  z-index: 3;
  transition: transform var(--transition), box-shadow var(--transition);
}
.sh-feature-card:hover .sh-feature-card__icon-badge {
  transform: translateX(-50%) scale(1.12);
  box-shadow: 0 6px 24px rgba(0,102,255,.25), 0 0 0 4px var(--blue-pale);
}

/* Icon fallback (no image) */
.sh-feature-card__icon-only {
  background: linear-gradient(135deg, var(--blue-pale) 0%, #D0E4FF 100%);
  height: 150px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 4rem;
}

/* Body: extra top padding to clear the floating icon */
.sh-feature-card__body {
  direction: rtl; text-align: right;
  padding: 2.5rem 1.375rem 1.375rem;
}
.sh-feature-card__title { text-align: right; }
.sh-feature-card__desc  { text-align: right; }

/* ── MINI CART ────────────────────────────────────── */
.sh-mini-cart { position: relative; }
.sh-mini-cart__toggle {
  position: relative; display: flex; align-items: center; gap: .375rem;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem .75rem;
  color: var(--text); cursor: pointer; transition: all var(--transition);
}
.sh-mini-cart__toggle:hover { border-color: var(--blue); color: var(--blue); }
.sh-cart-count {
  position: absolute; top: -8px; inset-inline-start: -8px;
  background: var(--blue); color: var(--white);
  font-size: .65rem; font-weight: 700; width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
}
.sh-cart-count:not(.has-items) { display: none; }
.sh-mini-cart__dropdown {
  position: absolute; top: calc(100% + 12px); inset-inline-end: 0;
  width: 340px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 500;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all .22s cubic-bezier(.4,0,.2,1); direction: rtl;
}
.sh-mini-cart.open .sh-mini-cart__dropdown { opacity:1; visibility:visible; transform:none; }
.sh-mini-cart__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.sh-mini-cart__header h4 { font-size: .9375rem; font-weight: 700; color: var(--text); }
.sh-mini-cart__count { font-size: .8125rem; color: var(--muted); }
.sh-mini-cart__body { padding: .75rem; }
.sh-mini-cart__empty { text-align: center; padding: 2rem 1rem; }
.sh-mini-cart__empty span { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.sh-mini-cart__empty p { color: var(--muted); margin-bottom: 1rem; }
.sh-mini-cart__items { display: flex; flex-direction: column; gap: .5rem; max-height: 280px; overflow-y: auto; }
.sh-mini-cart__item { display: flex; align-items: center; gap: .75rem; padding: .625rem; border-radius: var(--radius); transition: background var(--transition); }
.sh-mini-cart__item:hover { background: var(--light); }
.sh-mini-cart__item-img img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.sh-mini-cart__item-info { flex: 1; min-width: 0; }
.sh-mini-cart__item-name { display: block; font-size: .875rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .25rem; transition: color var(--transition); }
.sh-mini-cart__item-name:hover { color: var(--blue); }
.sh-mini-cart__item-qty-price { display: flex; align-items: center; gap: .375rem; }
.sh-mini-cart__item-qty   { font-size: .8rem; color: var(--muted); }
.sh-mini-cart__item-price { font-size: .9375rem; font-weight: 700; color: var(--blue); }
.sh-mini-cart__remove { color: var(--muted); font-size: 1.25rem; flex-shrink: 0; padding: .25rem; border-radius: 50%; transition: all var(--transition); display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.sh-mini-cart__remove:hover { background: #FFE0E0; color: #CC0000; }
.sh-mini-cart__total { display: flex; align-items: center; justify-content: space-between; padding: .875rem .625rem; border-top: 1px solid var(--border); margin-top: .5rem; }
.sh-mini-cart__total strong { color: var(--blue); font-size: 1.125rem; }
.sh-mini-cart__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .625rem; }
.sh-mini-cart__actions .btn { justify-content: center; }

/* ── FOOTER FORM ADDITIONS ───────────────────────── */
.sh-footer__sent {
  background: rgba(46,125,50,.15);
  color: #4CAF50;
  border: 1px solid #4CAF50;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: right;
  font-weight: 600;
}
.sh-footer__error {
  color: #EF5350;
  font-size: .875rem;
  text-align: right;
  margin-bottom: .5rem;
}

/* ── ADD TO CART FLY ANIMATION ────────────────────── */
@keyframes flyToCart {
  0%   { transform: scale(1); opacity: 1; }
  20%  { transform: scale(1.15) rotate(-3deg); opacity: 1; }
  100% { transform: translate(var(--fly-x), var(--fly-y)) scale(.1); opacity: 0; }
}
@keyframes cartBounce {
  0%  { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-8deg); }
  65% { transform: scale(.9) rotate(4deg); }
  80% { transform: scale(1.1); }
  100%{ transform: scale(1); }
}
@keyframes addedPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,102,255,.5); }
  70%  { box-shadow: 0 0 0 12px rgba(0,102,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,102,255,0); }
}

/* Flying product ghost */
.sh-fly-ghost {
  position: fixed;
  width: 80px; height: 80px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: 9998;
  animation: flyToCart .7s cubic-bezier(.25,.46,.45,.94) forwards;
}

/* Cart bounce feedback */
.sh-mini-cart__toggle.sh-bounce { animation: cartBounce .5s ease; }

/* "Added" button feedback */
.single_add_to_cart_button.sh-added,
.add_to_cart_button.sh-added {
  animation: addedPulse .5s ease;
  background: #1a7340 !important;
}
.single_add_to_cart_button.sh-added::after,
.add_to_cart_button.sh-added::after { content: ' ✓'; }

/* ── WC PRODUCT PAGE ──────────────────────────────── */
.sh-product-wrap { padding-block: 2rem; }
.sh-product-wrap .woocommerce div.product { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; direction: ltr; }
.sh-product-wrap .woocommerce div.product .entry-summary { direction: rtl; text-align: right; }
.sh-product-wrap .woocommerce div.product .product_title { font-size: 2rem; font-weight: 900; margin-bottom: .75rem; }
.sh-product-wrap .woocommerce div.product p.price { font-size: 2rem !important; font-weight: 900 !important; color: var(--blue) !important; }
.sh-product-wrap .woocommerce div.product .woocommerce-product-details__short-description { color: var(--muted); line-height: 1.8; margin-bottom: 1.5rem; text-align: right; }
.sh-product-wrap .woocommerce div.product .product_meta { margin-top: 1.5rem; font-size: .875rem; color: var(--muted); text-align: right; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.sh-product-wrap .woocommerce div.product .product_meta span { color: var(--text); font-weight: 600; }
.sh-product-wrap .woocommerce div.product .woocommerce-product-gallery { border-radius: var(--radius); overflow: hidden; }
.sh-product-wrap .woocommerce div.product .woocommerce-tabs { margin-top: 3rem; direction: rtl; grid-column: 1 / -1; }
.sh-product-wrap .woocommerce div.product .woocommerce-tabs ul.tabs { display: flex; border-bottom: 2px solid var(--border); padding: 0; margin: 0; }
.sh-product-wrap .woocommerce div.product .woocommerce-tabs ul.tabs li { margin: 0; }
.sh-product-wrap .woocommerce div.product .woocommerce-tabs ul.tabs li a { display: block; padding: .75rem 1.5rem; font-family: var(--font); font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); }
.sh-product-wrap .woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.sh-product-wrap .woocommerce div.product .woocommerce-tabs ul.tabs li a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.sh-product-wrap .woocommerce div.product .woocommerce-tabs .panel { padding: 1.5rem 0; border: none; }
.related.products { display: none; }

/* WC archive */
.wc-main { padding-block: 2.5rem; }
.woocommerce-products-header { text-align: right; margin-bottom: 1.5rem; }
.woocommerce-ordering { direction: rtl; }
.woocommerce-ordering select { font-family: var(--font); padding: .5rem .875rem; border-radius: 8px; border: 1px solid var(--border); }

/* WC notices */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  direction: rtl; text-align: right; font-family: var(--font);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}

/* ── PAGE HEADER ─────────────────────────────────── */
.sh-page-header { text-align: right; direction: rtl; }
.sh-page-header h1 { text-align: right; }
.sh-page-header__desc { text-align: right; color: var(--muted); margin-top: .5rem; }

/* ── FOOTER ──────────────────────────────────────── */
.sh-footer__main { direction: rtl; }
.sh-footer__col  { direction: rtl; text-align: right; }
.sh-footer__links a { text-align: right; }
.sh-footer__contact-list { text-align: right; }
.sh-footer__bottom-inner { direction: rtl; }
.sh-footer__copy { text-align: right; }

/* ── QUANTITY STEPPER ────────────────────────────── */
.sh-qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 52px; /* Match add-to-cart button height */
  transition: border-color var(--transition);
}
.sh-qty-stepper:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,102,255,.15);
}
.sh-qty-btn {
  width: 48px;
  min-width: 48px;
  background: var(--light);
  color: var(--text);
  font-size: 1.375rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  user-select: none;
  font-family: var(--font);
}
.sh-qty-btn:hover { background: var(--blue); color: var(--white); }
.sh-qty-btn:active { transform: scale(.92); }
.sh-qty-input {
  width: 64px !important;
  min-width: 0 !important;
  border: none !important;
  border-inline: 1px solid var(--border) !important;
  border-radius: 0 !important;
  text-align: center !important;
  font-family: var(--font) !important;
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  padding: 0 !important;
  background: var(--white) !important;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield !important;
  height: 100% !important;
}
.sh-qty-input::-webkit-outer-spin-button,
.sh-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Disabled state */
.sh-qty-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Product cart row — stepper + button side by side */
.woocommerce div.product form.cart {
  display: flex !important;
  align-items: stretch !important;
  gap: .875rem !important;
  flex-direction: row-reverse !important; /* button right (RTL), qty left */
  margin-bottom: 1.5rem !important;
}
.woocommerce div.product form.cart .single_add_to_cart_button {
  flex: 1 !important;
  height: 52px !important;
  padding: 0 2rem !important;
  font-size: 1.0625rem !important;
  white-space: nowrap !important;
}
.sh-qty-stepper { flex-shrink: 0; }

/* ── TRUST BADGES ────────────────────────────────── */
.sh-trust-badges {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: .75rem;
  direction: rtl;
}
.sh-trust-badge {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .9375rem;
  color: var(--text);
  direction: rtl;
}
.sh-trust-badge__check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  background: #E8F5E9;
  color: #2E7D32;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}
.sh-trust-badge__icon { font-size: 1.125rem; }
.sh-trust-badge__text { font-weight: 500; color: var(--text); }

/* ── MOBILE ──────────────────────────────────────── */
@media (max-width: 767px) {
  .sh-mini-cart__dropdown { width: 290px; }
  .sh-mini-cart__actions  { grid-template-columns: 1fr; }
  .sh-app__grid { grid-template-columns: 1fr; direction: rtl; }
  .sh-app__title,.sh-app__download-title { text-align: right; }
  .sh-app__btns  { justify-content: flex-end; flex-wrap: wrap; }
  .sh-app__features li { justify-content: flex-end; }
  .sh-product-wrap .woocommerce div.product { grid-template-columns: 1fr; }
  .sh-feature-card__icon-badge { width: 44px; height: 44px; font-size: 1.25rem; bottom: -22px; }
}
