/* ============================================
   WC-SHOP — Premium Dark Gamified Shop Page
   Fitness Platform Pro — Duolingo-Style
   ============================================ */

/* --- Page Header --- */
.fp-page-header-shop {
    background: linear-gradient(160deg, var(--fp-bg-secondary) 0%, var(--fp-bg-primary) 50%, var(--fp-bg-secondary) 100%);
    padding: 56px 0 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--fp-border-subtle);
}

.fp-page-header-shop::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(88, 204, 2, 0.07) 0%, rgba(28, 176, 246, 0.03) 40%, transparent 70%);
    pointer-events: none;
}

.fp-page-header-shop::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fp-primary), transparent);
    opacity: 0.3;
}

.fp-page-header-shop .fp-page-title {
    font-size: 2.4rem;
    font-weight: 900;
    margin-bottom: 10px;
    position: relative;
    background: linear-gradient(135deg, var(--fp-text-primary) 0%, var(--fp-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fp-page-header-shop .fp-page-description {
    color: var(--fp-text-secondary);
    font-size: 1.05rem;
    margin: 0;
    opacity: 0.85;
}

/* --- Category Filter Bar --- */
.fp-filter-bar-categories {
    background: var(--fp-bg-elevated);
    border: 1px solid var(--fp-border-subtle);
    border-radius: var(--fp-radius-lg);
    padding: 14px 20px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
}

.fp-filter-label {
    font-weight: 700;
    color: var(--fp-text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.fp-filter-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fp-filter-option {
    padding: 8px 18px;
    border-radius: var(--fp-radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fp-text-secondary);
    background: var(--fp-bg-secondary);
    border: 2px solid var(--fp-border-subtle);
    transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    text-decoration: none;
    position: relative;
    top: 0;
}

.fp-filter-option:hover {
    border-color: var(--fp-primary);
    color: var(--fp-primary);
    background: rgba(88, 204, 2, 0.08);
    top: -2px;
    box-shadow: 0 4px 12px rgba(88, 204, 2, 0.15);
}

.fp-filter-option.active {
    background: var(--fp-primary);
    color: #fff;
    border-color: var(--fp-primary);
    box-shadow: 0 3px 0 var(--fp-primary-dark);
}

/* --- Shop Section --- */
.fp-shop-section {
    padding: 32px 0 80px;
}

/* --- Product Grid --- */
.fp-shop-section .products,
.fp-shop-section ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ============================================
   PRODUCT CARD — Premium Dark Theme
   ============================================ */
.fp-product-card {
    background: var(--fp-bg-elevated);
    border: 1px solid var(--fp-border-subtle);
    border-radius: var(--fp-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.fp-product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--fp-radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.4s ease;
    z-index: 1;
}

.fp-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(88, 204, 2, 0.15),
        0 0 60px -10px rgba(88, 204, 2, 0.1);
}

.fp-product-card:hover::before {
    background: linear-gradient(135deg, rgba(88, 204, 2, 0.4), rgba(28, 176, 246, 0.3), rgba(206, 130, 255, 0.2));
}

/* --- Product Image --- */
.fp-product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.fp-product-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.fp-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.32, 0.72, 0, 1), filter 0.4s ease;
}

.fp-product-card:hover .fp-product-image img {
    transform: scale(1.08);
    filter: brightness(0.85);
}

/* Image Overlay */
.fp-product-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 40%,
        rgba(10, 16, 20, 0.7) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.fp-product-card:hover .fp-product-image-overlay {
    opacity: 1;
}

.fp-product-quickview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--fp-radius-full);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    transform: translateY(16px);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), background 0.3s ease;
}

.fp-product-card:hover .fp-product-quickview {
    transform: translateY(0);
}

