/* ====================================================================
   112 Italy — Flip Card Product Loop
   Desktop : CSS :hover flips the card (no JS needed)
   Mobile  : JS adds .is-flipped on image tap; name tap navigates
   ==================================================================== */

/* --- Outer <li> wrapper --- */
.woocommerce ul.products li.product.flip-product-item {
  perspective: 1100px;
  overflow: visible !important; /* let the card pop out */
  background: transparent !important;
}

/* --- The rotating container --- */
.flip-product-item .flip-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.72s cubic-bezier(0.4, 0.2, 0.2, 1);
  will-change: transform;
  border-radius: 2px;
}

/* Hover flip — only on pointer devices that support hover ------- */
@media (hover: hover) and (pointer: fine) {
  .flip-product-item:hover .flip-card {
    transform: rotateY(180deg);
  }
}

/* JS-driven flip (mobile tap on image) -------------------------- */
.flip-product-item.is-flipped .flip-card {
  transform: rotateY(180deg);
}

/* --- Shared face rules ----------------------------------------- */
.flip-card-front,
.flip-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ====================================================================
   FRONT FACE
   ==================================================================== */
.flip-card-front {
  /* stays in normal document flow — gives the .flip-card its height */
  background: #0a0a0a;
}

.flip-card-front .flip-image-link {
  display: block;
  overflow: hidden;
  line-height: 0;
  border-radius: 2px 2px 0 0;
}

.flip-card-front .flip-image-link img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.45s ease;
}

@media (hover: hover) and (pointer: fine) {
  .flip-product-item:hover .flip-card-front .flip-image-link img {
    transform: scale(1.04);
  }
}

/* Footer bar below the image */
.flip-front-meta {
  padding: 13px 15px 16px;
  background: #0a0a0a;
  border-radius: 0 0 2px 2px;
}

.flip-front-meta .flip-name-link {
  text-decoration: none;
  display: block;
}

.flip-front-meta .flip-name-link:hover .woocommerce-loop-product__title {
  color: #BD9C2F;
}

.flip-front-meta .woocommerce-loop-product__title {
  font-size: 0.78rem;
  font-weight: 500;
  color: #ffffff;
  margin: 0 0 5px;
  letter-spacing: 0.045em;
  line-height: 1.38;
  transition: color 0.2s;
}

/* Regular price */
.flip-front-meta .flip-price ins .woocommerce-Price-amount,
.flip-front-meta .flip-price ins bdi {
  color: #BD9C2F;
  font-size: 0.88rem;
  font-weight: 700;
  font-style: normal;
  text-decoration: none;
}

/* Old/crossed-out price — line on bdi for pixel-perfect centre */
.flip-front-meta .flip-price del {
  text-decoration: none;
}
.flip-front-meta .flip-price del .woocommerce-Price-amount,
.flip-front-meta .flip-price del bdi {
  color: #e03e3e;
  font-size: 0.75rem;
  font-weight: 400;
}
.flip-front-meta .flip-price del bdi {
  position: relative;
  display: inline-block;
}
.flip-front-meta .flip-price del bdi::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.5px;
  background: #e03e3e;
  pointer-events: none;
}

/* No sale: plain price */
.flip-front-meta .flip-price > .woocommerce-Price-amount,
.flip-front-meta .flip-price > bdi {
  color: #BD9C2F;
  font-size: 0.82rem;
}

/* ====================================================================
   BACK FACE — memory text + country map watermark
   ==================================================================== */
.flip-card-back {
  position: absolute;
  inset: 0;                       /* matches front face exactly */
  transform: rotateY(180deg);
  background-color: #080808;
  background-size: auto 68%;
  background-position: center 38%;
  background-repeat: no-repeat;
  border-radius: 2px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

/* Gradient overlay for text legibility over the map */
.flip-card-back::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 8, 8, 0.72) 0%,
    rgba(8, 8, 8, 0.28) 38%,
    rgba(8, 8, 8, 0.52) 68%,
    rgba(8, 8, 8, 0.90) 100%
  );
  z-index: 0;
  pointer-events: none;
}

/* Back face inner layout */
.flip-back-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 16px 14px 14px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* City label (e.g. "London", "Roma") */
.flip-city {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #BD9C2F;
  margin-bottom: 32px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(189, 156, 47, 0.3);
}

/* The memory / short description - rendered as keyword bullet list */
ul.flip-memory {
  list-style: none;
  margin: auto auto 12px;
  padding: 20px 14px 12px;
  background: rgba(0, 0, 0, 0.45);
  border-top: 2px solid rgba(189, 156, 47, 0.55);
  text-align: center !important;
}

