/* ==========================================================================
   MADRASSA — BOUTIQUE PUBLIQUE
   Fichier : public/assets/css/public-shop.css
   ========================================================================== */

.public-page-hero--shop {
    min-height: 460px;
    background:
        linear-gradient(
            90deg,
            rgba(6,47,34,.98),
            rgba(6,47,34,.84) 55%,
            rgba(6,47,34,.34)
        ),
        radial-gradient(circle at 82% 35%, rgba(214,164,59,.18), transparent 20rem),
        linear-gradient(145deg, #0a3b2b, #052d21);
}

/* Filters */
.shop-filter-section {
    padding-bottom: 2rem;
}

.shop-filter-shell {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 2rem;
    align-items: end;
}

.shop-filter-heading .public-section-title {
    font-size: clamp(2rem, 4vw, 3rem);
}

.shop-filter-heading .public-section-subtitle {
    margin-inline: 0;
}

.shop-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr) auto;
    gap: .8rem;
    align-items: end;
}

.shop-field .form-label {
    margin-bottom: .45rem;
    color: var(--public-green-950);
    font-size: .84rem;
    font-weight: 800;
}

.shop-field .form-control,
.shop-field .form-select {
    min-height: 50px;
    color: var(--public-text);
    background: #fffdf8;
    border: 1px solid rgba(9,59,43,.17);
    border-radius: 13px;
    box-shadow: none;
}

.shop-field .form-control:focus,
.shop-field .form-select:focus {
    background: #fff;
    border-color: var(--public-gold-500);
    box-shadow: 0 0 0 4px rgba(214,164,59,.13);
}

.shop-input-icon {
    position: relative;
}

.shop-input-icon > i {
    position: absolute;
    top: 50%;
    left: 1rem;
    z-index: 2;
    color: var(--public-gold-700);
    transform: translateY(-50%);
}

.shop-input-icon .form-control {
    padding-left: 2.8rem;
}

.shop-filter-actions {
    display: flex;
    gap: .65rem;
}

/* Grid */
.shop-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

.shop-product-card {
    display: flex;
    min-width: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.shop-product-card:hover {
    transform: translateY(-5px);
    border-color: rgba(168,108,12,.25);
    box-shadow: 0 18px 40px rgba(24,48,37,.12);
}

.shop-product-media {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(214,164,59,.10), transparent 15rem),
        linear-gradient(145deg, #f9f5e9, #f0ead9);
    border-bottom: 1px solid rgba(168,108,12,.14);
}

.shop-product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.shop-product-image {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: contain;
    padding: 1.15rem;
    transition: transform .3s ease;
}

.shop-product-card:hover .shop-product-image {
    transform: scale(1.035);
}

.shop-product-placeholder {
    display: grid;
    place-items: center;
    min-height: 230px;
    color: rgba(9,59,43,.28);
    font-size: 3rem;
}

.shop-stock-badge {
    position: absolute;
    top: .85rem;
    left: .85rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 34px;
    padding: .4rem .65rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.shop-stock-badge--success {
    color: #245d3d;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(44,122,75,.20);
}

.shop-stock-badge--danger {
    color: #8c332e;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(168,60,53,.20);
}

.shop-product-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem;
}

.shop-product-heading {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
}

.shop-product-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--public-gold-700);
    background: rgba(214,164,59,.12);
    border-radius: 12px;
}