.fp-product-quickview:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Sale Badge */
.fp-product-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    left: auto;
    width: auto;
    max-width: fit-content;
    background: linear-gradient(135deg, var(--fp-red) 0%, #FF6B6B 100%);
    color: #fff;
    border-radius: var(--fp-radius-full);
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 800;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(255, 75, 75, 0.35);
    letter-spacing: 0.3px;
    animation: fp-badge-pulse 2s ease-in-out infinite;
}

@keyframes fp-badge-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(255, 75, 75, 0.35); }
    50% { box-shadow: 0 4px 20px rgba(255, 75, 75, 0.55); }
}

.fp-product-badge i {
    font-size: 0.7rem;
}

/* --- Product Body --- */
.fp-product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 20px 0;
}

/* Meta Row: Category + Rating */
.fp-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.fp-product-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--fp-secondary);
    background: rgba(28, 176, 246, 0.1);
    padding: 4px 12px;
    border-radius: var(--fp-radius-full);
    letter-spacing: 0.2px;
    transition: background 0.3s ease;
}

.fp-product-category i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.fp-product-card:hover .fp-product-category {
    background: rgba(28, 176, 246, 0.18);
}

.fp-product-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fp-accent);
}

.fp-product-rating i {
    font-size: 0.7rem;
    color: var(--fp-accent);
}

/* Title */
.fp-product-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fp-product-title a {
    color: var(--fp-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.fp-product-card:hover .fp-product-title a {
    color: var(--fp-primary-light);
}

/* Excerpt */
.fp-product-excerpt {
    font-size: 0.85rem;
    color: var(--fp-text-muted);
    line-height: 1.6;
    margin: 0 0 auto;
    padding-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Product Footer (Price + Cart) --- */
.fp-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--fp-border-subtle);
    background: rgba(0, 0, 0, 0.15);
    margin: 0 -20px;
    margin-top: auto;
}

/* Price */
.fp-product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fp-price-current {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--fp-primary);
    line-height: 1.2;
}

.fp-price-current .woocommerce-Price-currencySymbol {
    font-size: 0.8em;
    margin-right: 2px;
}

.fp-price-old {
    font-size: 0.8rem;
    color: var(--fp-text-muted);
    text-decoration: line-through;
    font-weight: 500;
    opacity: 0.7;
}

.fp-price-old .woocommerce-Price-currencySymbol {
    font-size: 0.85em;
}

/* Add to Cart Button */
.fp-product-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--fp-primary) 0%, var(--fp-primary-light) 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: var(--fp-radius-full);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    top: 0;
    box-shadow: 0 4px 0 var(--fp-primary-dark);
    transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fp-product-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.fp-product-cart-btn:hover {
    top: 2px;
    box-shadow: 0 2px 0 var(--fp-primary-dark);
    color: #fff;
}

.fp-product-cart-btn:hover::before {
    left: 100%;
}

.fp-product-cart-btn:active {
    top: 4px;
    box-shadow: none;
}

.fp-product-cart-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.fp-product-cart-btn:hover i {
    transform: scale(1.15);
}

/* "View Cart" link after AJAX add */
.fp-product-card .added_to_cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--fp-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--fp-secondary);
    border-radius: var(--fp-radius-full);
    transition: all 0.2s ease;
    margin-top: 6px;
}

.fp-product-card .added_to_cart:hover {
    background: var(--fp-secondary);
    color: #fff;
}

/* ============================================
   WC Ordering / Result Count
   ============================================ */
.fp-shop-section .woocommerce-result-count,
.fp-shop-section .woocommerce-ordering {
    margin-bottom: 20px;
    color: var(--fp-text-secondary);
    font-size: 0.875rem;
}

