/*
 * شاپور — لایهٔ home.css
 * بخش‌های صفحهٔ اصلی
 * منبع: فاز ۲ مهاجرت از style.css مرجع (خطوط 598-1338)
 * ترتیب بارگذاری لایه‌ها = ترتیب کسکید اصلی؛ هرگز ترتیب را تغییر ندهید.
 */

/* ============================================
   BRANDS
   ============================================ */
.brands { padding: 80px 0; background: var(--bg-primary); }

.brands-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-radius: 20px;
    padding: 36px 28px 28px;
    border: 1px solid rgba(30, 58, 95, 0.1);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.brand-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.brand-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 50px rgba(23, 43, 77, 0.16), 0 0 30px rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.25);
}

.brand-card:hover::before { opacity: 1; }

.brand-card .brand-icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-card:hover .brand-icon {
    transform: scale(1.15) rotate(-4deg);
}

.brand-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    padding: 10px 22px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.brand-card:hover .brand-cta {
    background: var(--accent-green);
    color: #ffffff;
    border-color: var(--accent-green);
}

.brand-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(37, 99, 235, 0.15);
    color: var(--accent-green);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.brand-featured { border-color: rgba(37, 99, 235, 0.15); }
.brand-icon { font-size: 3rem; margin-bottom: 16px; }
.brand-name { font-size: 1.4rem; color: var(--text-primary); margin-bottom: 8px; }
.brand-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.brand-desc { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.8; }

/* ============================================
   PRODUCTS (front-page slider)
   ============================================ */
.products { padding: 80px 0; background: var(--bg-secondary); overflow: hidden; }

.product-filters {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}.product-filter-btn.active {
    border-color: var(--accent-green);
    background: rgba(37, 99, 235, 0.15);
    color: var(--accent-green);
}

.products-swiper-wrapper { position: relative; padding: 10px 0 30px; }
.products-swiper { width: 100%; }
.products-swiper .swiper-slide { height: auto; }

/* Product card — premium v1.9 unified design
   Used by: home products swiper + related products + (visual twin of shop-card)
   Has: brand chip, sale chip, out-of-stock chip, hover "view" overlay, star rating,
        add-to-cart + WhatsApp action row. */
/* ============================================
   PRODUCT CARD — v2.0 PREMIUM REDESIGN
   Layered glass card with animated spotlight,
   gradient ribbon, glow ring on hover.
   ============================================ */
.product-card {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 35%),
        linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(30, 58, 95, 0.11);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.45s ease,
                border-color 0.45s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
}

/* Animated top accent ribbon — runs the full width of the card top */
.product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-green) 30%,
        var(--accent-emerald) 50%,
        var(--accent-green) 70%,
        transparent 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    z-index: 4;
    transition: background-position 0.8s ease;
    opacity: 0.55;
}

/* Radial spotlight that follows hover — sits above background, below content */
.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%),
                rgba(37, 99, 235, 0.16), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(37, 99, 235, 0.18),
        0 0 36px rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.32);
}
.product-card:hover::before {
    background-position: 0 0;
    opacity: 1;
}
.product-card:hover::after {
    opacity: 1;
}

/* Media section (image + tags + hover overlay) */
.product-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background:
        radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.12), transparent 55%),
        radial-gradient(circle at 75% 80%, rgba(29, 78, 216, 0.06), transparent 50%),
        linear-gradient(180deg, var(--bg-secondary), var(--bg-card));
    overflow: hidden;
    z-index: 1;
}

/* Subtle dotted texture on the media background */
.product-card-media::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(30, 58, 95, 0.07) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
    opacity: 0.6;
}

.product-card-img-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 26px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.product-card:hover .product-image {
    transform: scale(1.1) rotate(-2deg);
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 20px rgba(37, 99, 235, 0.18));
}

