/**
 * BrikPanel - Cart Share (storefront) styles
 *
 * The "Share cart" button carries WooCommerce's own cart button classes
 * ("button", plus "wp-element-button" on block themes), so the theme paints it
 * like "Apply coupon": colours, size and hover. Nothing here sets its look; a
 * fixed white look of our own read as faint next to a theme's coloured buttons.
 * Only the share panel that opens from it keeps its own neutral style.
 */

/* Keep the [hidden] attribute authoritative over our own display rules
   (buttons/messages set display:inline-flex via their class). */
.brikpanel-cshare-overlay [hidden],
.brikpanel-cshare-wrap [hidden] {
    display: none !important;
}

.brikpanel-cshare-wrap {
    margin: 1rem 0;
    display: flex;
}

/* Zero weight: any theme rule for its buttons wins. */
:where(.brikpanel-cshare-btn) {
    cursor: pointer;
}

/* Icon + label row, on an inner box of our own so the display the theme gives
   the button (inline-block, block) cannot break it. The icon is 1em, so the row
   stays one line tall and the button keeps the theme's height. */
.brikpanel-cshare-btn__inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    vertical-align: top;
}
.brikpanel-cshare-btn__inner svg {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
}

/* The icons are drawn with fill/stroke attributes, which lose to any page CSS:
   a theme rule such as "button svg { fill: … }" would fill the outlines or blank
   them. Restate the drawing model on exactly the shapes that declare it, so the
   icons always follow the text colour. */
:is(.brikpanel-cshare-btn, .brikpanel-cshare-overlay) svg[fill="none"],
:is(.brikpanel-cshare-btn, .brikpanel-cshare-overlay) svg[fill="none"] *:not([fill]) {
    fill: none !important;
}
:is(.brikpanel-cshare-btn, .brikpanel-cshare-overlay) svg[fill="currentColor"],
:is(.brikpanel-cshare-btn, .brikpanel-cshare-overlay) svg[fill="currentColor"] *:not([fill]) {
    fill: currentColor !important;
}
:is(.brikpanel-cshare-btn, .brikpanel-cshare-overlay) svg[stroke="currentColor"],
:is(.brikpanel-cshare-btn, .brikpanel-cshare-overlay) svg[stroke="currentColor"] *:not([stroke]) {
    stroke: currentColor !important;
}

/* Overlay + panel */
.brikpanel-cshare-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.brikpanel-cshare-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
body.brikpanel-cshare-lock {
    overflow: hidden;
}

.brikpanel-cshare-panel {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(10px);
    transition: transform 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #303030;
}
.brikpanel-cshare-overlay.is-open .brikpanel-cshare-panel {
    transform: translateY(0);
}

.brikpanel-cshare-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #ececec;
}
.brikpanel-cshare-head h3 {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #303030;
}
.brikpanel-cshare-close {
    border: none;
    background: transparent;
    color: #8a8a8a;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 0;
    border-radius: 0.375rem;
}
.brikpanel-cshare-close:hover {
    background: #f2f2f2;
    color: #303030;
}

.brikpanel-cshare-body {
    padding: 1.25rem;
}
.brikpanel-cshare-desc {
    margin: 0 0 0.875rem;
    font-size: 0.85rem;
    color: #616161;
    line-height: 1.5;
}
.brikpanel-cshare-empty {
    margin: 0;
    font-size: 0.9rem;
    color: #616161;
    text-align: center;
    padding: 1rem 0;
}

.brikpanel-cshare-link-row {
    display: flex;
    gap: 0.5rem;
}
.brikpanel-cshare-input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.7rem;
    font-size: 0.8rem;
    color: #616161;
    border: 1px solid #d5d5d5;
    border-radius: 0.5rem;
    background: #f7f7f7;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.brikpanel-cshare-input:focus {
    outline: none;
    border-color: #303030;
}
.brikpanel-cshare-copy {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #303030;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.brikpanel-cshare-copy:hover {
    background: #1a1a1a;
}
.brikpanel-cshare-copy.is-copied {
    background: #1a8917;
}

.brikpanel-cshare-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.brikpanel-cshare-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #d5d5d5;
    background: #fff;
    color: #303030;
    font-family: inherit;
}
.brikpanel-cshare-action:hover {
    background: #f6f6f6;
}
.brikpanel-cshare-action.wa {
    color: #1c8a3f;
    border-color: #bfe3c9;
    background: #f2fbf5;
}
.brikpanel-cshare-action.wa:hover {
    background: #e6f7ec;
}

@media (max-width: 480px) {
    .brikpanel-cshare-link-row {
        flex-direction: column;
    }
    .brikpanel-cshare-copy {
        width: 100%;
    }
}