ul.flip-memory li {
  position: relative;
  padding-left: 0;
  text-align: center !important;
  font-size: 0.77rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.015em;
}

ul.flip-memory li::before {
  content: none;
  position: absolute;
  left: 1px;
  top: -1px;
  color: #BD9C2F;
  font-style: normal;
  font-weight: 700;
  font-size: 1.3em;
  line-height: 1;
}

ul.flip-memory li + li {
  margin-top: 7px;
}

/* Price + Explore row */
.flip-back-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.flip-back-price ins .woocommerce-Price-amount,
.flip-back-price ins bdi {
  color: #BD9C2F;
  font-size: 0.88rem;
  font-weight: 700;
  font-style: normal;
  text-decoration: none;
}
.flip-back-price del {
  text-decoration: none;
}
.flip-back-price del .woocommerce-Price-amount,
.flip-back-price del bdi {
  color: #e03e3e;
  font-size: 0.75rem;
}
.flip-back-price del bdi {
  position: relative;
  display: inline-block;
}
.flip-back-price del bdi::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.5px;
  background: #e03e3e;
  pointer-events: none;
}
.flip-back-price > .woocommerce-Price-amount,
.flip-back-price > bdi {
  color: #BD9C2F;
  font-size: 0.82rem;
}

/* Explore button */
.flip-explore-btn {
  display: inline-block;
  padding: 7px 16px;
  background: transparent;
  border: 1px solid #BD9C2F;
  color: #BD9C2F;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.22s ease, color 0.22s ease;
  white-space: nowrap;
}

.flip-explore-btn:hover,
.flip-explore-btn:focus {
  background: #BD9C2F;
  color: #000000;
  outline: none;
}

/* ====================================================================
   Mobile-specific adjustments
   ==================================================================== */
@media (max-width: 768px) {
  .flip-front-meta .woocommerce-loop-product__title {
    font-size: 0.72rem;
  }
  ul.flip-memory {
    padding: 18px 10px 10px 10px;
  }
  ul.flip-memory li {
    font-size: 0.73rem;
  }

  .flip-city {
    font-size: 0.58rem;
  }

  .flip-explore-btn {
    padding: 6px 12px;
    font-size: 0.6rem;
  }
}

/* Tap hint on mobile: subtle pulse on the image */
@media (hover: none) {
  .flip-card-front .flip-image-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(189, 156, 47, 0.06);
    opacity: 0;
    animation: tapHint 3s ease-in-out 1.5s 1;
    pointer-events: none;
  }

  .flip-card-front .flip-image-link {
    position: relative;
  }

  @keyframes tapHint {
    0%   { opacity: 0; }
    30%  { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* ---- Additional country map backgrounds ---- */






















/* Mobile: whole card front is tappable */
@media (hover: none) {
  .flip-card-front {
    cursor: pointer;
  }
  .flip-card-back .flip-explore-btn {
    cursor: pointer;
  }
}
/* ---- Front face Add to Cart ---- */
.flip-card-front .button.add_to_cart_button,
.flip-card-front a.button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  margin-top: 8px;
  background: #111;
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none !important;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}

.flip-card-front .button.add_to_cart_button:hover,
.flip-card-front a.button:hover {
  background: #333;
}

.flip-card-front .button.added::after {
  display: none;
}
/* ---- Modern Sale badge ---- */
.flip-product-item .onsale {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  background: #e03e3e;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 2px;
  border: none;
  min-width: unset;
  min-height: unset;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(224,62,62,0.35);
}

/* ---- Country map SVGs (accurate outlines from amcharts) ---- */
.flip-product-item[data-country="italy"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/italy.svg');
}
.flip-product-item[data-country="uk"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/uk.svg');
}
.flip-product-item[data-country="germany"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/germany.svg');
}
.flip-product-item[data-country="france"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/france.svg');
}
.flip-product-item[data-country="spain"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/spain.svg');
}
.flip-product-item[data-country="netherlands"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/netherlands.svg');
}
.flip-product-item[data-country="austria"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/austria.svg');
}
.flip-product-item[data-country="switzerland"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/switzerland.svg');
}
.flip-product-item[data-country="portugal"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/portugal.svg');
}
.flip-product-item[data-country="greece"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/greece.svg');
}
.flip-product-item[data-country="belgium"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/belgium.svg');
}
.flip-product-item[data-country="sweden"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/sweden.svg');
}
.flip-product-item[data-country="japan"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/japan.svg');
}
.flip-product-item[data-country="usa"] .flip-card-back {
  background-image: url('https://112italy.com/wp-content/plugins/112italy-custom/assets/maps/usa.svg');
}