.fp-shop-section .woocommerce-ordering select {
    background: var(--fp-bg-elevated);
    color: var(--fp-text-primary);
    border: 2px solid var(--fp-border-subtle);
    border-radius: var(--fp-radius-md);
    padding: 10px 14px;
    font-family: var(--fp-font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.fp-shop-section .woocommerce-ordering select:focus {
    border-color: var(--fp-secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.15);
}

/* ============================================
   Pagination
   ============================================ */
.fp-shop-section nav.woocommerce-pagination {
    margin-top: 48px;
    text-align: center;
}

.fp-shop-section nav.woocommerce-pagination ul {
    display: inline-flex;
    list-style: none;
    gap: 8px;
    padding: 0;
}

.fp-shop-section nav.woocommerce-pagination ul li a,
.fp-shop-section nav.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--fp-radius-md);
    background: var(--fp-bg-elevated);
    border: 2px solid var(--fp-border-subtle);
    color: var(--fp-text-secondary);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
}

.fp-shop-section nav.woocommerce-pagination ul li a:hover {
    border-color: var(--fp-primary);
    color: var(--fp-primary);
    background: rgba(88, 204, 2, 0.08);
}

.fp-shop-section nav.woocommerce-pagination ul li span.current {
    background: var(--fp-primary);
    color: #fff;
    border-color: var(--fp-primary);
    box-shadow: 0 3px 0 var(--fp-primary-dark);
}

/* ============================================
   No Products Found
   ============================================ */
.fp-shop-section .woocommerce-info {
    background: var(--fp-bg-elevated);
    border: 1px solid var(--fp-border-subtle);
    border-radius: var(--fp-radius-lg);
    padding: 48px;
    text-align: center;
    color: var(--fp-text-secondary);
    font-size: 1.1rem;
}

/* ============================================
   On-Sale Badge on WC li.product (fallback)
   ============================================ */
.fp-shop-section .products li.product .onsale {
    display: none; /* We use our custom badge instead */
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .fp-shop-section .products,
    .fp-shop-section ul.products {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 22px;
    }
}

@media (max-width: 768px) {
    .fp-page-header-shop {
        padding: 36px 0 30px;
    }

    .fp-page-header-shop .fp-page-title {
        font-size: 1.7rem;
    }

    .fp-filter-bar-categories {
        padding: 12px 14px;
        gap: 10px;
    }

    .fp-shop-section .products,
    .fp-shop-section ul.products {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }
    
    .fp-product-body {
        padding: 16px 16px 0;
    }
    
    .fp-product-footer {
        padding: 14px 16px;
        margin: 0 -16px;
    }
    
    .fp-product-title {
        font-size: 1rem;
    }

    .fp-product-cart-btn .fp-cart-btn-text {
        display: none;
    }
    
    .fp-product-cart-btn {
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .fp-shop-section .products,
    .fp-shop-section ul.products {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .fp-product-image {
        aspect-ratio: 16/9;
    }
    
    .fp-product-cart-btn .fp-cart-btn-text {
        display: inline;
    }
    
    .fp-product-cart-btn {
        padding: 10px 20px;
    }

    .fp-product-footer {
        flex-direction: row;
        align-items: center;
    }
}

/* ============================================
   ENTRANCE ANIMATION
   ============================================ */
@keyframes fp-card-enter {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fp-shop-section .products li.product {
    animation: fp-card-enter 0.5s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.fp-shop-section .products li.product:nth-child(1) { animation-delay: 0.05s; }
.fp-shop-section .products li.product:nth-child(2) { animation-delay: 0.1s; }
.fp-shop-section .products li.product:nth-child(3) { animation-delay: 0.15s; }
.fp-shop-section .products li.product:nth-child(4) { animation-delay: 0.2s; }
.fp-shop-section .products li.product:nth-child(5) { animation-delay: 0.25s; }
.fp-shop-section .products li.product:nth-child(6) { animation-delay: 0.3s; }
.fp-shop-section .products li.product:nth-child(7) { animation-delay: 0.35s; }
.fp-shop-section .products li.product:nth-child(8) { animation-delay: 0.4s; }
.fp-shop-section .products li.product:nth-child(9) { animation-delay: 0.45s; }

/* Remove any WooCommerce default white backgrounds */
.fp-shop-section .products li.product {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}