/*
 Theme Name:   Astra Child — Twisha Infotech
 Theme URI:    https://twishainfotech.co.uk
 Description:  Astra child theme for Twisha Infotech UK with SEO, GEO and visual enhancements.
 Author:       Twisha Infotech UK
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-child
*/

/* ============================================================
   IMPORT PARENT THEME
   ============================================================ */
@import url('../astra/style.css');

/* ============================================================
   GOOGLE FONTS — Distinctive, professional pairing
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (keeps your existing colors intact)
   ============================================================ */
:root {
  --ti-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ti-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --ti-shadow-md: 0 8px 24px rgba(0,0,0,0.1);
  --ti-shadow-lg: 0 16px 48px rgba(0,0,0,0.14);
  --ti-radius: 12px;
  --ti-radius-lg: 20px;
}

/* ============================================================
   SCROLL REVEAL — elements fade+slide in on scroll
   ============================================================ */
.ti-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.ti-reveal.ti-visible {
  opacity: 1;
  transform: translateY(0);
}
.ti-reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.ti-reveal-left.ti-visible {
  opacity: 1;
  transform: translateX(0);
}
.ti-reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.ti-reveal-right.ti-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered children */
.ti-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.ti-stagger > *:nth-child(2) { transition-delay: 0.12s; }
.ti-stagger > *:nth-child(3) { transition-delay: 0.19s; }
.ti-stagger > *:nth-child(4) { transition-delay: 0.26s; }
.ti-stagger > *:nth-child(5) { transition-delay: 0.33s; }
.ti-stagger > *:nth-child(6) { transition-delay: 0.40s; }

/* ============================================================
   PAGE LOAD PROGRESS BAR
   ============================================================ */
#ti-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--ast-global-color-0, #007bff);
  z-index: 99999;
  transition: width 0.3s ease;
  border-radius: 0 3px 3px 0;
}

/* ============================================================
   SMOOTH SCROLL
   ============================================================ */
html {
  scroll-behavior: smooth;
}

/* ============================================================
   GLOBAL TYPOGRAPHY UPGRADES
   ============================================================ */
body {
  font-family: 'Outfit', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.ast-page-title-wrap .entry-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ============================================================
   HEADER — Scroll shadow effect
   ============================================================ */
.site-header,
#masthead {
  transition: box-shadow var(--ti-transition), background var(--ti-transition);
}
.ti-header-scrolled .site-header,
.ti-header-scrolled #masthead {
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

/* ============================================================
   NAVIGATION — Smooth hover underline
   ============================================================ */
.main-navigation .menu > li > a,
.main-header-menu > li > a {
  position: relative;
  transition: color var(--ti-transition);
}
.main-navigation .menu > li > a::after,
.main-header-menu > li > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width var(--ti-transition);
  border-radius: 2px;
}
.main-navigation .menu > li > a:hover::after,
.main-header-menu > li > a:hover::after,
.main-navigation .menu > li.current-menu-item > a::after,
.main-header-menu > li.current-menu-item > a::after {
  width: 100%;
}

/* ============================================================
   BUTTONS — Lift + pulse effect
   ============================================================ */
.ast-btn,
.button,
.wp-block-button__link,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #payment #place_order {
  position: relative;
  overflow: hidden;
  transition: transform var(--ti-transition), box-shadow var(--ti-transition) !important;
  border-radius: var(--ti-radius) !important;
}
.ast-btn:hover,
.button:hover,
.wp-block-button__link:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--ti-shadow-md) !important;
}
.ast-btn:active,
.button:active {
  transform: translateY(0);
}

/* Ripple effect on buttons */
.ast-btn::before,
.button::before,
.wp-block-button__link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
  pointer-events: none;
}
.ast-btn:active::before,
.button:active::before {
  width: 300px;
  height: 300px;
  opacity: 1;
  transition: 0s;
}

/* ============================================================
   CARDS — Lift on hover (WooCommerce products + post cards)
   ============================================================ */
.woocommerce ul.products li.product,
.ast-article-post,
.ast-row .ast-col,
.elementor-widget-wrap,
.wp-block-group {
  transition: transform var(--ti-transition), box-shadow var(--ti-transition);
}

.woocommerce ul.products li.product {
  border-radius: var(--ti-radius) !important;
  overflow: hidden;
  box-shadow: var(--ti-shadow-sm);
  transition: transform var(--ti-transition), box-shadow var(--ti-transition);
}
.woocommerce ul.products li.product:hover {
  transform: translateY(-6px);
  box-shadow: var(--ti-shadow-lg) !important;
}

/* Product image zoom */
.woocommerce ul.products li.product img {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.woocommerce ul.products li.product:hover img {
  transform: scale(1.04);
}

/* ============================================================
   SINGLE PRODUCT PAGE
   ============================================================ */
.woocommerce div.product .woocommerce-product-gallery__image img {
  border-radius: var(--ti-radius);
  transition: transform 0.5s ease;
}
.woocommerce div.product .woocommerce-product-gallery:hover .woocommerce-product-gallery__image img {
  transform: scale(1.02);
}

/* Price highlight */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  font-weight: 700;
  font-size: 1.6em !important;
}

