/* =========================================================
   AGAPE SHOP
   CARTES PRODUITS
========================================================= */


/* =========================================================
   GRILLE
========================================================= */

.product-grid,
.products-grid {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(240px, 1fr)
        );

    gap: 20px;

}


/* =========================================================
   CARTE PRODUIT
========================================================= */

.product-card {

    position: relative;

    width: 100%;
    min-width: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 14px;

    box-shadow:
        0 2px 8px rgba(
            15,
            23,
            42,
            0.04
        );

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;

}


/* =========================================================
   HOVER CARTE
========================================================= */

.product-card:hover {

    transform: translateY(-5px);

    border-color: #dbe3ef;

    box-shadow:
        0 12px 28px rgba(
            15,
            23,
            42,
            0.12
        );

}


/* =========================================================
   IMAGE
========================================================= */

.product-card-image {

    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: #f8fafc;

    border-bottom: 1px solid #f1f5f9;

}


/* Lien image */

.product-card-image-link {

    width: 100%;
    height: 100%;

    display: block;

    text-decoration: none;

}


/* Image */

.product-card-image img {

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.45s
        cubic-bezier(
            0.4,
            0,
            0.2,
            1
        );

}


/* Zoom */

.product-card:hover
.product-card-image img {

    transform: scale(1.06);

}


/* =========================================================
   IMAGE ABSENTE
========================================================= */

.product-no-image {

    width: 100%;
    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 8px;

    background:
        linear-gradient(
            135deg,
            #f8fafc,
            #eef2f7
        );

    color: #94a3b8;

}

.product-no-image span {

    font-size: 2.5rem;

    opacity: 0.65;

}

.product-no-image small {

    font-size: 0.75rem;

    font-weight: 600;

}


/* =========================================================
   BADGES
========================================================= */

.product-badge {

    position: absolute;

    top: 12px;
    left: 12px;

    z-index: 5;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 26px;

    padding: 0 10px;

    border-radius: 20px;

    font-size: 0.68rem;

    font-weight: 800;

    letter-spacing: 0.02em;

    box-shadow:
        0 3px 8px rgba(
            15,
            23,
            42,
            0.12
        );

}


/* En stock */

.product-badge-stock {

    background: #ecfdf5;

    color: #047857;

    border: 1px solid #a7f3d0;

}


/* Stock faible */

.product-badge-warning {

    background: #fffbeb;

    color: #b45309;

    border: 1px solid #fde68a;

}


/* Rupture */

.product-badge-out {

    background: #fef2f2;

    color: #b91c1c;

    border: 1px solid #fecaca;

}


/* =========================================================
   CONTENU
========================================================= */

.product-card-content {

    min-height: 205px;

    padding: 17px;

    display: flex;

    flex-direction: column;

}


/* =========================================================
   NOM
========================================================= */

.product-card-title {

    display: -webkit-box;

    overflow: hidden;

    margin-bottom: 8px;

    color: #111827;

    font-size: 0.98rem;

    font-weight: 750;

    line-height: 1.4;

    text-decoration: none;



    -webkit-box-orient: vertical;

    transition: color 0.2s ease;

}

.product-card-title:hover {

    color: #2563eb;

}


/* =========================================================
   DESCRIPTION
========================================================= */

.product-card-description {

    display: -webkit-box;

    overflow: hidden;

    min-height: 38px;

    margin: 0;

    color: #64748b;

    font-size: 0.78rem;

    line-height: 1.55;


    -webkit-box-orient: vertical;

}

.product-description-empty {

    color: #94a3b8;

    font-style: italic;

}


/* =========================================================
   BAS DE CARTE
========================================================= */

.product-card-bottom {

    margin-top: auto;

    padding-top: 16px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    border-top: 1px solid #f1f5f9;

}


/* =========================================================
   PRIX
========================================================= */

.product-price {

    color: #111827;

    font-size: 1.15rem;

    font-weight: 850;

    line-height: 1;

    white-space: nowrap;

}

