/* Hide floating compare bar — replaced by header icon with badge */
#iqitcompare-floating-wrapper { display: none !important; }

/* Load more / Load all buttons */
.load-more-container {
    text-align: center;
    padding: 1.5rem 0 2rem;
}
.load-more-info {
    margin-bottom: 1rem;
    color: #777;
    font-size: 0.9rem;
}
.load-more-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}
.load-more-buttons .btn {
    min-width: 150px;
}
@media (max-width: 575px) {
    .load-more-buttons {
        flex-direction: column;
        align-items: center;
    }
    .load-more-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Compare & Wishlist count badges */
.bostavebniny-compare,
.bostavebniny-wishlist,
.bostavebniny-compare-mobile {
    position: relative;
}
.bostavebniny-badge {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    background: #00C5CC;
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
}
.bostavebniny-badge.has-items {
    display: block;
}

/* Mobile header: cart badge fix */
.col-mobile-btn-cart .cart-products-count-btn {
    display: inline-block !important;
    background: #00C5CC;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 20px;
    padding: 0 4px;
    position: absolute;
    top: -4px;
    right: -4px;
}

/* Mobile header: single row */
@media (max-width: 991px) {
    #mobile-header-sticky .mobile-main-bar .row-mobile-header {
        flex-wrap: nowrap;
    }
    #mobile-header-sticky .mobile-main-bar .col-mobile-btn-menu {
        order: -1;
    }
    #mobile-header-sticky .mobile-main-bar .col-mobile-logo {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
    }
    #mobile-header-sticky .mobile-main-bar .col-mobile-logo img {
        max-width: 100%;
        height: auto;
    }
    #mobile-header-sticky .mobile-main-bar .col-mobile-btn {
        padding: 0 4px;
    }
    #mobile-header-sticky .mobile-main-bar .m-nav-btn img {
        width: 22px;
        height: 22px;
    }
    #mobile-header-sticky .mobile-main-bar .m-nav-btn i {
        font-size: 20px;
    }
    #mobile-header-sticky .mobile-main-bottom {
        display: none;
    }
    /* Mobile cart dropdown: hide by default, warehouse JS sets it to display:block+static */
    #_mobile_blockcart-content {
        display: none !important;
    }
    #_mobile_blockcart-content.show {
        display: block !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 55px;
        width: 100vw !important;
        height: auto !important;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 1050;
        background: #fff !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        padding: 10px 15px !important;
        border: 1px solid #eee !important;
    }
    #_mobile_blockcart-content .blockcart-content {
        position: relative !important;
        width: 100% !important;
    }
}

/* Mobile badge positioning */
.col-mobile-btn-compare .bostavebniny-badge,
.col-mobile-btn-wishlist .bostavebniny-badge {
    top: -4px;
    right: -4px;
}
.col-mobile-btn-cart #mobile-cart-products-count {
    top: -4px;
    right: 2px;
}

/* ============================================
   RESPONSIVE TABLES — replaces FooTable
   ============================================ */

/* Spacing above tables in account pages */
#block-history .footab {
    margin-top: 15px;
}
.filtr + #block-history .footab {
    margin-top: 10px;
}

/* Tablet (768–991px): full-width content + hide tablet columns */
@media (max-width: 991px) {
    /* Content area full width (sidebar stacks above) */
    .my-account-page-content-wrapper .my-account-page-content {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .my-account-page-content-wrapper .my-account-side-links {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    .footab {
        width: 100% !important;
    }
    .footab th[data-hide*="tablet"],
    .footab td.footab-hide-tablet {
        display: none !important;
    }
}

/* Phone (<768px): stacked card layout */
@media (max-width: 767px) {
    .footab {
        border: none;
        width: 100% !important;
    }
    .footab thead {
        display: none;
    }
    .footab tbody {
        display: block;
        width: 100%;
    }
    .footab tbody tr {
        display: block;
        width: 100%;
        border: 1px solid #ddd;
        border-radius: 6px;
        margin-bottom: 12px;
        padding: 12px 14px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }
    .footab tbody tr.expired {
        background: #fff5f5;
        border-left: 3px solid #e8a0a0;
    }
    .footab tbody td,
    .table-bordered .expired td,
    .table-bordered .alternate_item td {
        display: flex;
        align-items: baseline;
        text-align: left;
        padding: 5px 0;
        border: none !important;
        background: transparent !important;
    }
    .footab tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        flex: 0 0 130px;
        min-width: 130px;
        color: #555;
        font-size: 0.9em;
    }
    /* Hide phone columns */
    .footab td.footab-hide-phone {
        display: none !important;
    }
    /* Actions cell — horizontal flex row */
    .footab td.history_actions::before {
        display: none;
    }
    .footab td.history_actions {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
        margin-top: 6px;
    }
    .footab td.history_actions a {
        float: none !important;
        margin: 0 !important;
    }
    /* Icon-only links in actions — centered, bigger click target */
    .footab td.history_actions a.view-order-details,
    .footab td.history_actions a[data-link-action],
    .footab td.history_actions a.list-add-to-cart-all,
    .footab td.history_actions a.list-delete {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
    }
    .footab td.history_actions a .fa-regular,
    .footab td.history_actions a .fa-solid {
        font-size: 1.2em;
        padding: 0;
        line-height: 1;
    }
    /* Tisk zakázky button — don't stretch full width */
    .footab td.history_actions .btn-product-list {
        font-size: 0.85em;
        padding: 6px 14px;
        white-space: nowrap;
    }
    /* Cells without data-label: hide empty ::before */
    .footab tbody td:not([data-label])::before,
    .footab tbody td[data-label=""]::before {
        display: none;
    }
    /* Detail page: print buttons stacked */
    #block-history > a {
        display: block;
        margin-bottom: 8px;
        margin-right: 0 !important;
    }
    #block-history > a .btn {
        width: 100%;
        text-align: center;
    }
    /* Detail page: footer nav buttons stacked */
    .footer_links.d-flex {
        flex-direction: column;
        gap: 8px;
    }
    .footer_links.d-flex .btn {
        margin-right: 0 !important;
        text-align: center;
    }
    /* Detail: product name in card — full width, wrap text */
    .footab td.history_link {
        flex-wrap: wrap;
        word-break: break-word;
    }
}

