

/** TIGER FLIPBOX BASE STYLES */
.tg-fb-wrap {
  position: relative;
  perspective: 1000px;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
  box-sizing: border-box;
  /* For 3D/flip effect, container */
}

/* Control flipbox transition with a CSS variable for easy adjustment */
:root {
  --tg-fb-wrap-transition: all 0.8s cubic-bezier(.23,1.05,.32,1);
}

/* Core faces of the flipbox */
.tg-fb-front,
.tg-fb-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: var(--tg-fb-wrap-transition);
  backface-visibility: hidden;
  box-sizing: border-box;
  z-index: 1;
  overflow: visible;
  padding: 0;
}

.tg-fb-front {
  z-index: 2;
  transform: rotateY(0);
  display: flex;
  flex-direction: column;
  justify-content: center; /* default; overridden by .tg-fb-fv-align-* below */
}
.tg-fb-back {
  z-index: 3;
  transform: rotateY(180deg);
}

/* Front-content vertical alignment driven by the prefix_class control
   (tfb_fcontent_vertical_align). Replaces the inline justify-content style
   that used to be written from PHP into the wrapper div. */
.tg-fb-fv-align-top    .tg-fb-front { justify-content: flex-start; }
.tg-fb-fv-align-middle .tg-fb-front { justify-content: center;     }
.tg-fb-fv-align-bottom .tg-fb-front { justify-content: flex-end;   }

