/* ============================================================
   MUEL DASHBOARD NEGOZIO — overlay owner per layout .qf-shop-*
   Il template pubblico (cover, logo, tabs, hero, about, gallery,
   info) è renderizzato con le classi .qf-shop-* condivise con
   page-bottega.php (assets/css/bottega.css del tema).
   Qui ci sono SOLO gli stili che servono per:
   - i controlli editor (upload cover/logo, gallery +/×)
   - i campi inline contenteditable
   - rich text toolbar
   - settings tab (form impostazioni)
   - lightbox gallery
   - feedback salvataggio
   ============================================================ */

/* ----- File input nascosto ----- */
.muel-file-input { display: none; }

/* ----- Upload buttons (cover + avatar/logo) ----- */
.qf-shop .qf-shop-hero__cover { position: relative; }
.qf-shop .qf-shop-hero__logo { position: relative; }

.muel-upload-btn {
    position: absolute;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
    z-index: 5;
}
.muel-upload-btn:hover { background: rgba(0, 0, 0, 0.85); }

/* Cover: overlay sul lato destro/basso (cover non ha overflow hidden circolare) */
.qf-shop .muel-cover-btn {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
}
.qf-shop .muel-cover-remove-btn {
    bottom: 16px;
    right: 70px;
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(180, 30, 30, 0.7);
}
.qf-shop .muel-cover-remove-btn:hover { background: rgba(180, 30, 30, 0.95); }

/* Per owner: il logo deve permettere ai bottoni di sporgere sotto il cerchio.
   L'immagine resta circolare grazie al border-radius:50% sull'<img>. */
.qf-shop[data-owner="1"] .qf-shop-hero__logo { overflow: visible; }

/* Logo (circle): bottoni sempre visibili sul bordo inferiore, stessa grafica della cover */
.qf-shop .muel-avatar-btn,
.qf-shop .muel-avatar-remove-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    bottom: -8px;
    z-index: 3;
    opacity: 1;
    border: 0;
    transition: background 200ms ease;
}
.qf-shop .muel-avatar-btn {
    left: calc(100% - 60px);
    background: rgba(0, 0, 0, 0.55);
    bottom: 0px;
}
.qf-shop .muel-avatar-btn:hover { background: rgba(0, 0, 0, 0.85); }

.qf-shop .muel-avatar-remove-btn {
    left: calc(50% + 4px);
    background: rgba(180, 30, 30, 0.7);
}
.qf-shop .muel-avatar-remove-btn:hover { background: rgba(180, 30, 30, 0.95); }

/* ----- Inline editable text ----- */
.qf-shop .muel-editable[contenteditable="true"] {
    outline: none;
    transition: outline 150ms ease, background 150ms ease;
    cursor: text;
}
.qf-shop .muel-editable[contenteditable="true"]:hover {
    outline: 1px dashed rgba(92, 46, 38, 0.4);
    outline-offset: 4px;
    border-radius: 4px;
}
.qf-shop .muel-editable[contenteditable="true"]:focus {
    outline: 2px solid var(--qf-bottega-color, #5C2E26);
    outline-offset: 4px;
    background: #FFFFFF;
}
.qf-shop .muel-editable[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: rgba(0, 0, 0, 0.35);
    font-style: italic;
    pointer-events: none;
}

/* ----- Gallery × remove button (sovraimpresso a .qf-shop-about-gallery__item) ----- */
.qf-shop .qf-shop-about-gallery__item { position: relative; }
.qf-shop .muel-gallery-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 150ms ease;
}
.qf-shop .muel-gallery-remove:hover { background: rgba(0, 0, 0, 0.85); }

