/* ================================
   SCOPED RESET (only embed)
================================ */
.tm-embed,
.tm-embed * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================================
   BASE TYPOGRAPHY
================================ */
.tm-embed {
  font-family: 'Poppins', 'Inter', sans-serif;
  background-color: #ffffff;
  color: #222;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;

  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ================================
   LAYOUT
================================ */
.tm-embed .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  width: 100%;
  max-width: 1100px;
}

/* ================================
   CARDS
================================ */
.tm-embed .card {
  width: 320px;
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tm-embed .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

/* Card image */
.tm-embed .card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tm-embed .card:hover img {
  transform: scale(1.05);
}

/* Card content: centered column */
.tm-embed .card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tm-embed .card-title {
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  color: #222;
  letter-spacing: -0.01em;
}

/* Item card price (same “clean” style as title) */
.tm-embed .card-price {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  color: #222;
  letter-spacing: -0.01em;
}

/* ================================
   BUTTONS
================================ */
.tm-embed .btn {
  width: 100%;
  padding: 12px 18px;
  background-color: #e6dad1;
  color: #222;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.tm-embed .btn:hover {
  background-color: #d8c9bd;
  transform: translateY(-1px);
}

/* ================================
   BACK BUTTON
================================ */
.tm-embed .back-btn {
  background-color: #e6dad1;
  border: none;
  cursor: pointer;
  padding: 10px 14px;
  margin-bottom: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #222;
  font-size: 15px;
  transition: background-color 0.2s ease;
}

.tm-embed .back-btn:hover {
  background-color: #d8c9bd;
}

.tm-embed .back-btn svg {
  width: 16px;
  height: 16px;
}

/* ================================
   ITEMS VIEW
================================ */
.tm-embed .items-view {
  width: 100%;
  max-width: 900px;
}

/* ================================
   MODAL OVERLAY (popup)
================================ */
.tm-embed .modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
}

.tm-embed .modal-overlay.active {
  display: flex;
}

/* ================================
   POPUP TEMPLATE (product card)
================================ */
.tm-embed .product-card {
  position: relative;
  width: 100%;
  max-width: 24rem;
  overflow: hidden;
  border-radius: 0.75rem;
  background-color: #fff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Image section */
.tm-embed .image-section {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.tm-embed .product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Close button */
.tm-embed .close-button {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.8);
  color: #666;
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.tm-embed .close-button:hover {
  background-color: #fff;
  color: #222;
}

/* Content section */
.tm-embed .content-section {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* fixes cramped feeling */
}

.tm-embed .product-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.tm-embed .product-price {
  font-size: 1.875rem;
  font-weight: 700;
  color: #8e7555;
  margin: 0;
  text-align: center;
}

.tm-embed .product-description {
  font-size: 0.95rem;
  color: #666;
  margin: 0;
  text-align: center;
  line-height: 1.35;
}

/* Allergens */
.tm-embed .allergens-section {
  margin-top: 0.25rem;
}

.tm-embed .allergens-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #222;
  margin: 0;
}

.tm-embed .allergens-list {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tm-embed .allergy-badge,
.tm-embed .allergen-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #eadfd6;
  background-color: #f4eee9;
  font-size: 0.875rem;
  color: #6b5a49;
}

/* ================================
   UTILITIES
================================ */
.tm-embed .hidden {
  display: none;
}

/* ================================
   FORCE popup price + description visible
   (wins against theme/old rules)
================================ */
.tm-embed #modal-price,
.tm-embed #modal-description {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* ================================
   MOBILE
================================ */
@media (max-width: 600px) {
  .tm-embed {
    padding: 20px;
  }

  .tm-embed .card {
    width: 100%;
  }

  .tm-embed .card img {
    height: 220px;
  }
}
