/* ============================================================
   GoGiftings V28 — Product Card Complete Rewrite
   Fixes: justified alignment, professional spacing, button
   centering, title truncation, price layout, meta row,
   no gaps, consistent mobile sizing, hover polish.
   ============================================================ */

/* ── CARD SHELL ─────────────────────────────────────────────── */
.gg-unified-card {
  background: #ffffff !important;
  border: 1px solid #f0dcea !important;
  border-radius: 20px !important;
  padding: 0 !important;
  box-shadow: 0 6px 28px rgba(72,32,84,.07) !important;
  transition: transform .24s cubic-bezier(.25,.46,.45,.94),
              box-shadow .24s ease,
              border-color .24s ease !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
.gg-unified-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 22px 52px rgba(72,32,84,.14) !important;
  border-color: rgba(246,39,128,.28) !important;
}

/* ── IMAGE BLOCK ─────────────────────────────────────────────── */
.gg-unified-card .thumb-wrap,
.gg-unified-card .product-image-wrap {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 0 !important;
  border-top-left-radius: 20px !important;
  border-top-right-radius: 20px !important;
  overflow: hidden !important;
  background: #fff7fb !important;
  flex-shrink: 0 !important;
  /* No border — image goes edge to edge on top */
}
.gg-unified-card .product-thumb {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}
.gg-unified-card .gg-unified-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border-radius: 0 !important;
  transition: transform .42s cubic-bezier(.25,.46,.45,.94) !important;
  will-change: transform !important;
}
.gg-unified-card:hover .gg-unified-img {
  transform: scale(1.07) !important;
}

/* ── DELIVERY TAG ────────────────────────────────────────────── */
.gg-unified-card .gg-tag {
  position: absolute !important;
  bottom: 10px !important;
  left: 10px !important;
  top: auto !important;
  right: auto !important;
  background: rgba(255,255,255,.96) !important;
  color: #f62780 !important;
  border: 1px solid rgba(246,39,128,.22) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-size: 9.5px !important;
  font-weight: 900 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  box-shadow: 0 3px 10px rgba(66,26,73,.14) !important;
  z-index: 5 !important;
  line-height: 1.2 !important;
  backdrop-filter: blur(6px) !important;
}

/* ── WISHLIST BUTTON ─────────────────────────────────────────── */
.gg-unified-card .wishlist-toggle {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(246,39,128,.18) !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 5 !important;
  cursor: pointer !important;
  transition: background .18s, transform .18s !important;
  backdrop-filter: blur(6px) !important;
}
.gg-unified-card .wishlist-toggle:hover {
  background: #fff0f6 !important;
  transform: scale(1.1) !important;
}

/* ── RATING BADGE ────────────────────────────────────────────── */
.gg-unified-card .gg-rating-badge {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  background: #058e43 !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 3px 8px !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  z-index: 5 !important;
  letter-spacing: .02em !important;
}

/* ── CARD BODY — the whole bottom section ───────────────────── */
.gg-unified-card .product-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  padding: 14px 14px 14px !important;
  gap: 0 !important;
}