.product-card-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(10, 10, 10, 0.88);
    color: var(--accent-green);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.74rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(37, 99, 235, 0.35);
    box-shadow: 0 4px 14px rgba(23, 43, 77, 0.12);
    z-index: 3;
    letter-spacing: 0.3px;
}

.product-card-sale {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255,255,255,0.25);
    z-index: 3;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    animation: salePulse 2.2s ease-in-out infinite;
}

@keyframes salePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.product-card-stock-out {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 15, 0.9);
    color: #dc2626;
    padding: 12px 26px;
    border-radius: 50px;
    font-size: 0.92rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.45);
    box-shadow: 0 8px 24px rgba(23, 43, 77, 0.12);
    z-index: 4;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.product-card-quick {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translate(-50%, 12px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(101, 163, 13, 0.98));
    color: #ffffff;
    padding: 9px 22px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
    z-index: 3;
    white-space: nowrap;
}

.product-card:hover .product-card-quick {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Info section */
.product-info {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 11px;
    position: relative;
    z-index: 1;
}

.product-brand {
    display: inline-block;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0.06));
    color: var(--accent-green);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 700;
    width: fit-content;
    border: 1px solid rgba(37, 99, 235, 0.22);
    letter-spacing: 0.2px;
}

.product-name {
    font-size: 1.04rem;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
    margin: 0;
    transition: color 0.25s ease;
}

.product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.product-name a:hover { color: var(--accent-green); }

/* Star rating — premium look */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.product-rating .stars {
    display: inline-flex;
    gap: 1px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.product-rating .star { color: rgba(255, 255, 255, 0.18); }
.product-rating .star.full { color: #fbbf24; }
.product-rating .star.half {
    background: linear-gradient(90deg, #fbbf24 50%, rgba(255,255,255,0.18) 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fbbf24;
}
.product-rating .rating-count {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.product-price {
    font-size: 1.26rem;
    font-weight: 800;
    color: var(--accent-green);
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    text-shadow: 0 0 24px rgba(37, 99, 235, 0.2);
}

.product-price del {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-left: 0;
    font-weight: 400;
    text-decoration: line-through;
    order: 2;
}

.product-price ins { text-decoration: none; order: 1; }

/* Unified product card action row — matches the shop-card look.
   Used by home swiper cards + related products cards. */
.product-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed rgba(30, 58, 95, 0.1);
}

.product-card-btn-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--accent-green), #1d4ed8);
    color: #ffffff;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255,255,255,0.22);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.product-card-btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}
.product-card-btn-primary:hover::after { left: 100%; }
.product-card-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.45);
    color: #ffffff;
    filter: brightness(1.08);
}
.product-card-btn-primary:active { transform: translateY(0); }
.product-card-btn-primary.disabled,
.product-card-btn-primary.disabled:hover {
    background: rgba(30, 58, 95, 0.09);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.product-card-btn-wa {
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 211, 102, 0.06);
    color: #25d366;
    border: 1px solid rgba(37, 211, 102, 0.32);
    border-radius: 12px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card-btn-wa:hover {
    background: rgba(37, 211, 102, 0.16);
    border-color: #25d366;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.25);
}

.product-card-btn { margin-top: 12px; }

/* Swiper navigation */
.products-swiper-prev,
.products-swiper-next {
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid rgba(30, 58, 95, 0.12);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}
.products-swiper-prev:hover, .products-swiper-next:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}
.products-swiper-prev:after, .products-swiper-next:after { font-size: 1.2rem; font-weight: 700; }
.products-swiper-prev { left: -24px; }
.products-swiper-next { right: -24px; }

.products-swiper-pagination { margin-top: 20px; }
.products-swiper-pagination .swiper-pagination-bullet { background: rgba(255, 255, 255, 0.2); opacity: 1; width: 10px; height: 10px; margin: 0 6px; }
.products-swiper-pagination .swiper-pagination-bullet-active { background: var(--accent-green); }

.products-cta { text-align: center; margin-top: 40px; }

