/*
 * Miner House - global header + footer polish (all pages).
 *
 * Loaded on every page after the parent theme stylesheet.
 * Palette: navy #0a1a33, gold #ffd700, link blue #1a6fe0, call green #1f8a5b.
 *
 * Sections:
 *   1. Top bar: dead social icons hidden, compact on phones
 *   2. Phones: Category + Buy miners + Call us row under the search bar
 *   3. Phones: floating cart no longer sits on top of the bottom bar
 *   4. Footer: centered contact block, visible hyperlinks, responsive images
 */

/* ---------------------------------------------------------------
   1. Top bar
   --------------------------------------------------------------- */

/* Social icons with no real URL (Customizer left them as "#") are hidden,
   so visitors never click a dead icon. StumbleUpon is discontinued and
   Dribbble is not used by the shop - never show those two. */
.top-header .content-social .social-icon li:has(> a[href="#"]),
.top-header .content-social .social-icon li:has(.fa-stumbleupon),
.top-header .content-social .social-icon li:has(.fa-dribbble) {
    display: none;
}

@media screen and (max-width: 767px) {
    .top-header {
        position: relative;
        padding: 0;
        overflow: visible;
    }

    .top-header .top-header-bar {
        padding: 6px 0;
    }

    /* Phones: the bar is ONE short line. The rest (MM-PRO GROUP / Slovak shop
       link, social icons, Buy Miners link) is hidden until the visitor taps the
       small arrow tab in the middle of the bar (.mh-topbar-toggle, added by
       mobile-menu.js). */
    .mh-profitable-miner--split {
        display: block;
    }

    .mh-profitable-miner--split p:nth-child(2),
    .top-header .content-social {
        display: none;
    }

    .mh-profitable-miner--split p:first-child {
        margin: 0;
        font-size: 12px;
        line-height: 1.4;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mh-profitable-miner--split p:first-child > span,
    .mh-profitable-miner--split p:first-child > a:last-child {
        display: none;
    }

    /* Arrow tab hanging from the middle of the bar */
    .top-header .mh-topbar-toggle {
        position: absolute;
        left: 50%;
        bottom: -18px;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 18px;
        margin-left: -26px;
        padding: 0;
        border: 0;
        border-radius: 0 0 14px 14px;
        background: #0a1a33;
        color: #ffd700;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .top-header .mh-topbar-toggle svg {
        width: 16px;
        height: 16px;
        transition: transform 0.25s ease;
    }

    /* Expanded: show everything, wrapped */
    .top-header.mh-topbar-open {
        padding-bottom: 6px;
    }

    .top-header.mh-topbar-open .mh-profitable-miner--split p {
        white-space: normal;
        overflow: visible;
        text-align: center;
        font-size: 13px;
        line-height: 1.5;
        margin: 0 0 6px;
    }

    .top-header.mh-topbar-open .mh-profitable-miner--split p:nth-child(2) {
        display: block;
    }

    .top-header.mh-topbar-open .mh-profitable-miner--split p:first-child > span,
    .top-header.mh-topbar-open .mh-profitable-miner--split p:first-child > a:last-child {
        display: inline;
    }

    .top-header.mh-topbar-open .top-header-col1,
    .top-header.mh-topbar-open .top-header-col2 {
        width: 100%;
        padding: 0;
    }

    .top-header.mh-topbar-open .content-social {
        display: block;
        text-align: center;
    }

    .top-header.mh-topbar-open .content-social ul {
        margin: 0;
        padding: 0;
    }

    .top-header.mh-topbar-open .mh-topbar-toggle svg {
        transform: rotate(180deg);
    }
}

/* The arrow tab only exists on phones */
.mh-topbar-toggle {
    display: none;
}

@media screen and (max-width: 767px) {
    .top-header .mh-topbar-toggle {
        display: flex;
    }
}

/* ---------------------------------------------------------------
   Header search bar (all screen sizes)
   ---------------------------------------------------------------
   Outline in the same black as the Search button, a bit thicker, slightly
   tighter corners. !important is needed: the global header-search rule in
   functions.php (mh_child_global_ui_css) already sets a 2px grey border with
   !important. */
.main-header .thaps-search-box .thaps-from-wrap {
    border: 2.5px solid #000 !important;
    border-radius: 1.2rem !important;
}

.main-header .thaps-search-box:focus-within .thaps-from-wrap {
    border-color: #000 !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12) !important;
}

/* ---------------------------------------------------------------
   2. Phones: action row under the search bar
   ---------------------------------------------------------------
   [ Category ] [ Buy miners ]            [ Call us ]
   The Buy miners link is injected by mobile-menu.js (it reads the real
   shop URL from the menu). */

@media screen and (max-width: 767px) {
    .below-header .below-header-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px 0;
    }

    .below-header .below-header-col1 {
        display: flex !important;
        align-items: center;
        justify-content: flex-start !important;
        gap: 8px;
        width: auto;
        flex: 0 1 auto;
    }

    .below-header .menu-category-list,
    .below-header .toggle-cat-wrap {
        width: auto;
        flex: 0 0 auto;
        margin-right: 0;
    }

    .below-header .below-header-col2 {
        width: auto;
        flex: 0 0 auto;
        margin-left: auto;
    }

    /* Buy miners: gold button (navy text + bag icon), same height, font and
       corner style as the Category button next to it. */
    .below-header .mh-buy-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 35px;
        padding: 0 12px;
        border-radius: 3px;
        background: #ffd700;
        color: #0a1a33 !important;
        font-family: 'Lato-Bold', sans-serif;
        font-size: 14px;
        font-weight: bold;
        line-height: 35px;
        text-decoration: none;
        white-space: nowrap;
    }

    .below-header .mh-buy-cta::before {
        content: "";
        width: 16px;
        height: 16px;
        background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a1a33' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3Cpath d='M3.1 6h17.8'/%3E%3Cpath d='M3.4 5.5a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.7a2 2 0 0 0-.4-1.2l-2-2.7A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z'/%3E%3C/svg%3E");
    }

    /* Call us: pill that takes its colour (navy) and font (bold 14px, theme
       font) from the theme's own phone block, instead of a bare icon. */
    .below-header .header-support-wrap {
        display: flex;
        justify-content: flex-end;
        float: none;
    }

    .below-header .header-support-content {
        display: none;
    }

    .below-header .header-support-icon {
        width: auto;
        height: auto;
        line-height: 1;
        background: transparent;
        border: 0;
    }

    .below-header .callto-icon {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 35px;
        padding: 0 14px;
        border-radius: 999px;
        background: #0a1a33 !important;
        color: #fff !important;
        font-family: inherit;
        font-size: 14px;
        font-weight: bold;
        line-height: 1;
        white-space: nowrap;
    }

    .below-header .callto-icon svg,
    .below-header .callto-icon i {
        width: 15px;
        height: 15px;
        font-size: 15px;
        color: #fff;
    }

    .below-header .callto-icon::after {
        content: "Call us";
    }

}