/* ── PRODUCT TITLE ───────────────────────────────────────────── */
.gg-unified-card h4 {
  margin: 0 0 8px !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  line-height: 1.38 !important;
  color: #1f1422 !important;
  /* Two-line clamp — never causes layout gap */
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  min-height: 0 !important;   /* ← REMOVE the old fixed min-height that caused gaps */
}
.gg-unified-card h4 a {
  color: inherit !important;
  text-decoration: none !important;
}
.gg-unified-card h4 a:hover { color: #f62780 !important; }

/* ── PRICE ROW ───────────────────────────────────────────────── */
.gg-unified-card .price {
  display: flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  color: #f62780 !important;
  margin: 0 0 5px !important;
  line-height: 1.15 !important;
}
.gg-unified-card .price .currency-text {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #9a7e8e !important;
  line-height: 1 !important;
  align-self: center !important;
}
.gg-unified-card .price .original-price,
.gg-unified-card .price .was-price {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #c0a2b2 !important;
  text-decoration: line-through !important;
}
.gg-unified-card .price .save-badge {
  font-size: 10px !important;
  font-weight: 900 !important;
  color: #fff !important;
  background: #22c55e !important;
  border-radius: 6px !important;
  padding: 2px 6px !important;
  margin-left: 4px !important;
  align-self: center !important;
}

/* ── META / DELIVERY INFO ────────────────────────────────────── */
.gg-unified-card .meta {
  font-size: 11px !important;
  color: #138c40 !important;
  font-weight: 700 !important;
  margin: 0 0 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  line-height: 1.2 !important;
}
.gg-unified-card .meta::before {
  content: '●' !important;
  font-size: 8px !important;
  color: #22c55e !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}
.gg-unified-card .meta b { color: #0a6e35 !important; }

/* ── SPACER — pushes buttons to the bottom of every card ─────── */
.gg-unified-card .product-card-body::after {
  content: '' !important;
  flex: 1 !important;
  display: block !important;
  min-height: 4px !important;
}

/* ── ACTION BUTTONS ROW ──────────────────────────────────────── */
.gg-unified-card .gg-card-actions {
  display: grid !important;
  grid-template-columns: 88px 1fr !important;  /* fixed width view + flexible add */
  gap: 8px !important;
  margin-top: 0 !important;
  align-items: stretch !important;
  width: 100% !important;
}

/* ── VIEW BUTTON ─────────────────────────────────────────────── */
.gg-unified-card .gg-view-btn {
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 12px !important;
  background: #fff0f7 !important;
  color: #f62780 !important;
  border: 1.5px solid #fad0e6 !important;
  font-weight: 900 !important;
  font-size: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background .18s, border-color .18s !important;
  letter-spacing: .01em !important;
}
.gg-unified-card .gg-view-btn:hover {
  background: #ffe4f2 !important;
  border-color: rgba(246,39,128,.4) !important;
}

/* ── ADD TO CART BUTTON ──────────────────────────────────────── */
.gg-unified-card .quick-add,
.gg-unified-card .gg-add-btn {
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #f62780 0%, #5a1a93 100%) !important;
  color: #fff !important;
  border: 0 !important;
  font-weight: 900 !important;
  font-size: 12.5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
  width: 100% !important;
  box-sizing: border-box !important;
  box-shadow: 0 6px 18px rgba(246,39,128,.25) !important;
  transition: opacity .18s, transform .18s, box-shadow .18s !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
  letter-spacing: .01em !important;
}
.gg-unified-card .quick-add:hover,
.gg-unified-card .gg-add-btn:hover {
  opacity: .92 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 26px rgba(246,39,128,.33) !important;
}
.gg-unified-card .quick-add:active,
.gg-unified-card .gg-add-btn:active {
  transform: translateY(0) scale(.98) !important;
}

/* ═══════════════════════════════════════════════════════════
   GRID LAYOUT — listing page
   ═══════════════════════════════════════════════════════════ */
.gg-unified-grid,
.listing-grid {
  display: grid !important;
  gap: 16px !important;
}

/* Desktop: 3 columns */
@media (min-width: 901px) {
  .gg-unified-grid,
  .listing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }
}

/* Tablet: 2 columns */
@media (min-width: 541px) and (max-width: 900px) {
  .gg-unified-grid,
  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

/* Mobile: 2 columns (small cards) */
@media (max-width: 540px) {
  .gg-unified-grid,
  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .gg-unified-card .product-card-body {
    padding: 10px 10px 10px !important;
  }
  .gg-unified-card h4 {
    font-size: 12px !important;
  }
  .gg-unified-card .price {
    font-size: 15px !important;
  }
  .gg-unified-card .gg-card-actions {
    grid-template-columns: 1fr !important;  /* stack on very small screens */
    gap: 6px !important;
  }
  .gg-unified-card .gg-view-btn,
  .gg-unified-card .quick-add,
  .gg-unified-card .gg-add-btn {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 11px !important;
    border-radius: 10px !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   GRID ROWS: equal card heights  
   ═══════════════════════════════════════════════════════════ */
.gg-unified-grid,
.listing-grid {
  align-items: stretch !important;
}
.gg-unified-grid .gg-unified-card,
.listing-grid .gg-unified-card {
  min-height: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   SORTBAR above grid
   ═══════════════════════════════════════════════════════════ */
.sortbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 0 16px !important;
  flex-wrap: wrap !important;
}
.sortbar h1 {
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #1a1020 !important;
  margin: 0 !important;
  letter-spacing: -.03em !important;
}
.sortbar p {
  margin: 4px 0 0 !important;
  font-size: 13px !important;
  color: #7a6b7e !important;
}
.sort-select {
  border: 1.5px solid #f0dcea !important;
  border-radius: 12px !important;
  padding: 9px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #2b1a24 !important;
  background: #fff !important;
  cursor: pointer !important;
  outline: none !important;
  min-width: 180px !important;
}
.sort-select:focus {
  border-color: rgba(246,39,128,.4) !important;
  box-shadow: 0 0 0 3px rgba(246,39,128,.08) !important;
}

/* ═══════════════════════════════════════════════════════════
   LISTING LAYOUT (sidebar + grid)
   ═══════════════════════════════════════════════════════════ */
.listing-layout {
  display: grid !important;
  grid-template-columns: 224px 1fr !important;
  gap: 24px !important;
  align-items: start !important;
}
@media (max-width: 860px) {
  .listing-layout {
    grid-template-columns: 1fr !important;
  }
  .sidebar {
    display: none !important;   /* collapse sidebar on mobile */
  }
}
