/**
 * Product Grid Widget — Velour Pro Addons
 */

/* ========================================
   SECTION WRAPPER
   ======================================== */
.vnpa-product-grid {
    padding: 48px 0;
    background: #FAFBFC;
}

@media (min-width: 1024px) {
    .vnpa-product-grid {
        padding: 80px 0;
    }
}

/* ========================================
   CONTAINER
   ======================================== */
.vnpa-product-grid__container {
    max-width: 1440px;
    margin: 0 auto;
}

/* ========================================
   HEADER ROW
   ======================================== */
.vnpa-product-grid__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 1024px) {
    .vnpa-product-grid__header {
        flex-direction: row;
        align-items: center;
    }
}

/* ========================================
   HEADER TEXT
   ======================================== */
.vnpa-product-grid__subtitle {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0072FF;
    margin-top: 0;
}

.vnpa-product-grid__title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 24px !important;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .vnpa-product-grid__title {
        font-size: 36px !important;
    }
}

/* ========================================
   FILTER CHIPS
   ======================================== */
.vnpa-product-grid__filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
}

/* On mobile/tablet, ensure filters take full width and scroll horizontally */
@media (max-width: 1023px) {
    .vnpa-product-grid__filters {
        width: 100%;
        padding-bottom: 4px;
    }
}

.vnpa-product-grid__filters::-webkit-scrollbar {
    display: none;
}

.vnpa-product-grid__filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 9999px;
    border: 1px solid #E5E7EB;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.25s ease;
    font-weight: 500;
    color: #6B7280;
    background: transparent;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.vnpa-product-grid__filter-chip:hover {
    border-color: #111827;
    color: #111827;
}

.vnpa-product-grid__filter-chip.active {
    background: #0072FF;
    color: #ffffff;
    border-color: #0072FF;
}

/* ========================================
   PRODUCT GRID
   ======================================== */
.vnpa-product-grid__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 500px) {
    .vnpa-product-grid__grid {
        grid-template-columns: repeat(var(--vnpa-cols-tablet, 3), 1fr);
    }
}

@media (min-width: 1024px) {
    .vnpa-product-grid__grid {
        grid-template-columns: repeat(var(--vnpa-cols-desktop, 4), 1fr);
        gap: 20px;
    }
}

/* ========================================
   PRODUCT CARD
   ======================================== */
.vnpa-product-grid__card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #E5E7EB;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    text-decoration: none;
    color: inherit;
    display: block;
}

.vnpa-product-grid__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

/* ========================================
   PRODUCT BADGE
   ======================================== */
.vnpa-product-grid__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    letter-spacing: 0.08em;
    font-weight: 700;
    line-height: 1.6;
}

.vnpa-product-grid__badge--new {
    background: #FFB800;
    color: #111827;
}

.vnpa-product-grid__badge--bestseller {
    background: #0072FF;
    color: #ffffff;
}

.vnpa-product-grid__badge--sale {
    background: #FF3D81;
    color: #ffffff;
}

.vnpa-product-grid__badge--eco {
    background: #00A86B;
    color: #ffffff;
}

/* ========================================
   WISHLIST BUTTON
   ======================================== */
.vnpa-product-grid__wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: #6B7280;
    transition: color 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0;
}

.vnpa-product-grid__wishlist:hover {
    color: #FF3D81;
}

.vnpa-product-grid__wishlist.active {
    color: #FF3D81;
}

.vnpa-product-grid__wishlist svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   PRODUCT IMAGE AREA (image + overlay wrapper)
   ======================================== */
.vnpa-product-grid__image-area {
    position: relative;
    overflow: hidden;
}

/* ========================================
   ADD TO CART OVERLAY (covers image only)
   ======================================== */
.vnpa-product-grid__atc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.vnpa-product-grid__card:hover .vnpa-product-grid__atc-overlay {
    opacity: 1;
    pointer-events: auto;
}

.vnpa-product-grid__atc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 9999px;
    background: #111827;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
    text-decoration: none;
}

.vnpa-product-grid__atc-btn:hover {
    background: rgba(17, 24, 39, 0.85);
    color: #ffffff;
}

.vnpa-product-grid__atc-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Loading state */
.vnpa-product-grid__atc-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.vnpa-product-grid__atc-btn.added {
    background: #00A86B;
    cursor: default;
    pointer-events: none;
}

.vnpa-product-grid__atc-btn.added:hover {
    background: #00A86B;
}

/* ========================================
   PRODUCT IMAGE
   ======================================== */
.vnpa-product-grid__image-wrap {
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f3f4f6;
}

.vnpa-product-grid__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.vnpa-product-grid__card:hover .vnpa-product-grid__image-wrap img {
    transform: scale(1.06);
}

/* ========================================
   PRODUCT INFO
   ======================================== */
.vnpa-product-grid__info {
    padding: 12px;
}

@media (min-width: 1024px) {
    .vnpa-product-grid__info {
        padding: 16px;
    }
}

/* Star rating */
.vnpa-product-grid__rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: -4px;
    margin-bottom: 4px;
    flex-wrap: nowrap;
}

.vnpa-product-grid__rating-star {
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vnpa-product-grid__rating-star svg {
    display: block;
    width: 100%;
    height: 100%;
}

.vnpa-product-grid__rating-star--filled svg {
    fill: none;
    stroke: #FFB800;
}

.vnpa-product-grid__rating-star--empty svg {
    fill: none;
    stroke: #e5e7eb;
}

.vnpa-product-grid__rating-count {
    font-size: 10px;
    color: #6B7280;
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Brand name */
.vnpa-product-grid__brand {
    font-size: 10px !important;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 2px;
    line-height: 1.4;
}

/* Product title */
.vnpa-product-grid__product-title {
    font-size: 14px !important;
    font-weight: 500;
    color: #111827;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Price */
.vnpa-product-grid__price {
    font-size: 14px !important;
    font-weight: 700;
    color: #111827;
    margin: 4px 0 0;
    display: block;
}

.vnpa-product-grid__price--sale {
    color: #FF3D81;
}

.vnpa-product-grid__price-original {
    font-size: 12px;
    color: #6B7280;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 400;
}

/* Color swatches */
.vnpa-product-grid__colors {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.vnpa-product-grid__color-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #E5E7EB;
    display: inline-block;
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */
.vnpa-product-grid__load-more-wrap {
    text-align: center;
    margin-top: 40px;
}

.vnpa-product-grid__load-more {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    border-radius: 9999px;
    border: 1px solid #E5E7EB;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.4;
}

.vnpa-product-grid__load-more:hover {
    border-color: #111827;
}

.vnpa-product-grid__load-more.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ========================================
   NO PRODUCTS FOUND
   ======================================== */
.vnpa-product-grid__empty {
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
    font-size: 14px;
}

/* ========================================
   SCALE-IN ANIMATION (for filter transitions)
   ======================================== */
@keyframes vnpa-scale-in {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.vnpa-product-grid__card--animate {
    animation: vnpa-scale-in 0.4s ease-out forwards;
}

/* Spinner for add-to-cart loading */
@keyframes vnpa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
