/* ==========================================================
   PRODUCT CARDS & SCROLL – Animated Glass Cards
   ========================================================== */

/* ─── Product Grid ─── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 260px);
    gap: 1.5rem;
    padding: 2rem;
    justify-content: start;
}

/* ─── Product Card ─── */
.product-card {
    background: #2d3b50;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    min-height: 270px;
    width: 260px;
    text-decoration: none;
    color: inherit;
    position: relative;
    animation: fadeInUp 0.5s ease both;
}

/* Gradient border glow on hover */
.product-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(37, 99, 235, 0.3),
        rgba(74, 222, 128, 0.2),
        rgba(37, 99, 235, 0.1)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 1;
    pointer-events: none;
}

/* Inner glow effect on hover */
.product-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.04), transparent);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
    z-index: 1;
}

.product-card:hover {
    transform: translateY(2px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

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

.product-card:hover::after {
    opacity: 1;
}

.product-card:focus-visible {
    outline: 2px solid #0071e3;
    outline-offset: 3px;
}

/* Stagger cards in scroll */
.product-scroll .product-card:nth-child(1) { animation-delay: 0.05s; }
.product-scroll .product-card:nth-child(2) { animation-delay: 0.1s; }
.product-scroll .product-card:nth-child(3) { animation-delay: 0.15s; }
.product-scroll .product-card:nth-child(4) { animation-delay: 0.2s; }
.product-scroll .product-card:nth-child(5) { animation-delay: 0.25s; }
.product-scroll .product-card:nth-child(6) { animation-delay: 0.3s; }
.product-scroll .product-card:nth-child(7) { animation-delay: 0.35s; }
.product-scroll .product-card:nth-child(8) { animation-delay: 0.4s; }

/* ─── Card Image ─── */
.product-card img {
    width: 100%;
    height: 175px;
    object-fit: contain;
    object-position: center;
    display: block;
    flex: 0 0 auto;
    background: #ffffff;
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: transform var(--transition-smooth);
    position: relative;
    z-index: 2;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* ─── Card Content ─── */
.product-card__content {
    padding: 1rem 1.25rem 1.15rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0.35rem;
    position: relative;
    z-index: 2;
}

.product-card__content h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    transition: color var(--transition-normal);
}

.product-card:hover .product-card__content h3 {
    color: var(--text-invert);
}

.product-card__content p {
    font-size: 0.8rem;
    color: #ffffff;
    margin-bottom: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    word-break: break-word;
    line-height: 1.5;
}

.product-card__content .price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0071e3;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ─── Product Sections ─── */
.product-section {
    padding: 2rem 0 0.5rem;
    animation: fadeInUp 0.5s ease both;
}

.product-section h2 {
    margin-left: 2rem;
    margin-bottom: 1.25rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #d8d8ee;
    position: relative;
    padding-left: 1rem;
    display: inline-block;
}

/* Animated accent line */
.product-section h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
    border-radius: var(--radius-full);
    animation: lineGrow 0.6s ease 0.3s forwards;
}

@keyframes lineGrow {
    to { height: 80%; }
}

/* Subtle glow behind section title */
.product-section h2::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0.3;
}

/* ─── Horizontal Scroll ─── */
.product-scroll {
    display: flex;
    gap: 1.25rem;
    padding: 0.5rem 2rem 2.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Fade edges on scroll */
    mask-image: linear-gradient(90deg, transparent, black 2rem, black calc(100% - 2rem), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 2rem, black calc(100% - 2rem), transparent);
}

.product-scroll .product-card {
    flex: 0 0 270px;
    scroll-snap-align: start;
}

