/* ========================================
   BASE
========================================= */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #FCF8F1;
    color: #443f75;
}

main {
    max-width: 1300px;
    margin: 2rem auto 3rem;
    padding: 0 1.5rem;
}

/* ==== RESET GLOBAL === */
.layout-narrow {
    max-width: 700px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
}

/* ==== MOBILE ≤ 700px ==== */
@media (max-width: 700px) {
    .layout-narrow {
        max-width: 100% !important;
        padding: 0 !important;
    }
}


/* ========================================
   HEADER
========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.3rem 0.8rem;
    border-bottom: 1px solid rgba(68,63,117,0.15);
    background: #FCF8F1;
    box-sizing: border-box;
}

footer {
    border-top: 1px solid rgba(68,63,117,0.15);
}

footer .donate-mobile {
    margin-bottom: 0.8rem; /* ou 1rem selon ton goût */
    background: #443f75 !important;
    color: white !important;
    border: none !important;
}


.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.header-left img {
    height: 110px;
    width: auto;
}

.header-center h1 {
    margin: 0;
    font-size: 1.9rem;
    color: #443f75;
}

.header-center p {
    margin: 0;
    font-size: .95rem;
    opacity: .85;
    color: #443f75;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .35rem;
    flex-shrink: 0;
}

/* ========================================
   BUTTONS
========================================= */

.btn,
.member-btn,
.cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .55rem 1.3rem;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    border: none;
}

.btn i,
.member-btn i,
.cart-btn i {
    margin-right: 6px;
}

.btn-primary {
    background: #ca6faa;
    color: white;
}

.btn-primary:hover {
    background: #b55b96;
}

.btn-secondary {
    background: transparent;
    color: #443f75;
    border: 1px solid rgba(68,63,117,.3);
}

.btn-danger-outline {
	padding: .15rem .45rem !important;
    font-size: .8rem !important;
    border-width: 1px;
    line-height: 1 !important;
    background: transparent;
    color: #b91c1c;
    border: 1px solid rgba(185,28,28,.4);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Bouton membre */
.member-btn {
    background: #ca6faa;
    color: white;
    font-weight: 600;
}

/* Bouton panier */
.cart-btn {
    padding: .5rem 1rem;
    border: 1px solid #443f75;
    color: #443f75;
    background: transparent;
    font-size: .85rem;
    gap: .35rem;
}

/* Cart count bubble */
.cart-count {
    background: #ca6faa;
    color: white;
    padding: 0 .45rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: bold;
}

/* Icônes dans les boutons → un peu plus grandes */
.btn i,
.member-btn i,
.cart-btn i {
    font-size: 1.3rem;
}

/* Icônes d’information dans meta / film-info */
.meta i,
.film-info i,
.small-text i {
    font-size: 1.1rem;
}

.btn,
.member-btn,
.cart-btn {
    font-size: 1rem; /* au lieu de ~0.9rem → texte plus grand */
}


/* ========================================
   CARDS / GRID
========================================= */

.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.grid-2 {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }

.grid-2 > .card {
	width: 100%;
	max-width: 650px;
	margin: 0 auto;
}

.card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(68,63,117,.25); /* ombre normale */
    border: 1px solid rgba(68,63,117,.08);
    transition: box-shadow .25s ease, outline .25s ease;
}

/* Hover 100% fixe : ne bouge pas */
.card:hover {
    box-shadow: 0 22px 55px rgba(68,63,117,.25); /* ombre plus forte */
    outline: 3px solid rgba(68,63,117,.12);      /* léger halo sans changer la taille */
}

/* Conteneur de contenu interne (panier / réservation) */
.card-body {
    padding: 1.2rem 1.4rem 1.4rem;
}

/* Poster (page liste) */
.poster {
    position: relative;
    padding-top: 56%;
    background: #e5d8c2;
}

.poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contenu des cards film */
.content {
    padding: 1rem 1.3rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.title {
    margin: 0 0 .5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.meta {
    font-size: .9rem;
    opacity: .9;
    margin-bottom: .5rem;
    font-weight: 500;
}

.film-info {
    font-size: .9rem;
    opacity: .85;
    margin-bottom: .8rem;
    font-weight: 500;
}

/* Description */
.description {
    font-size: .95rem;
    line-height: 1.45rem;
    margin-bottom: 0.1rem;
}

/* Trailer (film + réservation) */
.trailer {
    margin: 0.1rem 0;
    aspect-ratio: 16/9;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(68,63,117,.22);
}

.trailer iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Boutons film */
.btn-row {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .7rem;
}

/* Infos diverses */
.badge {
    font-size: .78rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: rgba(68,63,117,.06);
}

.small-text {
    font-size: .8rem;
}

/* ========================================
   TABLES / FORM
========================================= */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

th, td {
    padding: .45rem .3rem;
    text-align: left;
    border-bottom: 1px solid rgba(68,63,117,.08);
}

th {
    font-weight: 600;
    font-size: .85rem;
    background: #FCF8F1;
}

.qty-input {
    width: 70px;
    padding: .25rem .35rem;
    border-radius: 8px;
    border: 1px solid rgba(68,63,117,.3);
    font-size: .85rem;
    text-align: center;
}

.field {
    margin-bottom: .7rem;
}

.field label {
    display: block;
    font-size: .85rem;
    margin-bottom: .2rem;
}

.field input[type=text],
.field input[type=email] {
    width: 100%;
    padding: .35rem .5rem;
    border-radius: 10px;
    border: 1px solid rgba(68,63,117,.3);
    box-sizing: border-box;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    margin-top: .4rem;
}

.errors {
    margin-bottom: .8rem;
    color: #b91c1c;
    font-size: .85rem;
}

/* Réservation : actions */
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.info {
    font-size: .8rem;
    color: rgba(68,63,117,.8);
    margin-top: .4rem;
}

/* ========================================
   TOAST (notification ajout panier)
========================================= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #443f75;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   FOOTER
========================================= */
footer {
    text-align: center;
    font-size: .85rem;
    color: rgba(68,63,117,.7);
    padding: 2rem 1rem 2.5rem;
}
.donate-mobile {
    display: none;
}

.donate-mobile-wrapper {
    display: none;
}

/* Style du composant quantité mobile */
.qty-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f0ecff;
    color: #443f75;
    font-size: 1.6rem;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qty-mobile {
    width: 60px;
    text-align: center;
    padding: .4rem .2rem;
    font-size: 1.2rem;
    border-radius: 10px;
    border: 1px solid rgba(68,63,117,.3);
}
/* ====== QUANTITÉ ====== */
.qty-wrapper {
    display: flex;
    align-items: center;
    gap: .4rem;
    justify-content: center;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0ecff;
    color: #443f75;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qty-input-mobile {
    width: 40px;
    padding: .35rem;
    text-align: center;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid rgba(68,63,117,.3);
}

.qty-input {
    width: 100px !important;
    max-width: 40px !important;
    min-width: 35px !important;
    padding: .25rem .25rem !important;
    text-align: center !important;
    font-size: .85rem !important;
    border-radius: 8px;
}
/* ========================================
   MOBILE
========================================= */

/* Desktop : input normal, pas de boutons + / − */
@media (min-width: 701px) {
    .qty-btn {
        display: none;
    }
    .qty-input-mobile {
        font-size: .9rem;
		width: 90px !important;
        max-width: 100px !important;
    }
	.qty-input {
        width: 50px !important;
        max-width: 50px !important;
        font-size: 1rem !important;
    }
}

@media (min-width: 701px) {
    /* Desktop : revenir au champ classique */
    .qty-wrapper {
        justify-content: flex-start;
    }
    .qty-btn {
        display: none;
    }
    .qty-mobile {
        width: 70px;
        font-size: .9rem;
    }
}

/* ========================================
   MOBILE
========================================= */
@media (max-width: 700px) {
	 .toast {
        left: 50%;
        right: auto;              /* on enlève l'ancrage à droite */
        top: 20px;
        width: calc(100% - 40px); /* marge gauche/droite de 20px */
        max-width: 380px;
        transform: translate(-50%, -10px); /* centré horizontalement */
    }

    .toast.show {
        transform: translate(-50%, 0); /* animation verticale + centré */
    }
	.donate-mobile-wrapper {
        display: flex;
        justify-content: center;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
	
    .donate-mobile {
		display: flex;
        width: 90%;
        max-width: 380px;
        text-align: center;
    }
	
	.donate-desktop {
        display: none !important;
    }

    /* Cards index ET reserve → même largeur */
    .card {
        width: 100%;
        max-width: 500px;   /* plus large qu’avant */
        margin: 0 auto;     /* centrée */
    }

    /* La card de reserve.php devient cohérente */
    .card-reserve {
        width: 100%;
        max-width: 500px;   /* même largeur que les cards index */
        margin: 0 auto;
    }
	.grid {
		margin: 10px;
        grid-template-columns: 1fr; /* une seule colonne */
		padding: 0px;
        gap: 10px;/* espace autour des cards */
    }
	
	.grid-2 {
        display: block !important;      /* ✨ Corrige vraiment */
        width: 100%;
    }

    .grid-2 > .card {
        margin-bottom: 1.5rem;          /* espace entre les deux cards */
        width: 100%;
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
	
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
        gap: .4rem;
    }

    .header-left img {
        height: 70px;
    }

    .header-center {
        margin-bottom: 0.5rem;
    }

    .header-right {
        align-items: center;
        width: 100%;
        gap: .4rem;
    }

    /* Boutons plein largeur seulement pour header / footer */
    .member-btn,
	.btn,
    .cart-btn {
        width: 100%;
        white-space: normal; /* permet au texte de passer sur 2 lignes */
        box-sizing: border-box;
		font-size: 1.05rem;
    }


    .btn-row {
        flex-direction: column;
        gap: .6rem;
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .btn-row .btn-primary {
        width: 100%;
        max-width: 380px;
        margin: 0 auto; /* centré */
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

}

/* === MOBILE : marges réduites === */
@media (max-width: 700px) {

    /* Réduit la marge globale du wrapper */
    .layout-narrow {
        margin: 0.8rem auto 1.5rem !important;
        padding: 0 0.5rem !important;
    }

    /* Réduit l'espace entre les cards */
    .grid-2 > .card {
        margin-bottom: 0.8rem !important;
    }

    /* Réduit les marges internes des cards */
    .card-body {
        padding: 0.8rem 1rem !important;
    }

    /* Réduit les marges autour des titres */
    h2 {
        margin-top: 0.3rem !important;
        margin-bottom: 0.8rem !important;
    }

    /* Réduit la marge des sections de boutons */
    .btn-row,
    .actions {
        margin-top: 0.6rem !important;
    }

    /* Réduit l’espace entre le tableau et le total */
    table {
        margin-bottom: 0.6rem !important;
    }

    /* Réduit l’espace du footer */
    footer {
        padding: 1.2rem 1rem 1.4rem !important;
    }
}

/* Mobile : on enlève les limites et les marges latérales en plus */
@media (max-width: 700px) {
    main {
        padding: 0;  /* enlève le padding global qui réduit la largeur utile */
    }

    .layout-narrow {
        padding: 0;
        margin: 1rem 0 2rem;
    }

    .layout-narrow .card,
    .layout-narrow .grid-2 > .card {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}