/**
 * Hermes DNA Recommender Stylesheet (v1.3.1)
 * - Desktop & Tablet (>= 768px): Full multi-column product grid showing all products in full + End-of-block "See More" button
 * - Mobile (<= 767px): Horizontal Snap-Scroll Carousel ("2 Full + 0.5 Peek Card" UX) + End-of-row "See More" card
 */

.dna-rec-wrapper {
  margin: 32px 0 24px 0;
  padding: 20px 0 10px 0;
  border-top: 1px solid #e5e7eb;
  clear: both;
  width: 100%;
  max-width: 100%;
}

.dna-rec-header-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dna-rec-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
  letter-spacing: -0.02em;
}

.dna-rec-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dna-rec-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  background-color: #f3f4f6;
  color: #374151;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #e5e7eb;
}

.dna-rec-tag-pill:hover {
  background-color: #111827;
  color: #ffffff;
  border-color: #111827;
}

/* Multi-Block Section Container */
.dna-rec-block-section {
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}

.dna-rec-block-section:last-child {
  margin-bottom: 8px;
  border-bottom: none;
  padding-bottom: 0;
}

.dna-rec-block-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.dna-rec-block-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dna-rec-block-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dna-rec-block-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
}

.dna-rec-block-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.dna-rec-block-subtitle {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0;
}

.dna-rec-block-Controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dna-rec-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
}

.dna-rec-nav-btn:hover {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

/* ==========================================================================
   MOBILE (< 768px): Horizontal Carousel with "2 Full + 0.5 Peek Card"
   ========================================================================== */
@media (max-width: 767px) {
  .dna-rec-carousel-track {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding: 4px 2px 12px 2px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  .dna-rec-carousel-track::-webkit-scrollbar {
    height: 4px;
  }

  .dna-rec-carousel-track::-webkit-scrollbar-track {
    background: transparent;
  }

  .dna-rec-carousel-track::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
  }

  /* 2 Full cards + 0.5 card peeking on the right */
  .dna-rec-carousel-track > .dna-rec-card,
  .dna-rec-carousel-track > .dna-rec-type-card,
  .dna-rec-carousel-track > .dna-rec-see-more-card {
    scroll-snap-align: start;
    flex: 0 0 calc((100% - 24px) / 2.5);
    width: calc((100% - 24px) / 2.5);
    max-width: calc((100% - 24px) / 2.5);
    box-sizing: border-box;
  }

  .dna-rec-block-footer {
    display: none;
  }
}

/* ==========================================================================
   TABLET & DESKTOP (>= 768px): Full Grid Showing All Products in Full
   ========================================================================== */
@media (min-width: 768px) {
  .dna-rec-block-Controls {
    display: none !important;
  }

  .dna-rec-carousel-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
    padding: 0;
  }

  .dna-rec-carousel-track > .dna-rec-card,
  .dna-rec-carousel-track > .dna-rec-type-card {
    width: 100%;
    max-width: 100%;
    flex: none;
    box-sizing: border-box;
  }

  /* Hide the mobile swipe-end card on Tablet/Desktop since we show a clean full button bar at the end of the block */
  .dna-rec-carousel-track > .dna-rec-see-more-card {
    display: none !important;
  }

  .dna-rec-block-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
  }
}

@media (min-width: 1025px) {
  .dna-rec-carousel-track {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
  }
}

/* End-of-Block Button for Desktop & Tablet */
.dna-rec-more-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background-color: #ffffff;
  color: #111827 !important;
  border: 1.5px solid #111827;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.dna-rec-more-button:hover {
  background-color: #111827;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
}

/* Product Card */
.dna-rec-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.dna-rec-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.dna-rec-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f8fafc;
  overflow: hidden;
}

.dna-rec-thumb-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.dna-rec-card:hover .dna-rec-thumb-wrap img {
  transform: scale(1.05);
}

.dna-rec-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 2;
  backdrop-filter: blur(3px);
  max-width: calc(100% - 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dna-rec-info {
  padding: 10px 11px 12px 11px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.dna-rec-product-title {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1e293b;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
}

.dna-rec-price-row {
  margin-top: auto;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dna-rec-price-del {
  font-size: 0.78rem;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 400;
}

.dna-rec-price-sale {
  color: #dc2626;
  font-weight: 700;
}

/* Mobile End-of-Row "See More" Action Card */
.dna-rec-see-more-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  padding: 18px 14px;
  text-decoration: none !important;
  color: #0f172a;
  transition: all 0.2s ease;
  min-height: 220px;
}

.dna-rec-see-more-card:hover {
  background: #eef2ff;
  border-color: #6366f1;
  transform: translateY(-2px);
}

.dna-rec-see-more-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.dna-rec-see-more-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.3;
}

.dna-rec-see-more-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 10px;
}

.dna-rec-see-more-btn {
  display: inline-block;
  padding: 6px 12px;
  background: #111827;
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
}

/* Block 4: Related Product Types Cards */
.dna-rec-type-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit;
  transition: all 0.2s ease;
}

.dna-rec-type-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  border-color: #6366f1;
}

.dna-rec-type-info {
  padding: 10px 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dna-rec-type-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
}

.dna-rec-type-sub {
  font-size: 0.72rem;
  color: #64748b;
}

.dna-rec-type-cta {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4f46e5;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Skeleton Loader */
.dna-rec-skeleton-carousel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .dna-rec-skeleton-carousel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .dna-rec-skeleton-carousel {
    display: flex;
    gap: 12px;
    overflow: hidden;
  }
  .dna-rec-skeleton-card {
    flex: 0 0 calc((100% - 24px) / 2.5);
  }
}

.dna-rec-skeleton-card {
  height: 250px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: dna-rec-shimmer 1.5s infinite;
  border-radius: 10px;
}

@keyframes dna-rec-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