.product-scroll::-webkit-scrollbar {
    display: none;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, 160px);
        gap: 0.8rem;
        padding: 1rem;
    }

    .product-section {
        padding: 1.25rem 0 0.25rem;
    }

    .product-section h2 {
        margin-left: 1rem;
        font-size: 1.1rem;
    }

    .product-scroll {
        padding: 0.5rem 1rem 1.5rem;
        gap: 0.8rem;
        mask-image: linear-gradient(90deg, transparent, black 1rem, black calc(100% - 1rem), transparent);
        -webkit-mask-image: linear-gradient(90deg, transparent, black 1rem, black calc(100% - 1rem), transparent);
    }

    .product-scroll .product-card {
        flex: 0 0 200px;
        min-height: 230px;
    }

    .product-card img {
        height: 130px;
        padding: 10px;
    }

    .product-card__content {
        padding: 0.75rem 0.9rem 0.85rem;
        gap: 0.25rem;
    }

    .product-card__content h3 {
        font-size: 0.82rem;
    }

    .product-card__content p {
        font-size: 0.72rem;
        -webkit-line-clamp: 2;
    }

    .product-card__content .price {
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        padding: 0.75rem;
    }

    .product-scroll .product-card {
        flex: 0 0 170px;
        min-height: 210px;
    }

    .product-card img {
        height: 110px;
        padding: 8px;
    }

    .product-card__content {
        padding: 0.6rem 0.7rem 0.7rem;
    }

    .product-card__content h3 {
        font-size: 0.78rem;
        -webkit-line-clamp: 1;
    }

    .product-card__content p {
        display: none;
    }
}

/* ==========================================================
   WISHLIST – Vertical List Layout
   ========================================================== */
.wishlist-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 2rem 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.wishlist-card.product-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 100%;

    /* Höhe wieder flacher machen */
    height: 110px;
    min-height: 110px;

    /* Zieht die Elemente im Inneren auf die exakt selbe Höhe! */
    align-items: stretch;

    /* Verhindert, dass Ecken überstehen */
    overflow: hidden;
}

.wishlist-card.product-card img {
    width: 160px;
    flex: 0 0 160px;

    /* Das Bild-Abteil nimmt immer 100% der Karten-Höhe ein */
    height: 100%;
    max-height: 100%;

    /* 'contain' sorgt dafür, dass das Apple-Produkt komplett sichtbar bleibt */
    object-fit: contain;

    /* Das ganze linke Abteil wird einheitlich weiß ausgefüllt */
    background-color: #ffffff;

    /* Innenabstand, damit das Bild nicht am Rand klebt */
    padding: 1rem;

    border-bottom: none;
    border-right: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);

    /* Nimmt die eigene Hintergrundfarbe für den Hover-Effekt aus dem Weg */
    transition: transform var(--transition-smooth);
}

.wishlist-card.product-card .product-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Zentriert den Text perfekt in der Mitte */
    padding: 0.5rem 1.5rem;
    flex: 1;
}

.wishlist-card.product-card:hover {
    transform: translateX(6px) scale(1.01);
}

/* Bild-Zoom beim Hovern */
.wishlist-card.product-card:hover img {
    transform: scale(1.08);
}

/* Stagger animation for wishlist items */
.wishlist-grid .wishlist-card:nth-child(1) { animation-delay: 0.05s; }
.wishlist-grid .wishlist-card:nth-child(2) { animation-delay: 0.1s; }
.wishlist-grid .wishlist-card:nth-child(3) { animation-delay: 0.15s; }
.wishlist-grid .wishlist-card:nth-child(4) { animation-delay: 0.2s; }
.wishlist-grid .wishlist-card:nth-child(5) { animation-delay: 0.25s; }
.wishlist-grid .wishlist-card:nth-child(6) { animation-delay: 0.3s; }
.wishlist-grid .wishlist-card:nth-child(7) { animation-delay: 0.35s; }
.wishlist-grid .wishlist-card:nth-child(8) { animation-delay: 0.4s; }

@media (max-width: 768px) {
    .wishlist-grid {
        padding: 0.5rem 1rem 1.5rem;
        gap: 0.8rem;
    }

    .wishlist-card.product-card {
        height: 100px;
    }

    .wishlist-card.product-card img {
        width: 110px;
        flex: 0 0 110px;
        padding: 10px;
    }

    .wishlist-card.product-card .product-card__content {
        padding: 0.75rem 1rem;
    }

    .wishlist-card .product-card__content h3 {
        font-size: 0.85rem;
    }

    .wishlist-card .product-card__content p {
        font-size: 0.72rem;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .wishlist-card.product-card {
        height: 90px;
    }

    .wishlist-card.product-card img {
        width: 90px;
        flex: 0 0 90px;
        padding: 8px;
    }

    .wishlist-card.product-card .product-card__content {
        padding: 0.5rem 0.75rem;
    }

    .wishlist-card .product-card__content h3 {
        font-size: 0.78rem;
        -webkit-line-clamp: 1;
    }

    .wishlist-card .product-card__content p {
        display: none;
    }
}

