/* =========================================================
   "+ Publier" (header) — automoto/partials/publish-menu.blade.php, assets/js/publish-menu.js
   Desktop / tablet (>= 768px): "+ Publier une annonce", first of the right actions + dropdown under it.
   Mobile (< 768px): compact "+" in the right actions + bottom sheet.
   Not a UIkit modal: no global .uk-modal-dialog scale, and it is closed before
   the real creation modal (UIkit, z-index 1010) opens.
========================================================= */

.amp-publish-btn,
.amp-publish-btn-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    color: #fff;
    background: #ee5721;
    font-family: inherit;
    cursor: pointer;
    transition: background-color .18s ease, box-shadow .18s ease;
}

.amp-publish-btn:hover,
.amp-publish-btn-mobile:hover,
.amp-publish-btn[aria-expanded="true"],
.amp-publish-btn-mobile[aria-expanded="true"] {
    background: #d9481a;
}

.amp-publish-btn:focus-visible,
.amp-publish-btn-mobile:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(238, 87, 33, .55);
}

.amp-publish-btn svg,
.amp-publish-btn-mobile svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* desktop / tablet button, first item of .amp-header-right (before support / notifications / avatar) */
.amp-publish-btn {
    gap: 7px;
    height: 40px; /* = .amp-icon-btn */
    margin-right: 4px;
    padding: 0 16px 0 13px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(238, 87, 33, .28);
}

.amp-publish-btn-mobile {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

@media (min-width: 1280px) {
    .amp-publish-btn {
        height: 44px; /* = .amp-icon-btn / .amp-avatar-btn */
        box-shadow: none;
    }
}

/* tablet: short label, the search keeps its width */
@media (max-width: 1023.98px) {
    .amp-publish-btn-more {
        display: none;
    }
}

@media (max-width: 767px) {
    .amp-publish-btn {
        display: none;
    }

    .amp-publish-btn-mobile {
        display: inline-flex;
    }
}

/* ---------- panel (dropdown on desktop, bottom sheet on mobile) ---------- */

.amp-publish-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: transparent;
}

.amp-publish-panel {
    position: fixed;
    z-index: 1001; /* above the header (100) and the sidebar (99), below UIkit modals (1010) */
    width: 344px;
    max-width: calc(100vw - 24px);
    padding: 14px 8px 8px;
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 35, 65, .16), 0 2px 6px rgba(15, 35, 65, .06);
    font-family: "Inter", sans-serif;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .14s ease, transform .14s ease;
}

.amp-publish-panel[hidden],
.amp-publish-backdrop[hidden] {
    display: none;
}

.amp-publish-panel.is-open {
    opacity: 1;
    transform: none;
}

.amp-publish-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px 10px;
}

.amp-publish-title {
    margin: 0;
    color: #011e40;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.amp-publish-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
}

.amp-publish-close svg {
    width: 18px;
    height: 18px;
}

.amp-publish-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.amp-publish-list li + li {
    border-top: 1px solid #eef2f7;
}

.amp-publish-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 62px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease;
}

.amp-publish-list li + li .amp-publish-item {
    margin-top: 1px;
}

.amp-publish-item:hover {
    background: #f6f8fb;
}

.amp-publish-item:focus-visible {
    outline: 2px solid #ee5721;
    outline-offset: -2px;
    background: #f6f8fb;
}

.amp-publish-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff3ed;
    color: #ee5721;
    font-size: 21px;
}

.amp-publish-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.amp-publish-text strong {
    color: #011e40;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
}

.amp-publish-text small {
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.35;
}

.amp-publish-chevron {
    width: 18px;
    height: 18px;
    color: #94a3b8;
    transition: transform .15s ease, color .15s ease;
}

.amp-publish-item:hover .amp-publish-chevron {
    color: #ee5721;
    transform: translateX(2px);
}

/* mobile: bottom sheet */
@media (max-width: 767px) {
    .amp-publish-backdrop {
        background: rgba(1, 30, 64, .45);
    }

    .amp-publish-panel {
        top: auto !important;
        left: 0 !important;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: 85vh;
        overflow-y: auto;
        padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
        border-radius: 20px 20px 0 0;
        border-bottom: 0;
        transform: translateY(24px);
        transition: opacity .18s ease, transform .2s ease;
    }

    .amp-publish-panel::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 10px;
        border-radius: 999px;
        background: #cbd5e1;
    }

    .amp-publish-head {
        padding: 0 4px 8px;
    }

    .amp-publish-title {
        font-size: 16px;
    }

    .amp-publish-close {
        display: inline-flex;
    }

    .amp-publish-item {
        min-height: 68px;
        padding: 12px 8px;
    }

    .amp-publish-text strong {
        font-size: 15px;
    }

    .amp-publish-text small {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .amp-publish-panel {
        transition: none;
    }
}