.shop-product-title {
    margin: 0;
    color: var(--public-green-950);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-product-caption {
    display: block;
    margin-top: .2rem;
    color: var(--public-text-faint);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.shop-product-price {
    display: flex;
    align-items: flex-end;
    gap: .3rem;
    margin: 1.25rem 0;
    padding: .9rem 1rem;
    color: var(--public-green-950);
    background: rgba(214,164,59,.09);
    border: 1px solid rgba(168,108,12,.16);
    border-radius: 14px;
}

.shop-product-price span {
    color: var(--public-gold-700);
    font-size: 1.2rem;
    font-weight: 600;
}

.shop-product-price strong {
    font-family: "Outfit", sans-serif;
    font-size: 1.6rem;
    line-height: 1;
}

.shop-product-actions {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: .65rem;
    margin-top: auto;
}

.shop-product-actions .public-btn {
    width: 100%;
    min-width: 0;
    padding-inline: .75rem;
}

.shop-add-form {
    width: 100%;
}

.shop-product-disabled {
    color: #8c332e;
    background: rgba(168,60,53,.08);
    border: 1px solid rgba(168,60,53,.18);
    cursor: not-allowed;
    opacity: .72;
}

/* Pagination */
.shop-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.shop-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
    margin: 0;
}

.shop-pagination .page-link {
    display: grid;
    place-items: center;
    min-width: 42px;
    min-height: 42px;
    padding: .45rem .65rem;
    color: var(--public-green-800);
    background: #fffdf8;
    border: 1px solid var(--public-border);
    border-radius: 12px !important;
    box-shadow: none;
}

.shop-pagination .page-link:hover {
    color: #fffdf7;
    background: var(--public-green-800);
    border-color: var(--public-green-800);
}

.shop-pagination .page-item.active .page-link {
    color: #fffdf7;
    background: var(--public-gold-700);
    border-color: var(--public-gold-700);
}

.shop-pagination .page-item.disabled .page-link {
    color: var(--public-text-faint);
    background: rgba(244,239,221,.65);
    pointer-events: none;
}

/* Empty state */
.shop-empty-state {
    display: grid;
    place-items: center;
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
}

.shop-empty-state__icon {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 1rem;
    color: var(--public-gold-700);
    background: rgba(214,164,59,.12);
    border: 1px solid rgba(168,108,12,.18);
    border-radius: 22px;
    font-size: 1.8rem;
}

.shop-empty-state .public-section-subtitle {
    margin-bottom: 1.3rem;
}

/* SweetAlert */
.shop-swal-popup {
    border: 1px solid rgba(168,108,12,.18) !important;
    border-radius: 22px !important;
    box-shadow: 0 22px 70px rgba(24,48,37,.20) !important;
}

.shop-swal-confirm,
.shop-swal-cancel {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

/* RTL */
.rtl-page .shop-input-icon > i {
    right: 1rem;
    left: auto;
}

.rtl-page .shop-input-icon .form-control {
    padding-right: 2.8rem;
    padding-left: .9rem;
}

.rtl-page .shop-stock-badge {
    right: .85rem;
    left: auto;
}

/* Responsive */
@media (max-width: 1199.98px) {
    .shop-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .shop-filter-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .public-page-hero--shop {
        min-height: 410px;
    }

    .shop-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .shop-filter-actions {
        grid-column: 1 / -1;
    }

    .shop-filter-actions .public-btn {
        flex: 1 1 0;
    }
}

@media (max-width: 767.98px) {
    .shop-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-product-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .public-page-hero--shop {
        min-height: 370px;
    }

    .shop-filter-grid,
    .shop-product-grid {
        grid-template-columns: 1fr;
    }

    .shop-filter-actions {
        flex-direction: column;
    }

    .shop-product-media,
    .shop-product-image,
    .shop-product-placeholder {
        min-height: 210px;
        height: 210px;
    }
}


/* ==========================================================================
   CORRECTION CARTES PRODUITS — STRUCTURE VERTICALE
   ========================================================================== */

/*
 * public-card peut recevoir ailleurs un display:grid ou une structure
 * horizontale. La boutique impose ici une carte verticale complète.
 */
.public-shop-page .shop-product-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.public-shop-page .shop-product-card > .shop-product-media {
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 245px !important;
    min-height: 245px !important;
}

.public-shop-page .shop-product-image-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.public-shop-page .shop-product-image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem !important;
    object-fit: contain !important;
}

.public-shop-page .shop-product-placeholder {
    width: 100% !important;
    height: 245px !important;
    min-height: 245px !important;
}

.public-shop-page .shop-product-body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 1.15rem !important;
}

.public-shop-page .shop-product-heading {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    width: 100% !important;
}

.public-shop-page .shop-product-title {
    display: -webkit-box !important;
    min-height: 2.7em;
    overflow: hidden !important;
    line-height: 1.35 !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.public-shop-page .shop-product-price {
    width: 100% !important;
    margin: 1rem 0 !important;
}

.public-shop-page .shop-product-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .65rem !important;
    width: 100% !important;
    margin-top: auto !important;
}

.public-shop-page .shop-product-actions .public-btn,
.public-shop-page .shop-add-form,
.public-shop-page .shop-add-form .public-btn {
    width: 100% !important;
    min-width: 0 !important;
}

