/*
 * Share Cart (share-cart-url-for-woo) button + popup, restyled to match the theme.
 *
 * The plugin prints its own colors, radii and sizes with !important (inline CSS
 * plus its stylesheet, with up to one id and four classes per selector), so these
 * rules use the same flag, and the popup rules double the id (#TB_window#TB_window)
 * to outrank all of them. The popup markup only arrives over AJAX, which is why
 * this file is safelisted from WP Rocket's Remove Unused CSS in lib/assets.php.
 *
 * Palette: orange #f37021 (hover #c25a1a), coal #25282a, gray #646464,
 * light gray #f1f1f1. Side cart buttons are 5px radius, uppercase Open Sans 600.
 */

/* ── Side cart / cart page button ─────────────────────────────── */

body #share-cart-url-button-container a,
body #save-share-cart-url-button-container a,
body #scuf_update_cart_button {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #f37021 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    color: #f37021 !important;
    display: inline-flex !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    gap: 8px !important;
    justify-content: center !important;
    letter-spacing: normal !important;
    line-height: 1.5 !important;
    min-height: 37px !important;
    padding: 6px 16px !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    transition: background-color .2s ease, color .2s ease !important;
}

body #share-cart-url-button-container a::before {
    background-color: currentColor;
    content: "";
    flex: 0 0 auto;
    height: 16px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 13.5 6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 13.5 6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E") center / contain no-repeat;
    width: 16px;
}

body #share-cart-url-button-container a:hover,
body #share-cart-url-button-container a:focus-visible,
body #save-share-cart-url-button-container a:hover,
body #save-share-cart-url-button-container a:focus-visible,
body #scuf_update_cart_button:hover,
body #scuf_update_cart_button:focus-visible {
    background: #f37021 !important;
    color: #fff !important;
}

/* In the side cart it joins the full-width button stack under "Clear Cart". */
#cfw-side-cart #share-cart-text {
    border-top: 1px solid #e5e5e5;
    color: #646464;
    font-size: 14px;
    line-height: 1.4;
    margin: 16px 0 8px;
    padding-top: 16px;
    text-align: center;
}

#cfw-side-cart #share-cart-url-button-container,
#cfw-side-cart #save-share-cart-url-button-container,
#cfw-side-cart #edit-share-cart-url-button-container {
    display: block;
    margin: 0 0 8px;
    width: 100%;
}

#cfw-side-cart #share-cart-url-button-container a,
#cfw-side-cart #save-share-cart-url-button-container a,
#cfw-side-cart #scuf_update_cart_button {
    display: flex !important;
    margin: 0 !important;
    width: 100% !important;
}

/* ── Popup window ─────────────────────────────────────────────── */

body:has(#TB_window .scuf-share-modal-v2) #TB_overlay {
    background-color: rgba(37, 40, 42, .65) !important;
    opacity: 1 !important;
}

#TB_window#TB_window:has(.scuf-share-modal-v2) {
    background: #fff !important;
    border: 0 !important;
    border-radius: 5px !important;
    box-shadow: 0 20px 50px rgba(37, 40, 42, .3) !important;
    /* media-upload.js (loaded on every non-front page) sizes ThickBox windows to
       nearly the full viewport with an inline height. */
    height: auto !important;
    max-height: calc(100vh - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    overflow: hidden !important;
    padding: 0 !important;
    width: 520px !important;
}

#TB_window#TB_window:has(.scuf-share-modal-v2) #TB_ajaxContent {
    height: auto !important;
    max-height: calc(100vh - 32px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 !important;
    width: auto !important;
}

#TB_window#TB_window:has(.scuf-share-modal-v2) #TB_closeWindowButton {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #d6d6d6 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    display: flex !important;
    height: 32px !important;
    justify-content: center !important;
    right: 16px !important;
    top: 18px !important;
    transition: border-color .2s ease, background-color .2s ease !important;
    width: 32px !important;
}

#TB_window#TB_window:has(.scuf-share-modal-v2) #TB_closeWindowButton:hover,
#TB_window#TB_window:has(.scuf-share-modal-v2) #TB_closeWindowButton:focus-visible {
    background: #fef1e8 !important;
    border-color: #f37021 !important;
}

#TB_window#TB_window:has(.scuf-share-modal-v2) .tb-close-icon {
    align-items: center !important;
    color: #25282a !important;
    display: flex !important;
    height: 100% !important;
    justify-content: center !important;
    width: 100% !important;
}

/* Drawn with a mask so the X never depends on the dashicons (or any) font. */
#TB_window#TB_window:has(.scuf-share-modal-v2) .tb-close-icon:before {
    background-color: currentColor !important;
    content: "" !important;
    display: block !important;
    height: 14px !important;
    margin: 0 !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E") center / contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E") center / contain no-repeat !important;
    width: 14px !important;
}

#TB_window#TB_window:has(.scuf-share-modal-v2) #TB_closeWindowButton:hover .tb-close-icon {
    color: #f37021 !important;
}

/* ── Popup content ────────────────────────────────────────────── */

