/*
 * Catalogues Heyzine — section de la page /offers (module autonome, v1.0.0).
 * Chargé par master.blade.php, indépendant du bundle Vue (public/js/app.js).
 * Toutes les règles sont limitées à #dlk-catalogues et #dlk-catalogues-viewer.
 * Jetons repris du thème : --primary, --client-font (définis par css/app.css).
 */

#dlk-catalogues,
#dlk-catalogues-viewer {
    --dlk-primary: var(--primary, 242 62 20);
    --dlk-slate: var(--primary-slate, 255 244 241);
    --dlk-light: var(--primary-light, 255 237 244);
    --dlk-heading: #1F1F39;
    --dlk-text: #6E7191;
    --dlk-line: #EFF0F6;
    --dlk-soft: #F7F7FC;
    --dlk-whatsapp: #25D366;
    --dlk-radius: 16px;
    font-family: var(--client-font, "Urbanist", sans-serif);
    color: var(--dlk-heading);
    line-height: 1.5;
}

#dlk-catalogues *,
#dlk-catalogues-viewer * {
    box-sizing: border-box;
}

#dlk-catalogues [hidden],
#dlk-catalogues-viewer [hidden] {
    display: none !important;
}

#dlk-catalogues {
    margin-bottom: 40px;
}

@media (min-width: 640px) {
    #dlk-catalogues {
        margin-bottom: 80px;
    }
}

/* Titre de section */
#dlk-catalogues .dlk-cat-head {
    margin-bottom: 24px;
}

#dlk-catalogues .dlk-cat-head h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .02em;
}

#dlk-catalogues .dlk-cat-head p {
    margin: 4px 0 0;
    color: var(--dlk-text);
    font-size: 15px;
}

@media (max-width: 639px) {
    #dlk-catalogues .dlk-cat-head h2 {
        font-size: 20px;
    }
}

/* Catalogue mis en avant */
#dlk-catalogues .dlk-cat-featured {
    display: grid;
    grid-template-columns: minmax(220px, 340px) 1fr;
    gap: 32px;
    align-items: center;
    padding: 28px;
    border-radius: 24px;
    background: rgb(var(--dlk-slate));
}

@media (max-width: 767px) {
    #dlk-catalogues .dlk-cat-featured {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 18px;
    }
}

#dlk-catalogues .dlk-cat-cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1400 / 1980;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--dlk-radius);
    background: #fff;
    box-shadow: 0 12px 30px rgba(31, 31, 57, .12);
    cursor: pointer;
}

#dlk-catalogues .dlk-cat-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

#dlk-catalogues .dlk-cat-cover:hover img {
    transform: scale(1.03);
}

#dlk-catalogues .dlk-cat-cover:focus-visible {
    outline: 3px solid rgb(var(--dlk-primary));
    outline-offset: 3px;
}

#dlk-catalogues .dlk-cat-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(31, 31, 57, .75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

#dlk-catalogues .dlk-cat-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#dlk-catalogues .dlk-cat-label {
    color: rgb(var(--dlk-primary));
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#dlk-catalogues .dlk-cat-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgb(var(--dlk-primary));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
}

#dlk-catalogues .dlk-cat-title {
    margin: 0 0 8px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
}

@media (max-width: 639px) {
    #dlk-catalogues .dlk-cat-title {
        font-size: 26px;
    }
}

#dlk-catalogues .dlk-cat-date {
    margin: 0 0 24px;
    color: var(--dlk-text);
    font-size: 15px;
    font-weight: 500;
}

#dlk-catalogues .dlk-cat-actions,
#dlk-catalogues .dlk-cat-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#dlk-catalogues .dlk-cat-hint {
    margin: 14px 0 0;
    color: var(--dlk-text);
    font-size: 13px;
}

/* Boutons */
#dlk-catalogues .dlk-cat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: filter .2s, transform .1s;
}

#dlk-catalogues .dlk-cat-btn:active {
    transform: translateY(1px);
}

#dlk-catalogues .dlk-cat-btn:focus-visible {
    outline: 3px solid rgb(var(--dlk-primary) / .35);
    outline-offset: 2px;
}

#dlk-catalogues .dlk-cat-btn svg {
    flex: none;
    width: 20px;
    height: 20px;
}

#dlk-catalogues .dlk-cat-btn-primary {
    background: rgb(var(--dlk-primary));
    color: #fff;
    box-shadow: 0 8px 15px rgba(242, 62, 20, .18);
}

#dlk-catalogues .dlk-cat-btn-primary:hover,
#dlk-catalogues .dlk-cat-btn-whatsapp:hover {
    filter: brightness(.94);
}