/* ----- Gallery + add button (occupa una cella della grid esistente) ----- */
.qf-shop .qf-shop-about-gallery__inner .muel-gallery-add {
    width: 100%;
    aspect-ratio: 390 / 392;
    border-radius: 20px;
    border: 2px dashed #C4B7AA;
    background: #FAF6F0;
    color: #5C2E26;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    font-weight: 300;
    transition: border-color 150ms ease, color 150ms ease;
    box-sizing: border-box;
}
.qf-shop .qf-shop-about-gallery__inner .muel-gallery-add:hover {
    border-color: var(--qf-bottega-color, #5C2E26);
    color: var(--qf-bottega-color, #5C2E26);
}
.qf-shop .qf-shop-about-gallery__inner .muel-gallery-add span {
    display: block;
    line-height: 1;
}

/* ----- Cursore zoom su immagini gallery (lightbox) ----- */
.qf-shop .qf-shop-about-gallery__item img { cursor: zoom-in; }

/* ----- Rich text toolbar (sopra il body chi-siamo) ----- */
.qf-shop .qf-shop-about__inner .muel-richtext-toolbar {
    display: flex;
    gap: 6px;
    margin: 8px 0 12px;
}
.qf-shop .muel-richtext-toolbar button {
    width: 32px;
    height: 32px;
    border: 1px solid #DDDDDD !important;
    border-radius: 4px !important;
    background: #FFFFFF !important;
    color: #12110F !important;
    cursor: pointer;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, border-color 150ms ease;
    padding: 0 !important;
}
.qf-shop .muel-richtext-toolbar button:hover {
    background: #F0ECE8 !important;
    border-color: var(--qf-bottega-color, #5C2E26) !important;
}
.qf-shop .muel-richtext-toolbar button b,
.qf-shop .muel-richtext-toolbar button i {
    color: #12110F !important;
    font-style: normal;
    font-weight: 700;
}
.qf-shop .muel-richtext-toolbar button i {
    font-style: italic;
    font-weight: 400;
}

/* ============================================================
   OWNER — Tab Prodotti (mprod): bottone "+ Nuovo prodotto"
   ============================================================ */
.qf-shop-catalog-head__inner--with-action {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px;
    flex-wrap: nowrap;
}
.qf-shop-catalog-head__inner--with-action .qf-shop-catalog-head__text {
    flex: 1 1 auto;
    min-width: 0;
}
.qf-shop-catalog-head__action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.qf-shop-catalog-head__action #mprod-new-product,
.qf-shop-catalog-head__action .mprod-btn-new {
    margin: 0 !important;
}
@media (max-width: 720px) {
    .qf-shop-catalog-head__inner--with-action {
        flex-wrap: wrap;
        align-items: flex-start !important;
    }
}
.qf-shop .qf-shop-products .mprod-dash-container {
    max-width: 1266px;
    margin: 0 auto;
    padding: 0 24px;
}
.qf-shop .qf-shop-products .mprod-dash-header {
    display: flex;
    justify-content: flex-end;
    margin: 24px 0 32px;
}
.qf-shop .qf-shop-products .mprod-btn-new,
.qf-shop .qf-shop-catalog-head__action .mprod-btn-new,
.qf-shop #mprod-new-product {
    padding: 14px 28px !important;
    background: var(--qf-bottega-color, #5C2E26) !important;
    color: #FFFFFF !important;
    border: 0 !important;
    border-radius: 49px !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    line-height: 24px !important;
    cursor: pointer;
    transition: opacity 150ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
.qf-shop .qf-shop-products .mprod-btn-new:hover,
.qf-shop .qf-shop-catalog-head__action .mprod-btn-new:hover,
.qf-shop #mprod-new-product:hover { opacity: 0.9; }

/* Padding sezione identico a /bottega/ */
.qf-shop .qf-shop-products {
    padding: 35px 0 40px !important;
}

/* Stessa griglia identica di /bottega/ */
.qf-shop .qf-shop-products .mprod-dash-container {
    max-width: var(--qf-max-width);
    margin: 0 auto;
    padding: 0 24px;
}
.qf-shop .qf-shop-products .mprod-dash-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
}
@media (max-width: 1100px) {
    .qf-shop .qf-shop-products .mprod-dash-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 804px) {
    .qf-shop .qf-shop-products .mprod-dash-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
    .qf-shop .qf-shop-products .mprod-dash-grid { grid-template-columns: 1fr !important; }
}
.qf-shop .qf-shop-products .mprod-empty {
    text-align: center;
    color: #999;
    padding: 60px 0;
}

/* ----- Product card override (mirror identico a .qf-product-card del tema) ----- */
.qf-shop .qf-shop-products .mprod-card {
    position: relative !important;
    background: #FFFFFF !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 250ms ease, box-shadow 250ms ease !important;
}
.qf-shop .qf-shop-products .mprod-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}
.qf-shop .qf-shop-products .mprod-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.qf-shop .qf-shop-products .mprod-card-img {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    padding-bottom: 0 !important;
    border-radius: 0 !important;
    background-color: #F5F5F5 !important;
    background-position: center !important;
    background-size: cover !important;
    overflow: hidden !important;
    position: relative;
}
.qf-shop .qf-shop-products .mprod-card-noimg {
    background: linear-gradient(135deg, #F0EBE5 0%, #E3D4C6 100%) !important;
}
.qf-shop .qf-shop-products .mprod-badge-sale {
    top: 16px !important; left: 16px !important;
    background: #CF2617 !important;
    color: #FFFFFF !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    line-height: 24px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.qf-shop .qf-shop-products .mprod-badge-draft {
    top: 16px !important; right: 16px !important;
    background: rgba(0, 0, 0, 0.55) !important;
    color: #FFFFFF !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
}

/* Body: spacing identico a .qf-product-card__body */
.qf-shop .qf-shop-products .mprod-card-body {
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    flex: 1 !important;
}
.qf-shop .qf-shop-products .mprod-card-link-text {
    display: block;
    text-decoration: none;
    color: inherit;
}
.qf-shop .qf-shop-products .mprod-card-name {
    font-family: "Inter", sans-serif !important;
    font-weight: 700 !important;
    font-size: 20px !important;
    line-height: 30px !important;
    color: var(--qf-bottega-color, #22286A) !important;
    margin: 0 0 10px !important;
}
.qf-shop .qf-shop-products .mprod-card-meta {
    font-family: "Inter", sans-serif !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    line-height: 24px !important;
    color: #12110F !important;
    margin: 0 0 20px !important;
}
.qf-shop .qf-shop-products .mprod-card-negozio {
    font-weight: 600 !important;
    color: #12110F !important;
}
.qf-shop .qf-shop-products .mprod-card-bottom {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    margin-top: auto !important;
    padding-top: 0 !important;
    border-top: 0 !important;
}
.qf-shop .qf-shop-products .mprod-card-price {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-width: 0;
    align-items: flex-start;
}
.qf-shop .qf-shop-products .mprod-price-old {
    font-family: "Inter", sans-serif !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    line-height: 24px !important;
    color: #616161 !important;
    text-decoration: line-through !important;
}
.qf-shop .qf-shop-products .mprod-price {
    font-family: "Inter", sans-serif !important;
    font-weight: 700 !important;
    font-size: 22px !important;
    line-height: 33px !important;
    color: var(--qf-bottega-color, #22286A) !important;
}

/* Bottone "Aggiungi": identico a .qf-product-card__btn */
.qf-shop .qf-shop-products .mprod-card-cart,
.qf-shop .qf-shop-products .mprod-card-cart:hover,
.qf-shop .qf-shop-products .mprod-card-cart:active,
.qf-shop .qf-shop-products .mprod-card-cart:focus,
.qf-shop .qf-shop-products .mprod-card-cart:focus-visible {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 11px 14px !important;
    border: 0 !important;
    border-radius: 100px !important;
    background: var(--qf-bottega-color, #22286A) !important;
    background-color: var(--qf-bottega-color, #22286A) !important;
    color: #FFFFFF !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 500 !important;
    font-size: 18px !important;
    line-height: 27px !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 150ms ease, transform 150ms ease !important;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.qf-shop .qf-shop-products .mprod-card-cart:hover { opacity: 0.9 !important; }
.qf-shop .qf-shop-products .mprod-card-cart:active { transform: scale(0.97); }
.qf-shop .qf-shop-products .mprod-card-cart svg {
    width: 24px !important;
    height: 24px !important;
    color: #FFFFFF !important;
    display: block !important;
}
.qf-shop .qf-shop-products .mprod-card-cart svg path {
    stroke: #FFFFFF !important;
}

/* Owner: niente bottone "Aggiungi al carrello" sui propri prodotti */
.qf-shop[data-owner="1"] .qf-shop-products .mprod-card-cart {
    display: none !important;
}
.qf-shop .qf-shop-products .mprod-dash-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
}
.qf-shop .qf-shop-products .mprod-page-btn {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: #606060;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms, color 150ms, border-color 150ms;
}
.qf-shop .qf-shop-products .mprod-page-btn.active {
    background: transparent;
    border: 2px solid var(--qf-bottega-color, #22286A);
    border-radius: 54px;
    color: var(--qf-bottega-color, #22286A);
}
.qf-shop .qf-shop-products .mprod-page-btn:hover:not(.active) {
    color: var(--qf-bottega-color, #22286A);
    background: rgba(34, 40, 106, 0.05);
}

/* ============================================================
   OWNER PANEL — Tab Ordini (override filtri color)
   ============================================================ */
.qf-shop .mprod-orders-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.qf-shop .mprod-order-filter {
    padding: 10px 22px !important;
    border: 1px solid #E3D4C6 !important;
    border-radius: 49px !important;
    background: #FFFFFF !important;
    color: #12110F !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 500 !important;
    font-size: 16px !important;
    line-height: 24px !important;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.qf-shop .mprod-order-filter:hover {
    background: color-mix(in srgb, var(--qf-bottega-color, #5C2E26) 8%, #FFFFFF) !important;
    border-color: var(--qf-bottega-color, #5C2E26) !important;
    color: var(--qf-bottega-color, #5C2E26) !important;
}
.qf-shop .mprod-order-filter.active,
.qf-shop .mprod-order-filter.active:hover {
    background: var(--qf-bottega-color, #5C2E26) !important;
    border-color: var(--qf-bottega-color, #5C2E26) !important;
    color: #FFFFFF !important;
}

/* ============================================================
   OWNER PANEL (Ordini + Impostazioni — wrapper centrato)
   ============================================================ */

.qf-shop-owner-panel {
    padding: 40px 0 60px;
    background: #FFFFFF;
}
.qf-shop-owner-panel__inner {
    max-width: 1266px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ----- Form impostazioni — pattern coerente con login modal del sito ----- */
.muel-settings-section {
    max-width: 720px;
    margin: 0 auto 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid #E3D4C6;
}
.muel-settings-section:last-of-type { border-bottom: none; }
.muel-settings-section h3 {
    font-family: "Inter", sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 33px !important;
    margin: 0 0 20px !important;
    color: #12110F !important;
}
.muel-settings-field { margin-bottom: 18px; }
.muel-settings-field label {
    display: block !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 500 !important;
    font-size: 18px !important;
    line-height: 27px !important;
    color: #12110F !important;
    margin-bottom: 10px !important;
}
.muel-settings-input,
input.muel-settings-input,
textarea.muel-settings-input {
    width: 100% !important;
    min-height: 47px !important;
    padding: 10px 16px !important;
    border: 1px solid #7F7F7F !important;
    border-radius: 10px !important;
    background: #F7F7F7 !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 400 !important;
    font-size: 18px !important;
    line-height: 27px !important;
    color: #12110F !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color 150ms ease, background-color 150ms ease !important;
    box-shadow: none !important;
}
.muel-settings-input::placeholder,
textarea.muel-settings-input::placeholder {
    color: #535353 !important;
    opacity: 1 !important;
}
.muel-settings-input:focus,
textarea.muel-settings-input:focus {
    border-color: var(--qf-bottega-color, #5C2E26) !important;
    background: #FFFFFF !important;
}
textarea.muel-settings-input {
    resize: vertical;
    min-height: 96px !important;
    padding: 14px 16px !important;
}

#muel-save-settings {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 auto !important;
    padding: 14px 36px !important;
    background: var(--qf-bottega-color, #5C2E26) !important;
    color: #FFFFFF !important;
    border: 0 !important;
    border-radius: 49px !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    line-height: 24px !important;
    cursor: pointer;
    transition: opacity 150ms ease, background 150ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
#muel-save-settings:hover { opacity: 0.9; }
#muel-save-settings:disabled { opacity: 0.55; cursor: wait; }
#muel-settings-success {
    display: block;
    max-width: 720px;
    margin: 12px auto 0;
    text-align: center;
    font-size: 14px;
    color: #27AE60;
    font-weight: 500;
    min-height: 20px;
}

/* Centra la riga del bottone Salva */
.qf-shop-owner-panel__inner {
    text-align: left;
}
.qf-shop-owner-panel__inner > #muel-save-settings {
    display: block !important;
    margin: 24px auto 0 !important;
}

/* ============================================================
   FEEDBACK INDICATOR (toast in basso a destra)
   ============================================================ */

.muel-save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #5C2E26;
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
    z-index: 9999;
}
.muel-save-indicator.show { opacity: 1; }

/* ============================================================
   LIGHTBOX (overlay click immagine gallery)
   ============================================================ */

.muel-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 250ms ease;
    cursor: zoom-out;
}
.muel-lightbox.show { opacity: 1; }
.muel-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
    user-select: none;
}
.muel-lb-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
}
.muel-lb-close:hover { background: rgba(255, 255, 255, 0.3); }
.muel-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
}
.muel-lb-nav:hover { background: rgba(255, 255, 255, 0.3); }
.muel-lb-prev { left: 16px; }
.muel-lb-next { right: 16px; }
.muel-lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}
