/* ====================================
   Home & Products - Cartes produits et page d'accueil
   ==================================== */

/* Product Cards */
.product-card {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
    padding: 11px;
    margin: 0 0 16px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-strong);
    box-shadow: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
    border-color: rgba(33, 189, 208, 0.38);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.product-card__media {
    flex: 0 0 112px;
    max-width: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__media img {
    max-width: 100%;
    max-height: 112px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: none;
}

.product-card__body {
    flex: 1 1 260px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text-heading);
}

.product-card__title a {
    color: inherit;
    text-decoration: none;
}

.product-card__title a:hover {
    color: var(--primary-dark);
}

.product-card__badge--disabled {
    color: #c62828;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 6px;
}

.product-card__excerpt {
    color: var(--text-body);
    font-size: 0.86rem;
    line-height: 1.5;
}

.product-card__lot {
    display: inline-block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.product-card__actions {
    flex: 0 0 200px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    align-self: stretch;
}

.product-card__price-wrapper {
    align-self: flex-end;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card__price-wrapper .product-card__discount-tag {
    align-self: flex-end;
}

.product-card__link--inline {
    align-self: stretch;
}

.product-card__button-stack {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: auto;
}

.product-card__button-stack .product-card__link {
    width: 130px;
}

.product-card__button-stack .add_to_cart {
    width: 130px;
    justify-content: center;
    box-sizing: border-box;
    min-height: 30px;
}

.product-card .add_to_cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 26px 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    background-image: url('/images/cart.png');
    background-repeat: no-repeat;
    background-size: 14px 14px;
    background-position: right 9px center;
}

.product-card .add_to_cart:hover,
.product-card .add_to_cart:focus {
    background-image: url('/images/cart.png');
    background-repeat: no-repeat;
    background-size: 14px 14px;
    background-position: right 9px center;
}

.product-card .add_to_cart:hover {
    background-color: var(--primary-color);
    color: #0c2b3f;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(33, 189, 208, 0.28);
}

.product-card .add_to_cart:focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
}

.product-card .add_to_cart[name="indispo"],
.product-card .add_to_cart[value="Indispo"] {
    border-color: rgba(176, 188, 205, 0.8);
    color: rgba(137, 149, 171, 0.9);
    background-color: transparent;
    box-shadow: none;
    cursor: not-allowed;
    background-image: none;
}

.product-card .add_to_cart[name="indispo"]:hover,
.product-card .add_to_cart[value="Indispo"]:hover {
    transform: none;
    background-color: transparent;
    color: rgba(137, 149, 171, 0.9);
    box-shadow: none;
    background-image: none;
}

.product-card__price {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-heading);
}

.product-card__price--primary {
    color: var(--primary-dark);
}

.product-card__price--promo {
    color: #b72a2a;
}

.product-card__discount-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(33, 189, 208, 0.18);
    color: #0c2b3f;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.product-card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--primary-dark);
    background: transparent;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.74rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    min-height: 30px;
    width: 100%;
    box-sizing: border-box;
}

.product-card__link:hover {
    background: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(41, 84, 145, 0.24);
    text-decoration: none;
}