#dlk-catalogues .dlk-cat-btn-outline {
    border: 1px solid var(--dlk-line);
    background: #fff;
    color: var(--dlk-heading);
}

#dlk-catalogues .dlk-cat-btn-outline:hover {
    border-color: rgb(var(--dlk-primary) / .5);
    color: rgb(var(--dlk-primary));
}

#dlk-catalogues .dlk-cat-btn-whatsapp {
    background: var(--dlk-whatsapp);
    color: #fff;
}

#dlk-catalogues .dlk-cat-btn-sm {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
}

@media (max-width: 479px) {
    #dlk-catalogues .dlk-cat-actions .dlk-cat-btn {
        flex: 1 1 100%;
    }
}

/* Historique */
#dlk-catalogues .dlk-cat-history {
    margin-top: 48px;
}

#dlk-catalogues .dlk-cat-history h3 {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
}

#dlk-catalogues .dlk-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 1023px) {
    #dlk-catalogues .dlk-cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    #dlk-catalogues .dlk-cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

#dlk-catalogues .dlk-cat-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dlk-line);
    border-radius: var(--dlk-radius);
    background: #fff;
    transition: box-shadow .2s;
}

#dlk-catalogues .dlk-cat-card:hover {
    box-shadow: 0 10px 24px rgba(31, 31, 57, .08);
}

#dlk-catalogues .dlk-cat-card .dlk-cat-cover {
    border-radius: 0;
    box-shadow: none;
}

#dlk-catalogues .dlk-cat-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
}

#dlk-catalogues .dlk-cat-card-body h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

#dlk-catalogues .dlk-cat-card-body .dlk-cat-date {
    margin-bottom: 10px;
    font-size: 13px;
}

#dlk-catalogues .dlk-cat-card-actions {
    gap: 8px;
    margin-top: auto;
}

#dlk-catalogues .dlk-cat-card-actions .dlk-cat-btn {
    flex: 1;
}

#dlk-catalogues .dlk-cat-more {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

#dlk-catalogues .dlk-cat-empty,
#dlk-catalogues .dlk-cat-error {
    padding: 28px;
    border: 1px dashed var(--dlk-line);
    border-radius: var(--dlk-radius);
    background: var(--dlk-soft);
    color: var(--dlk-text);
    text-align: center;
}

#dlk-catalogues .dlk-cat-error {
    border-color: rgb(var(--dlk-primary) / .3);
    background: rgb(var(--dlk-light));
}

/* Chargement */
#dlk-catalogues .dlk-cat-skeleton {
    border-radius: 12px;
    background: linear-gradient(90deg, #f2f2f7 25%, #e9e9f0 37%, #f2f2f7 63%);
    background-size: 400% 100%;
    animation: dlk-cat-shimmer 1.4s ease infinite;
}

@keyframes dlk-cat-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
    #dlk-catalogues .dlk-cat-skeleton { animation: none; }
    #dlk-catalogues .dlk-cat-cover img { transition: none; }
}

/* Visionneuse (ajoutée dans <body>, hors de l'application Vue) */
#dlk-catalogues-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 17, 35, .72);
}

#dlk-catalogues-viewer .dlk-cat-viewer-box {
    display: flex;
    flex-direction: column;
    width: min(1200px, 100%);
    height: min(92vh, 1000px);
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}

#dlk-catalogues-viewer .dlk-cat-viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--dlk-line);
}

#dlk-catalogues-viewer .dlk-cat-viewer-head h5 {
    margin: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#dlk-catalogues-viewer .dlk-cat-viewer-tools {
    display: flex;
    flex: none;
    gap: 8px;
}

#dlk-catalogues-viewer .dlk-cat-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--dlk-line);
    border-radius: 999px;
    background: #fff;
    color: var(--dlk-heading);
    cursor: pointer;
}

#dlk-catalogues-viewer .dlk-cat-icon-btn:hover {
    border-color: rgb(var(--dlk-primary));
    color: rgb(var(--dlk-primary));
}

#dlk-catalogues-viewer .dlk-cat-icon-btn svg {
    width: 20px;
    height: 20px;
}

#dlk-catalogues-viewer .dlk-cat-icon-btn.dlk-cat-wa {
    color: var(--dlk-whatsapp);
}

#dlk-catalogues-viewer iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: var(--dlk-soft);
}

@media (max-width: 767px) {
    #dlk-catalogues-viewer {
        padding: 0;
    }

    #dlk-catalogues-viewer .dlk-cat-viewer-box {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