/* ============================================
   WOOCOMMERCE DEFAULT LOOP — v2.1.0
   Style the WooCommerce loop containers (ul.products,
   .related.products, .upsells, .cross-sells) so the
   .product-card design renders correctly INSIDE the
   default WooCommerce markup — not just in our custom
   shop / single / front-page templates.
   ============================================ */
ul.products,
.related.products ul,
.upsells ul,
.cross-sells ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Cross-sells heading + section on cart page */
.cross-sells {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(23, 43, 77, 0.09);
}
.cross-sells > h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
    position: relative;
}
.cross-sells > h2::before {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-green);
    border-radius: 2px;
}
/* Cross-sells product cards inherit .product-card design */
.cross-sells ul li.product,
.cross-sells ul li.product-card-loop-item {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 40%),
        var(--bg-card);
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 18px;
    padding: 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
    list-style: none;
}
.cross-sells ul li.product:hover,
.cross-sells ul li.product-card-loop-item:hover {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 8px 24px rgba(23, 43, 77, 0.12);
    transform: translateY(-3px);
}
.cross-sells ul li.product img,
.cross-sells ul li.product-card-loop-item img {
    border-radius: 12px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
    padding: 10px;
}
.cross-sells .woocommerce-loop-product__title,
.cross-sells ul li.product h2,
.cross-sells ul li.product-card-loop-item h3 {
    font-size: 0.95rem !important;
    color: var(--text-primary);
    font-weight: 700;
    margin: 6px 0 8px !important;
    padding: 0 !important;
    line-height: 1.4;
}
.cross-sells .woocommerce-loop-product__title a,
.cross-sells ul li.product h2 a {
    color: inherit;
    text-decoration: none;
}
.cross-sells .price,
.cross-sells ul li.product .price {
    color: var(--accent-green) !important;
    font-weight: 800;
    font-size: 1rem;
    display: block;
    margin-bottom: 10px;
}
.cross-sells .price del,
.cross-sells ul li.product .price del {
    color: var(--text-muted) !important;
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 6px;
    opacity: 0.7;
}
.cross-sells .price ins,
.cross-sells ul li.product .price ins {
    background: none;
    text-decoration: none;
    color: var(--accent-green);
}
.cross-sells .button,
.cross-sells ul li.product .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-emerald));
    color: #fff !important;
    border: none;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.cross-sells .button:hover,
.cross-sells ul li.product .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
    color: #fff !important;
}
.cross-sells .onsale {
    background: linear-gradient(135deg, #f97316, #ef4444) !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

ul.products li.product,
.related.products ul li.product,
.upsells ul li.product,
.cross-sells ul li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    float: none !important;
    list-style: none !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* The loop-item wrapper we add via content-product.php */
.product-card-loop-item {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
.product-card-loop-item > .product-card {
    width: 100%;
    flex: 1 1 auto;
}

/* Hide WooCommerce's default "Add to cart" button if it leaks through
   (we render our own CTA inside .product-card-actions). */
ul.products li.product .button,
ul.products li.product .added_to_cart {
    display: none !important;
}

/* Hide WooCommerce default star rating (we render our own) */
ul.products li.product .star-rating {
    display: none !important;
}

/* Hide the default "Sale!" badge (we render our own .product-card-sale) */
ul.products li.product .onsale {
    display: none !important;
}

/* Hide default WooCommerce price block (we render .product-price) */
ul.products li.product .price {
    display: none !important;
}

/* Hide default WooCommerce product title link (we render .product-name > a) */
ul.products li.product .woocommerce-loop-product__title {
    display: none !important;
}

/* Responsive grid columns */
@media (max-width: 1200px) {
    ul.products,
    .related.products ul,
    .upsells ul,
    .cross-sells ul { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    ul.products,
    .related.products ul,
    .upsells ul,
    .cross-sells ul { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 560px) {
    ul.products,
    .related.products ul,
    .upsells ul,
    .cross-sells ul { grid-template-columns: 1fr; }
}