.product-price span {

    margin-left: 2px;

    font-size: 0.85rem;

    font-weight: 700;

}


/* =========================================================
   BOUTON VOIR
========================================================= */

.product-view-button {

    min-height: 36px;

    padding: 0 14px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #dbe3ef;

    border-radius: 8px;

    background: #ffffff;

    color: #2563eb;

    font-size: 0.75rem;

    font-weight: 750;

    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;

}

.product-view-button:hover {

    border-color: #2563eb;

    background: #2563eb;

    color: #ffffff;

    transform: translateY(-1px);

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .product-grid,
    .products-grid {

        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );

    }

}


@media (max-width: 800px) {

    .product-grid,
    .products-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 15px;

    }

}


@media (max-width: 500px) {

    .product-grid,
    .products-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;

    }

    .product-card {

        border-radius: 11px;

    }

    .product-card-content {

        min-height: 185px;

        padding: 12px;

    }

    .product-card-title {

        font-size: 0.85rem;

    }

    .product-card-description {

        font-size: 0.7rem;

    }

    .product-price {

        font-size: 0.98rem;

    }

    .product-view-button {

        min-height: 32px;

        padding: 0 9px;

        font-size: 0.68rem;

    }

    .product-badge {

        top: 8px;
        left: 8px;

        min-height: 23px;

        padding: 0 7px;

        font-size: 0.6rem;

    }

}

/* =========================================================
   ACTIONS CARTE PRODUIT
========================================================= */

.product-card-content {
    display: flex;
    flex-direction: column;
}


/* Prix */

.product-card-content .product-price {
    margin-top: 10px;
    margin-bottom: 15px;
}


/* Formulaire panier */

.product-card-cart-form {
    width: 100%;
}


/* Ligne quantité + panier */

.product-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}


/* =========================================================
   QUANTITÉ
========================================================= */

.product-card-quantity {
    display: flex;
    align-items: center;

    height: 42px;

    border: 1px solid #dbe2ea;
    border-radius: 8px;

    background: #ffffff;

    overflow: hidden;
}

.product-card-quantity button {
    width: 34px;
    height: 100%;

    border: 0;

    background: #f8fafc;

    color: #0f172a;

    font-size: 18px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s ease;
}

.product-card-quantity button:hover {
    background: #e2e8f0;
}

.product-card-quantity .quantity-input {
    width: 38px;
    height: 100%;

    padding: 0;

    border: 0;

    text-align: center;

    font-size: 14px;
    font-weight: 600;

    color: #0f172a;

    outline: none;

    appearance: textfield;
}

.product-card-quantity
.quantity-input::-webkit-inner-spin-button,
.product-card-quantity
.quantity-input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}


/* =========================================================
   AJOUTER AU PANIER
========================================================= */

.product-add-cart-button {
    flex: 1;

    min-width: 0;

    height: 42px;

    border: 0;
    border-radius: 8px;

    background: #0f3b66;

    color: #ffffff;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.product-add-cart-button:hover {
    background: #0b2d4d;

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(15, 59, 102, 0.20);
}

.product-add-cart-button:active {
    transform: translateY(0);
}

.product-add-cart-button.disabled {
    background: #cbd5e1;

    color: #64748b;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* =========================================================
   VOIR LE PRODUIT
========================================================= */

.product-card .product-view-button {
    display: flex;

    justify-content: center;
    align-items: center;

    width: 100%;

    min-height: 40px;

    margin-top: 9px;

    border: 1px solid #dbe2ea;
    border-radius: 8px;

    background: #ffffff;

    color: #0f3b66;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    transition: 0.2s ease;
}

.product-card .product-view-button:hover {
    border-color: #0f3b66;

    background: #f1f5f9;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 600px) {

    .product-card-actions {
        gap: 6px;
    }

    .product-card-quantity button {
        width: 30px;
    }

    .product-card-quantity .quantity-input {
        width: 32px;
    }

    .product-add-cart-button span {
        display: none;
    }

}