/* ==========================================================================
   CERTIFICATES & AWARDS POPUP MODAL SYSTEM (B HAPPY / G.G.G / CUTEM)
   ========================================================================== */

/* 1. PRODUCT CARD CERT BADGES ROW */
.product-cert-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.cert-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 10px;
  border-radius: 9999px;
  color: #E2E8F0;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}

.cert-pill-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.cert-pill-badge:active {
  transform: translateY(0);
}

/* Specific pill badge themes */
.cert-pill-badge.award {
  background: linear-gradient(135deg, rgba(238, 100, 37, 0.15), rgba(217, 119, 6, 0.12));
  border-color: rgba(238, 100, 37, 0.45);
  color: #FDBA74;
}
.cert-pill-badge.award:hover {
  border-color: #EE6425;
  box-shadow: 0 4px 18px rgba(238, 100, 37, 0.3);
}

.cert-pill-badge.bestseller {
  background: linear-gradient(135deg, rgba(205, 75, 25, 0.16), rgba(245, 158, 11, 0.12));
  border-color: rgba(205, 75, 25, 0.5);
  color: #FCD34D;
}
.cert-pill-badge.bestseller:hover {
  border-color: #F59E0B;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.28);
}

.cert-pill-badge.cooling {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(99, 102, 241, 0.1));
  border-color: rgba(56, 189, 248, 0.45);
  color: #7DD3FC;
}
.cert-pill-badge.cooling:hover {
  border-color: #38BDF8;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.28);
}

.cert-pill-badge.cutem-cert {
  background: linear-gradient(135deg, rgba(0, 180, 200, 0.12), rgba(16, 185, 129, 0.08));
  border-color: rgba(0, 180, 200, 0.4);
  color: #67E8F9;
}
.cert-pill-badge.cutem-cert:hover {
  border-color: #00B4C8;
  box-shadow: 0 4px 18px rgba(0, 180, 200, 0.25);
}

.cert-pill-badge.skinmed-stamp {
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.35), rgba(15, 23, 42, 0.5));
  border-color: rgba(34, 197, 94, 0.4);
  color: #86EFAC;
}
.cert-pill-badge.skinmed-stamp:hover {
  border-color: #22C55E;
  box-shadow: 0 4px 18px rgba(34, 197, 94, 0.25);
}

.cert-pill-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.cert-pill-view {
  font-size: 0.68rem;
  opacity: 0.8;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  margin-left: 2px;
}

/* 2. MODAL BACKDROP */
.cert-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.cert-modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* 3. MODAL CONTAINER */
.cert-modal-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  background: linear-gradient(150deg, #131B2E 0%, #0A0F1D 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 32px 36px 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-modal-backdrop.is-active .cert-modal-container {
  transform: scale(1) translateY(0);
}

/* Close button */
.cert-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #CBD5E1;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  z-index: 10;
}

.cert-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  transform: rotate(90deg);
}

/* Badge tag */
.cert-modal-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(238, 100, 37, 0.16);
  color: #FB923C;
  border: 1px solid rgba(238, 100, 37, 0.35);
  margin-bottom: 12px;
}

/* Modal title */
.cert-modal-title {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.35;
  margin: 0 0 18px;
  padding-right: 44px;
}

/* Image preview box */
.cert-modal-img-wrap {
  position: relative;
  width: 100%;
  min-height: 400px;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.38) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 18px;
  overflow: hidden;
}

.cert-modal-img {
  max-width: 100%;
  max-height: 56vh;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.6));
}

.cert-modal-img:hover {
  transform: scale(1.02);
}

/* Gallery switcher tabs (for multi-cert products like Cooling Mask) */
.cert-modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cert-modal-tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cert-modal-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
}

.cert-modal-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.2));
  border-color: #38BDF8;
  color: #38BDF8;
  font-weight: 700;
}

/* Description text */
.cert-modal-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #CBD5E1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0;
}

/* High-res click hint */
.cert-modal-hint {
  font-size: 0.72rem;
  color: #94A3B8;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .cert-modal-container {
    padding: 20px 18px;
    max-height: 92vh;
    border-radius: 20px;
  }
  
  .cert-modal-img-wrap {
    min-height: 220px;
    max-height: 38vh;
    padding: 10px;
  }
  
  .cert-modal-img {
    max-height: 35vh;
  }
  
  .cert-modal-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }
  
  .cert-modal-desc {
    font-size: 0.82rem;
    padding: 12px 14px;
  }

  .cert-pill-badge {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   FLOATING PRODUCT STAMP & CUP OVERLAYS (MOUNTED ON PRODUCT IMAGE AREA)
   ========================================================================== */
.product-img-wrap,
.card-img-wrap {
  position: relative !important;
}

.product-stamp-anchor {
  position: absolute;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), filter 0.28s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.product-stamp-anchor:hover {
  transform: scale(1.12) rotate(-2deg);
}

.product-stamp-anchor:active {
  transform: scale(0.95);
}

/* Positions */
.product-stamp-anchor.pos-bottom-right {
  bottom: 8px;
  right: 8px;
}

.product-stamp-anchor.pos-bottom-left {
  bottom: 8px;
  left: 8px;
}

.product-stamp-anchor.pos-top-right {
  top: 8px;
  right: 8px;
}

.product-stamp-anchor.pos-top-left {
  top: 8px;
  left: 8px;
}

/* Round Stamp Images */
.product-stamp-img {
  display: block;
  width: 95px;
  height: 95px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), filter 0.28s ease;
}

.product-stamp-anchor:hover .product-stamp-img {
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.65));
}

/* Trophy Badge */
.product-stamp-anchor.stamp-trophy .product-stamp-img {
  width: 95px;
  height: 118px;
  filter: drop-shadow(0 6px 18px rgba(238, 100, 37, 0.45));
}
.product-stamp-anchor.stamp-trophy:hover .product-stamp-img {
  filter: drop-shadow(0 10px 24px rgba(238, 100, 37, 0.75));
}

/* Single Patent Certificate Stamp */
.product-stamp-anchor.stamp-patent .product-stamp-img {
  width: 82px;
  height: 116px;
  border-radius: 4px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
  background: transparent;
}
.product-stamp-anchor.stamp-patent:hover .product-stamp-img {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.7));
}

/* Dual Patent Certificate Stamp (for Toner Chaga) */
.product-stamp-anchor.stamp-patent-dual .product-stamp-img {
  width: 128px;
  height: 88px;
  border-radius: 4px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
  background: transparent;
}
.product-stamp-anchor.stamp-patent-dual:hover .product-stamp-img {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.7));
}

/* Responsive adjustment for Mobile */
@media (max-width: 640px) {
  .product-stamp-img {
    width: 68px;
    height: 68px;
  }
  .product-stamp-anchor.stamp-trophy .product-stamp-img {
    width: 68px;
    height: 86px;
  }
  .product-stamp-anchor.stamp-patent .product-stamp-img {
    width: 60px;
    height: 84px;
  }
  .product-stamp-anchor.stamp-patent-dual .product-stamp-img {
    width: 92px;
    height: 64px;
  }
  .product-stamp-anchor.pos-bottom-right {
    bottom: 6px;
    right: 6px;
  }
  .product-stamp-anchor.pos-bottom-left {
    bottom: 6px;
    left: 6px;
  }
  .product-stamp-anchor.pos-top-right {
    top: 6px;
    right: 6px;
  }
  .product-stamp-anchor.pos-top-left {
    top: 6px;
    left: 6px;
  }
}

