/* ===== 3D PRODUCT CARD (Mouse-Tracking) ===== */
.product-card-3d {
    perspective: 800px;
}

.product-card-3d .product-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: rgba(196, 167, 125, 0) 30px 40px 20px -30px,
                rgba(0, 0, 0, 0.06) 0px 8px 15px -5px;
}

/* Fast transition while tracking mouse */
.product-card-3d.is-hovered .product-card {
    transition: transform 0.08s ease-out,
                box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Shadow change on hover (CSS fallback if JS not loaded) */
.product-card-3d:hover .product-card {
    box-shadow: rgba(196, 167, 125, 0.35) 20px 30px 20px -25px,
                rgba(0, 0, 0, 0.1) 0px 15px 25px -5px;
}

/* Glass overlay — light reflection follows cursor */
.product-card-3d .product-card-glass {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 50%,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(196, 167, 125, 0.15) 35%,
        transparent 65%
    );
    transform: translate3d(0, 0, 25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    z-index: 10;
}

.product-card-3d:hover .product-card-glass {
    opacity: 1;
}

/* Info section lifts in 3D */
.product-card-3d .product-card-info {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.product-card-3d:hover .product-card-info {
    transform: translate3d(0, 0, 26px);
}

/* Add-to-cart button pops out more */
.product-card-3d .product-card-action {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0.1s;
}

.product-card-3d:hover .product-card-action {
    transform: translate3d(0, 0, 15px);
}

.product-card-3d:hover .product-card-action a,
.product-card-3d:hover .product-card-action button:not(:disabled) {
    box-shadow: rgba(196, 167, 125, 0.4) 0px 8px 15px -5px;
}

/* Disable 3D on touch/mobile and reduced motion */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
    .product-card-3d {
        perspective: none;
    }
    .product-card-3d .product-card {
        transform: none !important;
    }
    .product-card-3d:hover .product-card {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
    .product-card-3d:hover .product-card-glass {
        opacity: 0;
    }
    .product-card-3d:hover .product-card-info,
    .product-card-3d:hover .product-card-action {
        transform: none;
    }
    .product-card-3d:hover .product-card-action a,
    .product-card-3d:hover .product-card-action button:not(:disabled) {
        box-shadow: none;
    }
}

/* ===== ARTICLE CARD — Animated Gradient Border ===== */
@keyframes articleBorderGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.article-card-wrap {
    position: relative;
    border-radius: 1rem;
    padding: 2px;
    background: transparent;
    transition: background 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* On hover — animated gradient border + lift + shadow */
.article-card-wrap:hover {
    background: linear-gradient(270deg, var(--color-primary, #C4A77D), #B76E79, #E8B4B8, var(--color-primary-light, #D4C4A8), var(--color-primary, #C4A77D));
    background-size: 600% 600%;
    animation: articleBorderGradient 4s ease infinite;
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(196, 167, 125, 0.25);
}

/* Glow div — not needed, hidden */
.article-card-wrap .article-card-glow {
    display: none;
}

/* The card itself */
.article-card-wrap .article-card {
    position: relative;
    background: var(--color-surface, #fff);
    border-radius: calc(1rem - 2px);
    overflow: hidden;
    height: 100%;
}

/* Image zoom on hover */
.article-card-wrap .article-card img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-card-wrap:hover .article-card img {
    transform: scale(1.06);
}

/* Image gradient overlay on hover */
.article-card-wrap .article-card-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.08) 40%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.article-card-wrap:hover .article-card-img-overlay {
    opacity: 1;
}

/* Hover metadata on image (category + date) — staggered */
.article-card-wrap .article-card-hover-meta {
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease 0.05s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
}

.article-card-wrap:hover .article-card-hover-meta {
    opacity: 1;
    transform: translateY(0);
}

/* Title color transition on hover */
.article-card-wrap .article-card h3 a {
    transition: color 0.3s ease;
}

.article-card-wrap:hover .article-card h3 a {
    color: var(--color-primary-hover, #92722e);
}

/* Read more arrow — slides in with stagger delay */
.article-card-wrap .article-card-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease 0.12s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.12s, gap 0.2s ease;
}

[dir="rtl"] .article-card-wrap .article-card-arrow {
    transform: translateX(10px);
}

.article-card-wrap:hover .article-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.article-card-wrap .article-card-arrow:hover {
    gap: 0.6rem;
}

/* Disable animations on reduced motion */
@media (prefers-reduced-motion: reduce) {
    .article-card-wrap:hover {
        animation: none;
    }
    .article-card-wrap .article-card img {
        transition: none;
    }
}