/* 3D Effect - RIGHT (default): Generic, then more specific for right direction to correct issues */
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-right .tg-fb-front {
  transform: rotateY(0deg);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-right .tg-fb-back {
  transform: rotateY(180deg);
}

/* This block only affects RIGHT direction (default) for hover/focus (FIXED) */
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-right:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-right:focus-within .tg-fb-front {
  transform: rotateY(-180deg);
  transition: var(--tg-fb-wrap-transition);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-right:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-right:focus-within .tg-fb-back {
  transform: rotateY(0deg);
  transition: var(--tg-fb-wrap-transition);
}

/* Remove the generic hover/focus 3d effect for ALL (so only direction specific applies) */
/*
.tg-fb-wrap.tg-fb-effect-flip-3d:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-flip-3d:focus-within .tg-fb-front {
  transform: rotateY(-180deg);
  transition: var(--tg-fb-wrap-transition);
}
.tg-fb-wrap.tg-fb-effect-flip-3d:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-flip-3d:focus-within .tg-fb-back {
  transform: rotateY(0deg);
  transition: var(--tg-fb-wrap-transition);
}
*/

/* Effect direction left flip 3d */
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-left .tg-fb-front {
  transform: rotateY(0deg);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-left .tg-fb-back {
  transform: rotateY(-180deg);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-left:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-left:focus-within .tg-fb-front {
  transform: rotateY(180deg);
  transition: var(--tg-fb-wrap-transition);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-left:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-left:focus-within .tg-fb-back {
  transform: rotateY(0deg);
  transition: var(--tg-fb-wrap-transition);
}

/* Effect direction top flip 3d */
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-top .tg-fb-front {
  transform: rotateX(0deg);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-top .tg-fb-back {
  transform: rotateX(180deg);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-top:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-top:focus-within .tg-fb-front {
  transform: rotateX(-180deg);
  transition: var(--tg-fb-wrap-transition);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-top:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-top:focus-within .tg-fb-back {
  transform: rotateX(0deg);
  transition: var(--tg-fb-wrap-transition);
}

/* Effect direction bottom flip 3d */
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-bottom .tg-fb-front {
  transform: rotateX(0deg);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-bottom .tg-fb-back {
  transform: rotateX(-180deg);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-bottom:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-bottom:focus-within .tg-fb-front {
  transform: rotateX(180deg);
  transition: var(--tg-fb-wrap-transition);
}
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-bottom:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-flip-3d.tg-fb-dir-bottom:focus-within .tg-fb-back {
  transform: rotateX(0deg);
  transition: var(--tg-fb-wrap-transition);
}

/* FADE effect */
.tg-fb-wrap.tg-fb-effect-fade .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-fade .tg-fb-back {
  transform: none !important;
  opacity: 1;
  transition: var(--tg-fb-wrap-transition);
}

.tg-fb-wrap.tg-fb-effect-fade .tg-fb-back {
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}

.tg-fb-wrap.tg-fb-effect-fade:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-fade:focus-within .tg-fb-front {
  opacity: 0;
  transition: var(--tg-fb-wrap-transition);
}

.tg-fb-wrap.tg-fb-effect-fade:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-fade:focus-within .tg-fb-back {
  opacity: 1;
  pointer-events: all;
  transition: var(--tg-fb-wrap-transition);
}

/* SLIDE effect */
.tg-fb-wrap.tg-fb-effect-slide .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-slide .tg-fb-back {
  transition: var(--tg-fb-wrap-transition);
  transform: none;
  opacity: 1;
  z-index: 1;
  pointer-events: none;
}
.tg-fb-wrap.tg-fb-effect-slide .tg-fb-front {
  z-index: 2;
  pointer-events: all;
}
.tg-fb-wrap.tg-fb-effect-slide .tg-fb-back {
  z-index: 1;
  pointer-events: none;
}

/* Make the back not visible and not focusable in normal state; visible and interactive on hover/focus */
.tg-fb-wrap.tg-fb-effect-slide .tg-fb-back {
  opacity: 0;
}

/* On hover/focus, bring backface to front, and move front out */
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-right .tg-fb-back {
  left: 100%;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-right:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-right:focus-within .tg-fb-front {
  left: -100%;
  transition: var(--tg-fb-wrap-transition);
  opacity: 0;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-right:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-right:focus-within .tg-fb-back {
  left: 0;
  opacity: 1;
  z-index: 2;
  pointer-events: all;
  transition: var(--tg-fb-wrap-transition);
}

.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-left .tg-fb-back {
  left: -100%;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-left:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-left:focus-within .tg-fb-front {
  left: 100%;
  transition: var(--tg-fb-wrap-transition);
  opacity: 0;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-left:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-left:focus-within .tg-fb-back {
  left: 0;
  opacity: 1;
  z-index: 2;
  pointer-events: all;
  transition: var(--tg-fb-wrap-transition);
}

.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-top .tg-fb-back {
  top: -100%;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-top:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-top:focus-within .tg-fb-front {
  top: 100%;
  transition: var(--tg-fb-wrap-transition);
  opacity: 0;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-top:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-top:focus-within .tg-fb-back {
  top: 0;
  opacity: 1;
  z-index: 2;
  pointer-events: all;
  transition: var(--tg-fb-wrap-transition);
}

.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-bottom .tg-fb-back {
  top: 100%;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-bottom:hover .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-bottom:focus-within .tg-fb-front {
  top: -100%;
  transition: var(--tg-fb-wrap-transition);
  opacity: 0;
}
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-bottom:hover .tg-fb-back,
.tg-fb-wrap.tg-fb-effect-slide.tg-fb-dir-bottom:focus-within .tg-fb-back {
  top: 0;
  opacity: 1;
  z-index: 2;
  pointer-events: all;
  transition: var(--tg-fb-wrap-transition);
}

/* NONE effect */
.tg-fb-wrap.tg-fb-effect-none .tg-fb-front,
.tg-fb-wrap.tg-fb-effect-none .tg-fb-back {
  transform: none !important;
  left: 0 !important;
  top: 0 !important;
  opacity: 1 !important;
}

/* Internal Structure Spacing */
.tg-fb-front,
.tg-fb-back {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 25px;
  background: #fff;
  border-radius: 12px;
  /* default values; can be overriden by Elementor controls */
  box-shadow: 0 4px 30px rgba(0,0,0,0.10);
}

/* Overlays */
.tg-fb-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  z-index: 0;
}
.tg-fb-overlay.front {
  /* set z-index below .tg-fb-front content */
  z-index: 1;
}
.tg-fb-overlay.back {
  z-index: 1;
}
.tg-fb-overlay.front::before,
.tg-fb-overlay.back::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: none;
  border-radius: inherit;
}

/* Content */
.tfb_ficon,
.tfb_bicon {
  display: block;
  text-align: center;
  margin-bottom: 24px;
  font-size: 40px;
  line-height: 1;
}

/* Allow Elementor icon styles to take over if present */
.tfb_ficon i,
.tfb_bicon i {
  color: #1976d2;
  font-size: inherit;
  transition: color 0.2s;
  display: inline-block;
}

.tfb_fheading,
.tfb_bheading {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 10px;
  margin-top: 0;
  text-align: center;
  color: #222;
}

.tfb_fsubheading,
.tfb_bsubheading {
  font-size: 1em;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
  text-align: center;
}

.tfb_fdescription,
.tfb_bdescription {
  font-size: 1em;
  color: #555;
  line-height: 1.7;
  margin-bottom: 20px;
  text-align: center;
}

/* BUTTON STYLES */
.tg-fb-btn-wrap {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}
.tg-fb-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tg-fb-btn-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.tg-fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 25px;
  background-color: #1976d2;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.24s, color 0.24s;
  /* Elementor controls will override color/bg if set */
}
.tg-fb-btn:hover,
.tg-fb-btn:focus {
  background-color: #1060ad;
  color: #fff;
  text-decoration: none;
}

/* Responsive: Allow Elementor responsive controls to function, but provide good defaults */
@media (max-width: 767px) {
  .tg-fb-front, .tg-fb-back {
    padding: 20px !important;
  }
  .tfb_fheading, .tfb_bheading {
    font-size: 1.1em;
  }
  .tfb_ficon, .tfb_bicon {
    font-size: 32px;
  }
}

/* Utility: Prevent outline when using keyboard focus for accessibility */
.tg-fb-wrap:focus {
  outline: 2px dashed #2196f3;
  outline-offset: 2px;
}
.tg-fb-wrap *:focus {
  outline: none;
}

/* Allow user-overrides via Elementor controls using more specific selectors;
   all margin, padding, alignment, typography, color, BG are controllable.
*/
.tfb_ficon, .tfb_bicon, .tfb_fdescription, .tfb_bdescription,
.tfb_fsubheading, .tfb_bsubheading, .tfb_fheading, .tfb_bheading {
  word-break: break-word;
}

.tg-fb-btn:active {
  box-shadow: 0 2px 8px rgba(30,30,30,0.10) inset;
}

.tg-fb-wrap .elementor-repeater-item:not(:last-child) {
  margin-bottom: 15px;
}