.public-shop-page .shop-product-actions .public-btn {
    min-height: 46px !important;
    padding: .7rem .85rem !important;
    border-radius: 12px !important;
    white-space: normal !important;
    line-height: 1.25 !important;
}

/*
 * Trois colonnes sur les écrans intermédiaires : les cartes disposent
 * d'assez de largeur pour les titres, le prix et les boutons.
 */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .public-shop-page .shop-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1600px) {
    .public-shop-page .shop-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1199.98px) {
    .public-shop-page .shop-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 991.98px) {
    .public-shop-page .shop-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 575.98px) {
    .public-shop-page .shop-product-grid {
        grid-template-columns: 1fr !important;
    }

    .public-shop-page .shop-product-card > .shop-product-media,
    .public-shop-page .shop-product-placeholder {
        height: 220px !important;
        min-height: 220px !important;
    }
}

/* ==========================================================
   HERO SHOP
   ========================================================== */

.public-page-hero--shop{
    position:relative;
    overflow:hidden;
}

.public-page-hero--shop .public-page-hero__content{
    position:relative;
    z-index:2;
}


@keyframes shopFloat{

    0%,100%{
        transform:translateY(0);
    }

    50%{
        transform:translateY(-10px);
    }

}


/* ==========================================================
   HERO BOUTIQUE
   ========================================================== */

.public-page-hero--shop {
    position: relative;
    min-height: 480px;
    padding: 0;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 18% 20%,
            rgba(214, 164, 59, 0.10),
            transparent 24rem
        ),
        #063f38;
}

.public-page-hero--shop .public-container {
    position: relative;
    z-index: 2;
    max-width: 1500px;
    min-height: inherit;
}

.public-shop-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(520px, 1.15fr);
    align-items: stretch;
    min-height: inherit;
}

/* Texte */

.public-page-hero--shop .public-page-hero__content {
    position: relative;
    z-index: 4;

    display: flex;
    flex-direction: column;
    justify-content: center;

    max-width: 620px;
    padding: clamp(3rem, 6vw, 6rem) 2rem clamp(3rem, 6vw, 6rem) 0;
}

/* Image */

.public-shop-hero-visual {
    position: relative;
    z-index: 1;

    display: flex !important;
    align-items: stretch;
    justify-content: flex-end;

    min-width: 0;
    min-height: 480px;

    visibility: visible !important;
    opacity: 1 !important;
}

/*
 * L’image reste réellement visible.
 * On évite notamment qu’une ancienne règle lui impose display:none.
 */
.public-shop-hero-visual__image {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    display: block !important;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
    object-position: center right;
    visibility: visible !important;
    opacity: 1 !important;
    filter: none;
}

/* Jonction progressive entre le vert et l’image */

.public-shop-hero-visual::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            #063f38 0%,
            rgba(6, 63, 56, 0.96) 5%,
            rgba(6, 63, 56, 0.76) 15%,
            rgba(6, 63, 56, 0.34) 27%,
            rgba(6, 63, 56, 0) 43%
        );
}

/* Écran intermédiaire */

@media (max-width: 1199.98px) {
    .public-shop-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(430px, 0.95fr);
    }

    .public-shop-hero-visual__image {
        width: calc(100% + 40px);
    }
}

/* Mobile et tablette */

@media (max-width: 991.98px) {
    .public-page-hero--shop {
        min-height: auto;
    }

    .public-shop-hero-grid {
        display: block;
        min-height: auto;
    }

    .public-page-hero--shop .public-page-hero__content {
        min-height: 430px;
        max-width: 680px;
        padding: 3rem 1rem;
    }

    .public-shop-hero-visual {
        position: absolute;
        z-index: 1;
        inset: 0;

        display: block !important;
        min-height: 100%;
    }

    .public-shop-hero-visual__image {
        inset: 0;

        width: 100%;
        height: 100%;

        object-position: 68% center;

        opacity: 0.34 !important;
    }

    .public-shop-hero-visual::after {
        background:
            linear-gradient(
                90deg,
                rgba(6, 63, 56, 0.98) 0%,
                rgba(6, 63, 56, 0.89) 55%,
                rgba(6, 63, 56, 0.58) 100%
            );
    }
}