/* ---------------------------------------------------------------
   3. Phones: floating cart above the bottom bar
   ---------------------------------------------------------------
   The cart plugin pins a glass circle at bottom:36px / right:36px. The bottom
   bar is ~60px tall, so it sat on top of the account button. Lift it above the
   bar and show the bag icon together with the cart total (white pill). */

@media screen and (max-width: 767px) {
    .taiowc-wrap.taiowc-fixed-cart.cart_fixed_1 .taiowc-content {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
        right: 14px !important;
        border-radius: 50%;
    }

    /* Round navy button, white bag icon, gold ring. Same size whether the cart
       is empty or not (a wide white pill looked like a blank rectangle). */
    .taiowc-wrap.taiowc-fixed-cart.cart_fixed_1 .taiowc-cart-item {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
        padding: 0;
        background: #0a1a33 !important;
        border: 2px solid #ffd700;
        border-radius: 50%;
        box-shadow: 0 4px 14px rgba(10, 26, 51, 0.4);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .taiowc-wrap.taiowc-fixed-cart.cart_fixed_1 .taiowc-icon,
    .taiowc-wrap.taiowc-fixed-cart.cart_fixed_1 .taiowc-icon svg {
        width: 26px;
        height: 26px;
        color: #fff;
    }

    /* The cart total does not fit a round button - the count badge is enough */
    .taiowc-wrap.taiowc-fixed-cart.cart_fixed_1 .taiowc-cart-item .taiowc-total,
    .taiowc-wrap.taiowc-fixed-cart.cart_fixed_1 .taiowc-cart-total-wrap {
        display: none;
    }

    .taiowc-wrap.taiowc-fixed-cart.cart_fixed_1 .cart-count-item {
        background: #ffd700;
        color: #0a1a33;
        font-weight: bold;
    }
}

/* ---------------------------------------------------------------
   4. Footer
   --------------------------------------------------------------- */

/* Placeholder Facebook link ("tvoja-stranka" = "your page") stays hidden
   until the real URL is saved in the Contact Details widget. */
.kontakt-ikony a[href*="tvoja-stranka"] {
    display: none;
}

/* Contact Details: centered block, every row clearly a button */
.widget-footer-col4 .widget-title,
.widget-footer-col4 .textwidget {
    text-align: center;
}

.kontakt-ikony {
    margin: 0 auto;
    max-width: 340px;
}

.kontakt-ikony .ikona {
    border: 1px solid #d3d8e0;
    background: #fff;
    color: #0a1a33;
    font-weight: 600;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.kontakt-ikony .ikona span {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.kontakt-ikony .ikona:hover,
.kontakt-ikony .ikona:focus-visible {
    background: #fff8cc;
    border-color: #ffd700;
    transform: translateY(-1px);
}

.kontakt-ikony .ikona i {
    color: #0a1a33;
}

/* Clickable footer text looks clickable: underlined, link blue */
footer .top-footer a,
footer .widget-footer a:not(.ikona),
footer .below-footer a {
    color: #1a6fe0;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

footer .top-footer a:hover,
footer .widget-footer a:not(.ikona):hover,
footer .below-footer a:hover,
footer .top-footer a:focus-visible,
footer .widget-footer a:not(.ikona):focus-visible,
footer .below-footer a:focus-visible {
    color: #0a1a33;
    text-decoration-thickness: 2px;
}

/* Image links (logo, payment banners) do not need an underline */
footer .widget-footer a:has(> img),
footer .widget-footer a:has(> figure) {
    text-decoration: none;
}

/* Footer images never overflow or get squashed */
footer .widget img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Footer menu row: separate, tap-sized links */
footer .top-footer .top-store-bottom-menu li {
    padding-right: 0;
    margin: 0 14px 6px 0;
}

@media screen and (max-width: 767px) {
    /* The parent squeezes the 4 footer columns into 2 half-width columns on
       phones, which wraps text badly. One column, centered, is cleaner. */
    .widget-footer .widget-footer-wrap > div {
        width: 100%;
    }

    footer .widget-footer {
        text-align: center;
    }

    footer .widget-footer ul {
        padding-left: 0;
        list-style: none;
    }

    footer .top-footer .top-store-bottom-menu {
        text-align: center;
    }

    footer .top-footer .top-store-bottom-menu li {
        margin: 0 8px 6px;
    }

    .kontakt-ikony .ikona {
        padding: 12px;
    }
}

/* Buy miners button exists in the DOM at all widths, but only phones show it */
.mh-buy-cta {
    display: none;
}

/* "More About Store" footer widget contains only four "Soon" placeholders.
   Hidden here as a stop-gap - delete the widget in Appearance > Widgets. */
#text-40 {
    display: none;
}