#TB_window#TB_window .scuf-share-modal-v2 {
    box-sizing: border-box !important;
    color: #25282a !important;
    display: grid !important;
    font-family: 'Open Sans', sans-serif !important;
    gap: 20px !important;
    padding: 0 24px 24px !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-header {
    align-items: center !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    display: grid !important;
    gap: 12px !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    margin: 0 -24px !important;
    padding: 18px 64px 18px 24px !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-header-icon {
    align-items: center !important;
    background: #fef1e8 !important;
    border: 0 !important;
    border-radius: 5px !important;
    color: #f37021 !important;
    display: flex !important;
    height: 40px !important;
    justify-content: center !important;
    width: 40px !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-header-icon svg {
    height: 20px !important;
    width: 20px !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-header h3 {
    color: #25282a !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
    line-height: 1.2 !important;
    margin: 0 0 2px !important;
    padding: 0 !important;
    text-transform: uppercase !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-header p {
    color: #646464 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-message-area,
#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-platforms,
#TB_window#TB_window .scuf-share-modal-v2 .scuf-share-copy-link {
    display: grid !important;
    gap: 8px !important;
    margin: 0 !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-message-label-row {
    align-items: center !important;
    display: flex !important;
    gap: 12px !important;
    justify-content: space-between !important;
    margin: 0 !important;
}

#TB_window#TB_window .scuf-share-modal-v2 label {
    color: #646464 !important;
    display: block !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .05em !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    text-transform: uppercase !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-magic-btn {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #f37021 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    color: #f37021 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    gap: 6px !important;
    line-height: 1 !important;
    min-height: 30px !important;
    padding: 6px 12px !important;
    text-transform: uppercase !important;
    transition: background-color .2s ease, color .2s ease !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-magic-btn:hover,
#TB_window#TB_window .scuf-share-modal-v2 .scuf-magic-btn:focus-visible {
    background: #f37021 !important;
    color: #fff !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-magic-btn svg {
    height: 14px !important;
    margin: 0 !important;
    width: 14px !important;
}

#TB_window#TB_window .scuf-share-modal-v2 #scuf-share-message,
#TB_window#TB_window .scuf-share-modal-v2 #scuf-copy-link-input {
    background: #f1f1f1 !important;
    border: 1px solid #d6d6d6 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    color: #25282a !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 14px !important;
    margin: 0 !important;
    width: 100% !important;
}

#TB_window#TB_window .scuf-share-modal-v2 #scuf-share-message {
    line-height: 1.5 !important;
    min-height: 76px !important;
    padding: 10px 12px !important;
    resize: vertical !important;
}

#TB_window#TB_window .scuf-share-modal-v2 #scuf-share-message:focus,
#TB_window#TB_window .scuf-share-modal-v2 #scuf-copy-link-input:focus {
    background: #fff !important;
    border-color: #f37021 !important;
    outline: none !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-platform-grid {
    display: grid !important;
    gap: 8px !important;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)) !important;
    margin: 0 !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-platform-item {
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #d6d6d6 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    justify-content: center !important;
    margin: 0 !important;
    min-height: 72px !important;
    padding: 12px 8px !important;
    text-align: center !important;
    transform: none !important;
    transition: border-color .2s ease, background-color .2s ease !important;
}

/* Platforms past the first four stay behind the plugin's "More" tile until it shows them. */
#TB_window#TB_window .scuf-share-modal-v2 .scuf-hidden-platform:not(.scuf-platform-item--visible)[style*="none"] {
    display: none !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-platform-item:hover {
    background: #fef1e8 !important;
    border-color: #f37021 !important;
    box-shadow: none !important;
    transform: none !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-platform-icon {
    align-items: center !important;
    color: #f37021 !important;
    display: flex !important;
    height: 24px !important;
    justify-content: center !important;
    margin: 0 !important;
    transform: none !important;
    width: 24px !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-platform-icon svg {
    height: 22px !important;
    width: 22px !important;
}

/* The plugin colors its SVGs indigo directly; let them follow their wrapper. */
#TB_window#TB_window .scuf-share-modal-v2 svg {
    color: inherit !important;
    transform: none !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-platform-name {
    color: #25282a !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-copy-input-wrap {
    display: grid !important;
    gap: 8px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    margin: 0 !important;
}

#TB_window#TB_window .scuf-share-modal-v2 #scuf-copy-link-input {
    color: #646464 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    text-overflow: ellipsis !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-copy-btn {
    align-items: center !important;
    background: #f37021 !important;
    border: 1px solid #f37021 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    color: #fff !important;
    cursor: pointer !important;
    display: inline-flex !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    height: 44px !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    min-height: 44px !important;
    min-width: 96px !important;
    padding: 0 20px !important;
    text-transform: uppercase !important;
    transition: background-color .2s ease !important;
}

#TB_window#TB_window .scuf-share-modal-v2 .scuf-copy-btn:hover,
#TB_window#TB_window .scuf-share-modal-v2 .scuf-copy-btn:focus-visible {
    background: #c25a1a !important;
    border-color: #c25a1a !important;
}

@media screen and (max-width: 600px) {
    #TB_window#TB_window:has(.scuf-share-modal-v2) {
        max-width: calc(100vw - 24px) !important;
        width: calc(100vw - 24px) !important;
    }

    #TB_window#TB_window .scuf-share-modal-v2 {
        gap: 16px !important;
        padding: 0 16px 16px !important;
    }

    #TB_window#TB_window .scuf-share-modal-v2 .scuf-share-header {
        margin: 0 -16px !important;
        padding: 14px 56px 14px 16px !important;
    }

    #TB_window#TB_window .scuf-share-modal-v2 .scuf-share-header h3 {
        font-size: 18px !important;
    }

    #TB_window#TB_window:has(.scuf-share-modal-v2) #TB_closeWindowButton {
        right: 12px !important;
        top: 14px !important;
    }

    #TB_window#TB_window .scuf-share-modal-v2 .scuf-platform-grid {
        grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)) !important;
    }

    #TB_window#TB_window .scuf-share-modal-v2 .scuf-copy-input-wrap {
        grid-template-columns: 1fr !important;
    }
}