/* ============================================
   RESPONSIVE FILTER FORMS
   ============================================ */

/* Checkbox groups — inline on desktop/tablet */
.filtr .filtr-checkbox-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filtr .filtr-checkbox-group + .filtr-checkbox-group {
    margin-left: 12px;
}

/* Tablet filter — horizontal but wrapped */
@media (min-width: 768px) and (max-width: 991px) {
    .filtr {
        flex-wrap: wrap;
        gap: 8px 16px;
    }
}

/* Phone filter — stacked */
@media (max-width: 767px) {
    .filtr {
        flex-direction: column !important;
        gap: 6px;
        align-items: stretch !important;
        margin-bottom: 16px;
    }
    .filtr label {
        margin-right: 0 !important;
        margin-bottom: 2px;
        font-weight: 600;
        font-size: 0.9em;
    }
    .filtr .custom-select2 {
        margin-right: 0 !important;
        margin-bottom: 6px;
        width: 100%;
    }
    .filtr .custom-select2 select {
        width: 100%;
    }
    .filtr .ml-4 {
        margin-left: 0 !important;
    }
    /* Checkbox groups: stacked on mobile, no indent */
    .filtr .filtr-checkbox-group {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .filtr .filtr-checkbox-group + .filtr-checkbox-group {
        margin-left: 0;
    }
    .filtr .filtr-checkbox-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
}

/* ============================================
   RESPONSIVE: nabidka-detail buttons
   ============================================ */
@media (max-width: 767px) {
    /* Stacked action buttons */
    .nabidka-detail-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .nabidka-detail-actions .btn {
        margin-right: 0 !important;
        text-align: center;
    }
    /* Inline quantity + cart button */
    .footab td.history_ostatni {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    .footab td.history_ostatni::before {
        flex-basis: 100%;
    }
    .footab td.history_ostatni input.pocet_ks {
        float: none !important;
        margin-right: 0 !important;
    }
}

/* ============================================
   RESPONSIVE: seznam-detail buttons
   ============================================ */
.seznam-detail-actions {
    margin-bottom: 15px;
}
.seznam-detail-nav {
    margin-top: 15px;
    margin-bottom: 10px;
}
@media (max-width: 767px) {
    .seznam-detail-nav,
    .seznam-detail-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .seznam-detail-nav .btn,
    .seznam-detail-actions .btn {
        margin-right: 0 !important;
        text-align: center;
    }
}

/* ============================================
   RESPONSIVE: osoby table — stacked cards
   ============================================ */
@media (max-width: 991px) {
    #osoby_pristup .table {
        display: block;
    }
    #osoby_pristup .table thead {
        display: none;
    }
    #osoby_pristup .table tbody {
        display: block;
    }
    #osoby_pristup .table tbody tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 12px;
        padding: 12px;
        background: #fff;
    }
    #osoby_pristup .table tbody tr.aktualizace {
        background: #fff9e6;
    }
    #osoby_pristup .table tbody td {
        display: flex;
        align-items: center;
        padding: 4px 0;
        border: none;
    }
    #osoby_pristup .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        min-width: 110px;
        flex-shrink: 0;
        color: #555;
        font-size: 13px;
    }
    #osoby_pristup .table tbody td input[type="text"],
    #osoby_pristup .table tbody td .custom-select2 {
        flex: 1;
        width: 100% !important;
    }
    #osoby_pristup .table tbody td input[type="text"] {
        max-width: none;
    }
    #osoby_pristup .table tbody td .custom-select2 select {
        width: 100%;
    }
    /* Actions row */
    #osoby_pristup .table tbody td:last-child::before {
        display: none;
    }
    #osoby_pristup .table tbody td:last-child {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid #eee;
        margin-top: 4px;
    }
}
