/* ==========================================================================
   Widget WooCommerce Categories — Bento Layout L1 / L2
   ========================================================================== */

.wc-cat-bento {
    width: 100%;
}

/* ── Bento grid : 2 colonnes en haut, 1 pleine largeur en bas ── */
.wc-cat-bento__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Card ── */
.wc-cat-bento__card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f3f3f3;
    display: flex;
}

.wc-cat-bento__card--half {
    min-height: 280px;
}

.wc-cat-bento__card--full {
    grid-column: 1 / -1;
    min-height: 230px;
}

/* ── Card link (covers entire card) ── */
.wc-cat-bento__card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── Background image ── */
.wc-cat-bento__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: transform 0.4s ease;
    pointer-events: none;
}

.wc-cat-bento__card:hover .wc-cat-bento__bg {
    transform: scale(1.03);
}

/* ── Content overlay ── */
.wc-cat-bento__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 28px 28px 130px;
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.wc-cat-bento__card--full .wc-cat-bento__content {
    width: 50%;
}

/* ── Title (L1) ── */
.wc-cat-bento__title {
    margin: 0 0 14px 0;
    font-size: 22px;
    font-weight: 900;
    color: #222;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

/* ── L2 items ── */
.wc-cat-bento__items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wc-cat-bento__card--full .wc-cat-bento__items {
    flex-direction: column;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.wc-cat-bento__item {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    padding: 1px 0;
    transition: color 0.15s ease;
    line-height: 1.4;
}

.wc-cat-bento__item .wc-cat-bento__item-arrow {
    width: 0;
    height: 14px;
    opacity: 0;
    flex-shrink: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
    overflow: hidden;
}

.wc-cat-bento__item .wc-cat-bento__item-arrow svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: currentColor;
}

.wc-cat-bento__item:hover .wc-cat-bento__item-arrow {
    width: 14px;
    margin-right: 4px;
    opacity: 1;
}

.wc-cat-bento__item:hover {
    color: #E3001A;
}

/* ── Arrow button with cutouts (bottom-right) ── */
.wc-cat-bento__arrow-wrapper {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    overflow: visible;
    z-index: 2;
}

/* Cutout arrondi inversé — à gauche du bouton */
.wc-cat-bento__cutout {
    position: absolute;
    bottom: 0;
    right: 60px;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 0% 0%, transparent 16px, #fff 16px);
    z-index: 3;
    transition: opacity 0.3s ease;
}

/* Cutout arrondi inversé — au-dessus du bouton */
.wc-cat-bento__cutout-top {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 0% 0%, transparent 16px, #fff 16px);
    z-index: 3;
    transition: opacity 0.3s ease;
}

.wc-cat-bento__card:hover .wc-cat-bento__cutout,
.wc-cat-bento__card:hover .wc-cat-bento__cutout-top {
    opacity: 0;
}

/* Fond blanc derrière le bouton rond */
.wc-cat-bento__arrow-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: #fff;
    border-top-left-radius: 16px;
    transition: opacity 0.3s ease;
}

.wc-cat-bento__card:hover .wc-cat-bento__arrow-wrapper::before {
    opacity: 0;
}

.wc-cat-bento__arrow-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #E3001A;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.wc-cat-bento__card:hover .wc-cat-bento__arrow-btn {
    width: 60px;
    height: 60px;
    border-radius: 0;
    border-top-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.wc-cat-bento__card:hover .wc-cat-bento__arrow-btn {
    border-bottom-right-radius: 4px !important;
}

.wc-cat-bento__arrow-btn svg {
    width: 20px;
    height: 20px;
}

/* ── CTA button ── */
.wc-cat-bento__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 14px 20px;
    width: 100%;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    color: #E3001A;
    background: #fff;
    border: 1.5px solid #E3001A;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.wc-cat-bento__cta:hover {
    background: #fef2f2;
}

.wc-cat-bento__cta:focus-visible {
    outline: 2px solid #E3001A;
    outline-offset: -2px;
}

.wc-cat-bento__arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.wc-cat-bento__cta:hover .wc-cat-bento__arrow {
    transform: translateX(3px);
}

/* ── Empty state ── */
.wc-cat-list--empty {
    padding: 1rem 1.25rem;
    background: #f5f5f5;
    border-radius: 4px;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.45;
    border: 1px dashed #d1d5db;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .wc-cat-bento__grid {
        grid-template-columns: 1fr;
    }

    .wc-cat-bento__card--full {
        grid-column: auto;
    }

    .wc-cat-bento__card--half,
    .wc-cat-bento__card--full {
        min-height: 200px;
    }

    .wc-cat-bento__bg {
        background-position-x: 25%;
    }

    .wc-cat-bento__content {
        max-width: 60%;
        padding: 20px;
    }

    .wc-cat-bento__card--full .wc-cat-bento__content {
        max-width: 60%;
    }

    .wc-cat-bento__card--full .wc-cat-bento__items {
        flex-direction: column;
    }

    .wc-cat-bento__title {
        font-size: 16px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .wc-cat-bento__bg,
    .wc-cat-bento__see-all,
    .wc-cat-bento__cta {
        transition: none !important;
    }
}