/* =========================================================================
   FluentCart Product Share Module — Frontend CSS
   Driven by the module's CSS class: .fluent-cart-divi-product-share
   ========================================================================= */

.fluent-cart-divi-product-share {
    display: inline-block;
    position: relative;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* === Trigger button (14px icon, industry standard) === */
.fct-share__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: #101528;
    color: #fff;
    box-shadow: 0 4px 12px rgba(10, 14, 23, 0.18);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.fct-share__trigger:hover,
.fct-share__trigger:focus-visible {
    background: #243b78;
    transform: translateY(-1px);
    outline: none;
}

.fct-share__trigger:focus-visible {
    outline: 3px solid #f6b73c;
    outline-offset: 3px;
}

.fct-share__trigger svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* === Panel dropdown (18px icons) === */
.fct-share__panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    width: min(360px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid #d8deea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(10, 14, 23, 0.24);
    z-index: 100;
    color: #111827;
}

.fluent-cart-divi-product-share .fct-share__panel {
    top: calc(100% + 6px);
    bottom: auto;
}

.fct-share__panel[hidden] {
    display: none;
}

.fct-share__heading {
    display: block;
    margin: 0 0 4px;
    color: #101528;
    font-size: 15px;
}

.fct-share__intro {
    margin: 0 0 10px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
}

.fct-share__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

/* === Channel links === */
.fct-share__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 54px;
    padding: 8px 4px;
    border: 1px solid #d8deea;
    border-radius: 9px;
    background: #f8fafc;
    color: #15213f;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.fct-share__link:hover {
    border-color: #3157a4;
    background: #eef3ff;
    color: #172f68;
}

.fct-share__link svg {
    width: 18px;
    height: 18px;
}

.fct-share__link:focus-visible {
    outline: 3px solid #f6b73c;
    outline-offset: 3px;
}

/* === Status text === */
.fct-share__status {
    min-height: 16px;
    margin: 8px 0 0;
    color: #3157a4;
    font-size: 11px;
    font-weight: 700;
}

/* === QR code display === */
.fct-share__qr-display {
    margin-top: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #d8deea;
    border-radius: 10px;
    text-align: center;
}

.fct-share__qr-display[hidden] {
    display: none;
}

.fct-share__qr-display canvas {
    display: block;
    margin: 0 auto 8px;
}

.fct-share__qr-display p {
    margin: 0;
    font-size: 11px;
    color: #4b5563;
    font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
    letter-spacing: 0.04em;
}

/* === Responsive === */
@media (max-width: 480px) {
    .fct-share__panel {
        width: min(320px, calc(100vw - 24px));
        left: -12px;
    }

    .fct-share__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    .fct-share__trigger,
    .fct-share__link {
        transition: none;
    }
}
