﻿/* ==========================================================================
   DGP HOME CATALOG: CATEGORY SLIDER + 4X6 PRODUCT GRID WITH PAGINATION
   ========================================================================== */

.dgp-home-catalog-section {
  position: relative;
  z-index: 1;
  padding: 180px 0 80px;
  background: #ffffff;
  font-family: "Be Vietnam Pro", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   1. CATEGORY SLIDER (DANH MỤC NỔI BẬT)
   -------------------------------------------------------------------------- */
.dgp-cat-section-header {
  text-align: center;
  margin-bottom: 35px;
}

.dgp-cat-title {
  font-family: "Be Vietnam Pro", Arial, sans-serif;
  font-size: clamp(26px, 2.5vw, 36px);
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #2b2825;
  margin: 0 0 14px;
}

.dgp-cat-divider {
  width: 52px;
  height: 2px;
  background-color: var(--dgp-wood, #A47C58);
  margin: 0 auto;
  border-radius: 2px;
}

.dgp-cat-slider-wrap {
  position: relative;
  margin: 0 auto 60px;
  padding: 0;
  width: 100%;
  overflow: visible;
}

.dgp-cat-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 25px 0 35px;
  width: 100%;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  user-select: none;
  overflow-y: visible;
}

.dgp-cat-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Category Card */
.dgp-cat-card-item {
  flex: 0 0 190px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: transparent;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.dgp-cat-card-item:hover,
.dgp-cat-card-item.is-active {
  transform: translateY(-4px);
}

.dgp-cat-img-wrapper {
  width: 160px;
  height: 160px;
  background: #fbfaf8;
  border: 1px solid #e8e3dc;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.02);
}

.dgp-cat-card-item:hover .dgp-cat-img-wrapper,
.dgp-cat-card-item.is-active .dgp-cat-img-wrapper {
  border-color: var(--dgp-wood, #A47C58);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(164, 124, 88, 0.15);
}

.dgp-cat-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.dgp-cat-card-item:hover .dgp-cat-img-wrapper img {
  transform: scale(1.08);
}

.dgp-cat-item-title {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #3b3733;
  text-align: center;
  transition: color 0.25s ease;
  line-height: 1.35;
}

.dgp-cat-card-item:hover .dgp-cat-item-title,
.dgp-cat-card-item.is-active .dgp-cat-item-title {
  color: var(--dgp-wood, #A47C58);
}

/* Nav Buttons */
.dgp-cat-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #dfd8ce;
  color: #55504a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
  z-index: 10;
}

.dgp-cat-nav-btn svg {
  width: 20px;
  height: 20px;
}

.dgp-cat-nav-btn:hover {
  background: #ffffff;
  border-color: var(--dgp-wood, #A47C58);
  color: var(--dgp-wood, #A47C58);
  box-shadow: 0 6px 18px rgba(164, 124, 88, 0.22);
  transform: translateY(-50%) scale(1.06);
}

.dgp-cat-nav-btn:disabled,
.dgp-cat-nav-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.dgp-cat-prev {
  left: -50px;
}

.dgp-cat-next {
  right: -50px;
}

@media (max-width: 1600px) {
  .dgp-cat-prev {
    left: -20px;
  }
  .dgp-cat-next {
    right: -20px;
  }
}

@media (max-width: 1024px) {
  .dgp-cat-prev {
    left: 10px;
  }
  .dgp-cat-next {
    right: 10px;
  }
}

/* --------------------------------------------------------------------------
   2. PRODUCT SECTION HEAD BAR
   -------------------------------------------------------------------------- */
.dgp-product-section-block {
  margin-top: 20px;
}

.dgp-home-product-row + .dgp-home-product-row {
  margin-top: clamp(48px, 5vw, 76px);
}

.dgp-home-product-row .dgp-product-head-bar {
  gap: 16px;
}

.dgp-home-product-row .dgp-head-view-all {
  flex-shrink: 0;
}

.dgp-product-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 28px;
}

.dgp-head-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dgp-home-product-row .dgp-home-row-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--dgp-wood, #A47C58);
}

.dgp-home-product-row .dgp-home-row-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dgp-gift-icon {
  font-size: 24px;
  line-height: 1;
}

.dgp-product-head-title {
  font-family: "Be Vietnam Pro", Arial, sans-serif;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #7b4a2e;
  margin: 0;
  text-transform: uppercase;
}

.dgp-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(164, 124, 88, 0.12);
  color: var(--dgp-wood-dark, #886244);
  font-size: 12px;
  font-weight: 600;
  border-radius: 99px;
  margin-left: 8px;
}

.dgp-clear-filter {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: #886244;
  cursor: pointer;
  line-height: 1;
}

.dgp-clear-filter:hover {
  color: #d00;
}

.dgp-head-view-all {
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 700;
  color: #293992;
  text-decoration: none;
  text-underline-offset: .22em;
  transition: color .2s ease;
}

.dgp-head-view-all:hover {
  color: #1e2b73;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   3. 4-COLUMN X 6-ROW PRODUCT GRID (24 SẢN PHẨM / TRANG)
   -------------------------------------------------------------------------- */
.dgp-product-4col-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  transition: opacity 0.3s ease;
}

.dgp-product-4col-grid > .product-small {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  flex: none;
}

.dgp-product-4col-grid.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

/* Product Card */
.dgp-prod-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #2b2b2b;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  height: 100%;
  flex-direction: column;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.dgp-prod-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  border-color: var(--dgp-wood, #A47C58);
}

/* Product Image & Badges */
.dgp-prod-image-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 1;
  background: #f8f7f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dgp-discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #1e1e1e;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  z-index: 3;
}

.dgp-discount-badge.dgp-badge-hot {
  background: #b83d2f;
}

.dgp-prod-link {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  padding: 15px;
}

.dgp-prod-link img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Product Card Details */
.dgp-prod-details {
  box-sizing: border-box;
  height: 168px;
  min-height: 168px;
  flex: 0 0 168px;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.dgp-prod-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  min-height: 42px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dgp-prod-title a {
  color: #2e2b27;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.dgp-prod-title a:hover {
  color: var(--dgp-wood, #A47C58);
}

.dgp-prod-pricing-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  gap: 10px;
}

.dgp-prod-prices {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dgp-price-main,
.dgp-price-main .woocommerce-Price-amount {
  font-size: 16px;
  font-weight: 700;
  color: #242220;
}

.dgp-price-regular,
.dgp-price-regular .woocommerce-Price-amount {
  font-size: 12px;
  color: #99938a;
  text-decoration: line-through;
  font-weight: 500;
}

.dgp-prod-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #293992;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 122, 255, 0.28);
}

.dgp-prod-action-btn svg {
  width: 17px;
  height: 17px;
}

.dgp-prod-action-btn:hover {
  background: #293992;
  transform: scale(1.1);
  box-shadow: 0 5px 12px rgba(0, 122, 255, 0.4);
}

.dgp-no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: #777;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   4. PHÂN TRANG (PAGINATION)
   -------------------------------------------------------------------------- */
.dgp-pagination-container {
  margin-top: 45px;
  display: flex;
  justify-content: center;
}

.dgp-pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fbfaf8;
  padding: 8px 12px;
  border: 1px solid #e7e2da;
  border-radius: 12px;
}

.dgp-page-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #ddd7cd;
  color: #3b3732;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: "Be Vietnam Pro", Arial, sans-serif;
}

.dgp-page-btn:hover {
  background: #f5f0ea;
  border-color: var(--dgp-wood, #A47C58);
  color: var(--dgp-wood, #A47C58);
}

.dgp-page-btn.is-active {
  background: var(--dgp-wood, #A47C58);
  border-color: var(--dgp-wood, #A47C58);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(164, 124, 88, 0.35);
  cursor: default;
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .dgp-product-4col-grid:not(.dgp-home-product-row .dgp-product-4col-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .dgp-home-product-row .dgp-product-4col-grid {
    grid-template-columns: repeat(4, minmax(260px, 42vw));
    overflow-x: auto;
    padding: 4px 4px 22px;
    scroll-snap-type: x mandatory;
    scrollbar-color: #293992 #ede8e1;
    scrollbar-width: thin;
  }

  .dgp-home-product-row .dgp-product-4col-grid > .dgp-product-card {
    scroll-snap-align: start;
  }
}

@media (max-width: 900px) {
  .dgp-cat-card-item {
    flex: 0 0 165px;
  }
  .dgp-cat-img-wrapper {
    width: 140px;
    height: 140px;
  }
  .dgp-cat-item-title {
    font-size: 12px;
  }
  .dgp-product-4col-grid:not(.dgp-home-product-row .dgp-product-4col-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .dgp-product-4col-grid:not(.dgp-home-product-row .dgp-product-4col-grid),
  .dgp-home-product-row .dgp-product-4col-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
  }

  .dgp-home-product-row .dgp-product-4col-grid > .dgp-product-card:nth-child(n + 4) {
    display: none;
  }
}

@media (max-width: 600px) {
  .dgp-home-product-row + .dgp-home-product-row {
    margin-top: 44px;
  }

  .dgp-home-product-row .dgp-product-head-bar {
    align-items: flex-end;
    margin-bottom: 18px;
  }

  .dgp-home-product-row .dgp-head-view-all {
    font-size: 12px;
  }

  .dgp-home-catalog-section {
    padding: 40px 0 60px;
  }
  .dgp-cat-nav-btn {
    width: 36px;
    height: 36px;
  }
  .dgp-cat-prev {
    margin-right: 6px;
  }
  .dgp-cat-next {
    margin-left: 6px;
  }
  .dgp-cat-track {
    min-width: 0;
    gap: 0;
    padding-right: 0;
    padding-left: 0;
  }
  .dgp-cat-card-item {
    box-sizing: border-box;
    flex: 0 0 100%;
    padding: 6px;
  }
  .dgp-cat-img-wrapper {
    width: 125px;
    height: 125px;
  }
  .dgp-product-4col-grid:not(.dgp-home-product-row .dgp-product-4col-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .dgp-home-product-row .dgp-product-4col-grid {
    grid-template-columns: repeat(4, minmax(245px, 82vw));
    gap: 14px;
  }
  .dgp-prod-details {
    height: 132px;
    min-height: 132px;
    flex-basis: 132px;
    padding: 12px;
  }
  .dgp-prod-title {
    font-size: 13px;
    min-height: 36px;
    line-height: 1.35;
  }
  .dgp-price-main,
  .dgp-price-main .woocommerce-Price-amount {
    font-size: 14px;
  }
  .dgp-prod-action-btn {
    width: 28px;
    height: 28px;
  }
  .dgp-prod-action-btn svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 600px) {
  .dgp-home-product-row {
    padding-inline: 0;
  }

  .dgp-home-product-row .dgp-product-4col-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
    margin-inline: 0;
    padding: 0 !important;
    scroll-snap-type: none;
  }

  .dgp-home-product-row .dgp-product-4col-grid > .dgp-product-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-inline: 0;
  }

  .dgp-home-product-row :is(.flickity-prev-next-button, .flickity-button, .slider-nav) {
    display: none !important;
  }
}

@media (max-width: 600px) {
  body.home #main .dgp-home-product-row {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
  }

  body.home #main .dgp-home-product-row .dgp-product-4col-grid {
    box-sizing: border-box;
    display: grid !important;
    width: 100% !important;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
  }

  body.home #main .dgp-home-product-row .dgp-product-4col-grid > .product-small {
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

}