/* ============================================================
   TRUST BADGES — Floating animation
   ============================================================ */
.ti-trust-badge {
  animation: ti-float 3s ease-in-out infinite;
}
.ti-trust-badge:nth-child(2) { animation-delay: 0.5s; }
.ti-trust-badge:nth-child(3) { animation-delay: 1s; }

@keyframes ti-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================================
   STATS COUNTER SECTION
   ============================================================ */
.ti-stat-number {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
#ti-back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ast-global-color-0, #007bff);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--ti-transition), transform var(--ti-transition), box-shadow var(--ti-transition);
  z-index: 9999;
  box-shadow: var(--ti-shadow-md);
  font-size: 18px;
  line-height: 1;
}
#ti-back-to-top.ti-visible {
  opacity: 1;
  transform: translateY(0);
}
#ti-back-to-top:hover {
  box-shadow: var(--ti-shadow-lg);
  transform: translateY(-3px);
}

/* ============================================================
   IMAGES — Lazy-load fade in
   ============================================================ */
img.ti-lazy {
  opacity: 0;
  transition: opacity 0.5s ease;
}
img.ti-lazy.ti-loaded {
  opacity: 1;
}

/* ============================================================
   TESTIMONIALS / REVIEW CARDS
   ============================================================ */
.ti-review-card {
  background: #fff;
  border-radius: var(--ti-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--ti-shadow-sm);
  border: 1px solid rgba(0,0,0,0.06);
  transition: box-shadow var(--ti-transition), transform var(--ti-transition);
}
.ti-review-card:hover {
  box-shadow: var(--ti-shadow-md);
  transform: translateY(-4px);
}
.ti-review-stars {
  color: #f59e0b;
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}
.ti-review-text {
  font-style: italic;
  color: #555;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.ti-review-author {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ============================================================
   FAQ SECTION — Smooth accordion
   ============================================================ */
.ti-faq-item {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--ti-radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow var(--ti-transition);
}
.ti-faq-item:hover {
  box-shadow: var(--ti-shadow-sm);
}
.ti-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.ti-faq-question::after {
  content: '+';
  font-size: 1.4rem;
  line-height: 1;
  transition: transform var(--ti-transition);
  flex-shrink: 0;
}
.ti-faq-item.ti-open .ti-faq-question::after {
  transform: rotate(45deg);
}
.ti-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.3s ease;
  padding: 0 1.25rem;
  line-height: 1.7;
  color: #555;
}
.ti-faq-item.ti-open .ti-faq-answer {
  max-height: 400px;
  padding: 0.5rem 1.25rem 1rem;
}

/* ============================================================
   NOTIFICATION / URGENCY BAR (top of page)
   ============================================================ */
#ti-top-bar {
  width: 100%;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  position: relative;
  z-index: 10000;
  letter-spacing: 0.01em;
}
#ti-top-bar a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
#ti-top-bar-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  padding: 4px;
  line-height: 1;
}
#ti-top-bar-close:hover { opacity: 1; }

/* ============================================================
   ANIMATED HERO HEADLINE
   ============================================================ */
.ti-typewriter {
  border-right: 2px solid currentColor;
  animation: ti-blink 0.7s step-end infinite;
  padding-right: 2px;
}
@keyframes ti-blink {
  0%, 100% { border-color: currentColor; }
  50% { border-color: transparent; }
}

/* ============================================================
   STICKY CONTACT BAR (mobile)
   ============================================================ */
#ti-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  padding: 10px 16px;
  gap: 10px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  justify-content: center;
  align-items: center;
}
@media (max-width: 768px) {
  #ti-sticky-cta {
    display: flex;
  }
  #ti-sticky-cta a {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--ti-radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform var(--ti-transition);
  }
  #ti-sticky-cta a:active { transform: scale(0.97); }
  body { padding-bottom: 70px; }
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.ast-breadcrumbs-wrapper {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ============================================================
   WOOCOMMERCE CART + CHECKOUT IMPROVEMENTS
   ============================================================ */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper select,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper textarea {
  border-radius: var(--ti-radius) !important;
  transition: border-color var(--ti-transition), box-shadow var(--ti-transition);
}
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input:focus {
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15) !important;
  outline: none;
}

/* ============================================================
   SECTION SEPARATORS — subtle wave dividers
   ============================================================ */
.ti-wave-sep {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin: 0;
}
.ti-wave-sep svg {
  display: block;
  width: 100%;
}

/* ============================================================
   FOOTER ENHANCEMENTS
   ============================================================ */
.site-footer a {
  transition: opacity var(--ti-transition);
}
.site-footer a:hover {
  opacity: 0.75;
}

/* ============================================================
   RESPONSIVE MEDIA
   ============================================================ */
@media (max-width: 992px) {
  .ti-stat-number { font-size: 2.2rem; }
}
@media (max-width: 600px) {
  .ti-stat-number { font-size: 1.8rem; }
  #ti-back-to-top { bottom: 80px; }
}

/* ============================================================
   ACCESSIBILITY — focus-visible rings
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ast-global-color-0, #007bff);
  outline-offset: 3px;
  border-radius: 3px;
}