.product-card__link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Optimisation mobile pour les cartes produits */
@media (max-width: 720px) {
    .product-card {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        margin: 0 0 12px;
    }

    .product-card__media {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }

    .product-card__media img {
        max-height: 140px;
    }

    .product-card__body {
        flex: 1 1 auto;
        min-width: 100%;
        width: 100%;
    }

    .product-card__title {
        font-size: 0.95rem;
    }

    .product-card__excerpt {
        font-size: 0.82rem;
    }

    .product-card__actions {
        flex: 0 0 auto;
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .product-card__price-wrapper {
        align-self: center;
        text-align: left;
        order: -1;
        flex: 1;
    }

    .product-card__price {
        font-size: 1.05rem;
    }

    .product-card__button-stack {
        margin-top: 0;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        width: auto;
    }

    .product-card__button-stack .product-card__link {
        width: auto;
        padding: 6px 14px;
        white-space: nowrap;
    }

    .product-card__button-stack .add_to_cart {
        width: auto;
        padding: 6px 28px 6px 14px;
        white-space: nowrap;
    }
}

@media (max-width: 860px) {
    .product-card {
        flex-direction: column;
        align-items: stretch;
    }

    .product-card__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .product-card__cta .add_to_cart {
        width: 100%;
    }

    .product-card__media {
        margin: 0 auto;
    }
}

/* Home Sections */
.home-section {
    margin-bottom: 50px;
}

@media (max-width: 720px) {
    .home-section {
        margin-bottom: 30px;
    }
}

.home-section:last-of-type {
    margin-bottom: 0;
}

.home-heading {
    margin: 32px 0 18px;
    color: var(--text-heading);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

@media (max-width: 720px) {
    .home-heading {
        margin: 20px 0 12px;
        font-size: 1.2rem;
    }
}

.home-heading:first-of-type {
    margin-top: 0;
}

.home-heading--sub {
    font-size: 1.32rem;
    font-weight: 600;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px;
    margin-bottom: 44px;
}

@media (max-width: 767px) {
    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .home-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.home-grid:last-of-type {
    margin-bottom: 0;
}

.home-card {
    background: var(--surface-strong);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 11px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    box-shadow: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

@media (max-width: 767px) {
    .home-card {
        padding: 8px;
        gap: 6px;
        border-radius: 10px;
    }
}

.home-card:hover {
    transform: translateY(-1px);
    border-color: rgba(33, 189, 208, 0.38);
    box-shadow: var(--shadow-sm);
}

.home-card__media {
    display: block;
}

.home-card__media img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: none;
}

@media (max-width: 767px) {
    .home-card__media img {
        max-height: 80px;
        border-radius: 6px;
    }
}

.home-card__title {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text-heading);
}

@media (max-width: 767px) {
    .home-card__title {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

.home-card__title a {
    color: inherit;
    text-decoration: none;
}

.home-card__title a:hover {
    color: #295491;
}

.home-card__category {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(68, 81, 111, 0.92);
}

@media (max-width: 767px) {
    .home-card__category {
        font-size: 0.68rem;
    }
}

.home-card__category a {
    color: var(--primary-dark);
    font-style: italic;
    text-decoration: none;
    font-size: inherit;
}

.home-card__category a:hover {
    text-decoration: underline;
}

.home-card__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.home-card__pricing {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    align-self: flex-end;
    flex-direction: row-reverse;
}

.home-card__price {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-heading);
}

@media (max-width: 767px) {
    .home-card__price {
        font-size: 0.85rem;
    }
}

.home-card__price--primary {
    color: #295491;
}

.home-card__price--promo {
    color: #b72a2a;
}

.home-card__discount-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(33, 189, 208, 0.18);
    color: #0c2b3f;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .home-card__discount-tag {
        font-size: 0.65rem;
        padding: 2px 7px;
    }
}

.home-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media (max-width: 767px) {
    .home-card__cta {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
}

.home-card__cta:hover {
    background: var(--primary-color);
    color: #0c2b3f;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(33, 189, 208, 0.28);
    text-decoration: none;
}

.home-card__cta:focus-visible {
    outline: 2px solid #295491;
    outline-offset: 2px;
}

/* Home Activity */
.home-activity {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 44px;
}

.home-activity:last-of-type {
    margin-bottom: 0;
}

.home-activity__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    border: 1px solid rgba(41, 84, 145, 0.12);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(17, 39, 88, 0.05);
}

.home-activity__thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.home-activity__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-activity__content {
    flex: 1;
}

.home-activity__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2547;
}

.home-activity__title a {
    color: inherit;
    text-decoration: none;
}

.home-activity__title a:hover {
    color: #295491;
}

.home-activity__price {
    font-size: 0.85rem;
    color: #21bdd0;
    font-weight: 700;
}

/* Home Category */
.home-category {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 32px 0 0;
}

.home-category:last-of-type {
    margin-bottom: 0;
}

.home-category__card {
    display: flex;
    gap: 18px;
    align-items: stretch;
    width: 100%;
    height: 180px;
    box-sizing: border-box;
    border: 1px solid rgba(41, 84, 145, 0.12);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(18, 43, 97, 0.08);
    padding: 14px;
    overflow: hidden;
}

.home-category__media {
    display: block;
}

.home-category__card > a {
    flex: 0 0 140px;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.home-category__card > a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-category__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.home-category__body h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-category__body p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-body);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.home-category__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #295491 !important;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-end;
    margin-top: auto;
}

.home-category__link:hover {
    text-decoration: underline;
}
