/* ==========================================================================
   Lango Product Compare Styles (Site Light Grey #dfdfdf Theme)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Category Views - Compare Icon Positioning (Rises straight up with stock)
   -------------------------------------------------------------------------- */
.product-item-actions.div-animation {
    position: absolute !important;
}

.product-item-actions .btn-compare-item {
    position: absolute !important;
    top: -36px !important;
    right: 10px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    color: #555555 !important;
    text-align: center !important;
    padding: 0 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    z-index: 99 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18) !important;
    outline: none !important;

    /* Completely disable theme's horizontal right-to-left keyframe animations */
    -webkit-animation: none !important;
    animation: none !important;
    -webkit-transform: none !important;
    transform: none !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}

.product-item-actions .btn-compare-item:hover {
    background: #ff0033 !important;
    color: #ffffff !important;
    border-color: #ff0033 !important;
    -webkit-transform: scale(1.08) !important;
    transform: scale(1.08) !important;
}

.product-item-actions .btn-compare-item.active {
    background: #ff0033 !important;
    color: #ffffff !important;
    border-color: #cc0029 !important;
}

/* --------------------------------------------------------------------------
   Product Detail Page - Compare Button next to "V KOŠARICO"
   Matches native #btn-cart look & hover effects
   -------------------------------------------------------------------------- */
.cart-button .btn-detail-compare {
    padding: 8px 18px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cart-button .btn-detail-compare:hover {
    background-color: #ff0033 !important;
    color: #ffffff !important;
    border: none !important;
    text-decoration: none !important;
}

.cart-button .btn-detail-compare.active {
    background-color: #ff0033 !important;
    color: #ffffff !important;
}

.btn-detail-compare i {
    font-size: 14px;
}

/* Smartphone responsive adjustments for Product Detail Page */
@media (max-width: 768px) {
    .cart-button {
        float: none !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        margin-top: 6px !important;
        margin-right: 0 !important;
    }

    .cart-button #btn-cart {
        flex: 1 1 auto !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .cart-button .btn-detail-compare {
        flex: 0 0 auto !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
        height: 35px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* --------------------------------------------------------------------------
   Sticky Bottom Compare Bar (Site Light Grey #dfdfdf Theme)
   -------------------------------------------------------------------------- */
#lango-compare-bar {
    position: fixed;
    bottom: -80px;
    left: 0;
    right: 0;
    height: 56px;
    background: #e9e9e9;
    color: #2b2b2b;
    border-top: 1px solid #c8c8c8;
    z-index: 99990;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
}

#lango-compare-bar.visible {
    bottom: 0;
}

.lango-compare-bar-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lango-compare-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #2b2b2b;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}

.lango-compare-bar-left i {
    font-size: 18px;
    color: #2b2b2b;
}

.lango-compare-badge {
    background: #777777;
    color: #ffffff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.lango-compare-bar-items {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 50%;
}

.lango-compare-bar-items::-webkit-scrollbar {
    display: none;
}

.lango-compare-bar-item {
    position: relative;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #cccccc;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.lango-compare-bar-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lango-compare-bar-item .btn-remove-thumb {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #ff0033;
    color: #ffffff;
    font-size: 11px;
    line-height: 12px;
    text-align: center;
    cursor: pointer;
    border-bottom-left-radius: 4px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.lango-compare-bar-item .btn-remove-thumb:hover {
    background: #cc0000;
}

.lango-compare-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-open-compare-modal {
    background: #ffffff;
    color: #2b2b2b;
    border: 1px solid #cccccc;
    padding: 8px 16px !important;
    border-radius: 4px;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

.btn-open-compare-modal:hover {
    background: #ff0033;
    color: #ffffff;
    border-color: #ff0033;
}

.btn-clear-compare-bar {
    color: #555555;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.btn-clear-compare-bar:hover {
    color: #ff0033;
}

/* Shift Back-To-Top button above compare bar when active */
body.has-compare-bar .back-to-top,
body.has-compare-bar .scroll-to-top,
.back-to-top.compare-bar-shift,
.scroll-to-top.compare-bar-shift {
    bottom: 75px !important;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    z-index: 99995 !important;
}

/* --------------------------------------------------------------------------
   Full-Width Bottom-Up Slide Comparison Drawer (#lango-compare-modal)
   -------------------------------------------------------------------------- */
#lango-compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lango-compare-modal.active {
    pointer-events: auto;
    opacity: 1;
}

.lango-compare-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 96vh;
    max-height: 96vh;
    border-radius: 14px 14px 0 0;
    background: #ffffff;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#lango-compare-modal.active .lango-compare-modal-content {
    transform: translateY(0);
}

.lango-compare-modal-header {
    background: #dfdfdf;
    color: #2b2b2b;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #cccccc;
}

.lango-compare-modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: #2b2b2b;
    font-weight: 700;
}

.lango-compare-modal-header h3 i {
    color: #ff0033;
    margin-right: 8px;
}

.compare-diff-toggle {
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #2b2b2b;
    margin: 0;
    background: #ffffff;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #cccccc;
    transition: all 0.2s ease;
}

.compare-diff-toggle:hover {
    border-color: #999999;
}

.compare-diff-toggle input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    margin: 0;
    accent-color: #ff0033;
}

.lango-compare-modal-close {
    background: #ffffff;
    border: 1px solid #cccccc;
    color: #333333;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    padding: 0;
}

.lango-compare-modal-close:hover {
    background: #ff0033;
    color: #ffffff;
    border-color: #ff0033;
}

.lango-compare-modal-body {
    padding: 0 24px 24px 24px;
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
}

.lango-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.lango-compare-table th,
.lango-compare-table td {
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.15s ease;
}

/* Row Hover Highlight */
.lango-compare-table tbody tr:hover th,
.lango-compare-table tbody tr:hover td {
    background-color: #f0f4f8 !important;
}

.lango-compare-table th.label-col {
    background: #f5f5f5;
    width: 210px;
    text-align: left;
    font-weight: 700;
    color: #2b2b2b;
    font-size: 13px;
    border-right: 2px solid #e0e0e0;
}

/* Value Differencing Colors: Same = Grey, Different = Bold Black */
.lango-compare-table td.val-same,
.lango-compare-table .val-same {
    color: #999999 !important;
    font-weight: 400 !important;
}

.lango-compare-table td.val-different,
.lango-compare-table .val-different {
    color: #000000 !important;
    font-weight: 700 !important;
}

/* Show Differences Only Filter */
.lango-compare-table.show-diff-only tr.row-same {
    display: none !important;
}

.compare-card-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 8px;
}

.compare-card-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.compare-card-link:hover {
    text-decoration: none;
}

.compare-card-link:hover .compare-card-title {
    color: #ff0033;
}

.compare-card-link:hover .compare-card-img {
    opacity: 0.88;
}

.compare-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #2b2b2b;
    display: block;
    margin-bottom: 6px;
    text-decoration: none;
}

.compare-card-title:hover {
    color: #ff0033;
}

.compare-card-price {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.compare-card-stock {
    font-size: 13px;
    font-weight: 600;
}

.compare-card-stock.in-stock {
    color: #28a745;
}

.compare-card-stock.out-of-stock {
    color: #ff0033;
}

.feature-spec-val {
    font-size: 13px;
}

.btn-compare-action {
    background: #ffffff !important;
    color: #2b2b2b !important;
    border: 1px solid #cccccc !important;
    font-weight: 700 !important;
    padding: 6px 16px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    display: inline-block !important;
    transition: all 0.2s ease !important;
}

.btn-compare-action:hover {
    background: #ff0033 !important;
    color: #ffffff !important;
    border-color: #ff0033 !important;
    text-decoration: none !important;
}

.btn-compare-remove-modal {
    color: #888888;
    font-size: 12px;
    cursor: pointer;
    display: inline-block;
    margin-top: 6px;
    transition: color 0.2s;
}

.btn-compare-remove-modal:hover {
    color: #ff0033;
    text-decoration: underline;
}

/* Empty State */
.lango-compare-empty {
    text-align: center;
    padding: 40px 20px;
    color: #777777;
    font-size: 16px;
}

/* ==========================================================================
   Mobile Responsive Optimizations (@media max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* Bottom Bar Compact Mobile Layout */
    .lango-compare-bar-container {
        padding: 0 10px;
        gap: 6px;
    }

    .lango-compare-bar-left {
        font-size: 13px;
        gap: 6px;
    }

    .lango-compare-bar-left i {
        font-size: 16px;
    }

    .lango-compare-bar-left span:not(.lango-compare-badge) {
        display: none;
    }

    .lango-compare-badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    .lango-compare-bar-items {
        gap: 6px;
        max-width: 45%;
    }

    .lango-compare-bar-item {
        width: 32px;
        height: 32px;
        border-radius: 4px;
    }

    .lango-compare-bar-right {
        gap: 6px;
    }

    .btn-open-compare-modal {
        padding: 6px 10px !important;
        font-size: 11px !important;
        border-radius: 5px !important;
    }

    .btn-clear-compare-bar {
        font-size: 11px;
    }

    /* Modal Container & Header */
    .lango-compare-modal-content {
        height: 98vh;
        max-height: 98vh;
        border-radius: 10px 10px 0 0;
    }

    .lango-compare-modal-header {
        padding: 10px 12px;
    }

    .lango-compare-modal-header h3 {
        font-size: 14px;
    }

    .lango-compare-modal-header-actions {
        gap: 8px !important;
    }

    .compare-diff-toggle {
        font-size: 11px;
        padding: 3px 8px;
    }

    .compare-diff-toggle input[type="checkbox"] {
        width: 13px;
        height: 13px;
    }

    .lango-compare-modal-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
        line-height: 24px;
    }

    .lango-compare-modal-body {
        padding: 8px 6px;
    }

    /* Compact Mobile Table & Sticky Specification Labels */
    .lango-compare-table {
        min-width: 100%;
        table-layout: auto;
    }

    .lango-compare-table th,
    .lango-compare-table td {
        padding: 8px 6px;
        font-size: 11px;
        min-width: 125px;
        max-width: 145px;
    }

    /* Sticky First Column for Specification Labels */
    .lango-compare-table th.label-col {
        position: sticky;
        left: 0;
        z-index: 10;
        background: #f5f5f5;
        width: 105px !important;
        min-width: 105px !important;
        max-width: 105px !important;
        font-size: 11px;
        padding: 8px 6px;
        word-break: break-word;
        box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
        border-right: 2px solid #d0d0d0;
    }

    /* Compact Product Card Items */
    .compare-card-img {
        width: 65px;
        height: 65px;
        margin-bottom: 4px;
    }

    .compare-card-title {
        font-size: 11px;
        line-height: 1.25;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .compare-card-price {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .compare-card-stock {
        font-size: 10px;
    }

    .feature-spec-val {
        font-size: 11px;
        line-height: 1.3;
    }

    .btn-compare-action {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }

    .btn-compare-remove-modal {
        font-size: 10px;
        margin-top: 4px;
    }
}

/* --------------------------------------------------------------------------
   Print Button & Info Icon Tooltip Styles
   -------------------------------------------------------------------------- */
.btn-print-compare {
    background: #ffffff;
    color: #2b2b2b;
    border: 1px solid #cccccc;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.btn-print-compare:hover {
    background: #ff0033;
    color: #ffffff;
    border-color: #ff0033;
}

/* Sticky Product Header in Comparison Table (Unified sticky thead block) */
.lango-compare-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.lango-compare-table thead th,
.lango-compare-table thead td {
    background: #ffffff;
}

.lango-compare-table thead th.label-col {
    position: sticky;
    left: 0;
    z-index: 30;
    background: #f5f5f5;
}

.lango-compare-table thead tr.sticky-price-header th,
.lango-compare-table thead tr.sticky-price-header td {
    border-bottom: 2px solid #333333 !important;
}

.lango-compare-table tbody th.label-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #f5f5f5;
}

/* Elevate z-index for the row/cell that has an open popup so it is never clipped */
.lango-compare-table tbody tr.has-open-popup th.label-col,
.lango-compare-table tbody th.label-col:has(.filter-popup:visible) {
    z-index: 50 !important;
}

.lango-compare-table tbody tr.has-open-popup {
    position: relative;
    z-index: 50;
}

/* Info Icon & Popup in Comparison Modal (matches template styling from sidebar) */
.lango-compare-table .info-icon {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
}

.lango-compare-table .filter-popup {
    white-space: normal;
    font-weight: normal;
    z-index: 1000 !important;
}

.lango-compare-print-header {
    display: none;
}

/* ==========================================================================
   Print Styles for Product Comparison Modal
   ========================================================================== */
@media print {
    body {
        visibility: hidden !important;
        background: #ffffff !important;
    }

    body > *:not(#lango-compare-modal) {
        display: none !important;
    }

    #lango-compare-modal,
    #lango-compare-modal * {
        visibility: visible !important;
    }

    .lango-compare-print-header {
        display: block !important;
        text-align: center !important;
        padding: 24px 0 20px 0 !important;
        margin-bottom: 0 !important;
        border-bottom: none !important;
    }

    .lango-compare-print-logo {
        height: 75px !important;
        max-height: 85px !important;
        width: auto !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }

    /* Suppress browser/bootstrap auto-appending URLs after links */
    a[href]:after,
    a:after {
        content: "" !important;
    }

    #lango-compare-bar,
    .lango-compare-modal-header,
    .lango-compare-modal-close,
    .btn-print-compare,
    .compare-diff-toggle,
    .btn-compare-remove-modal,
    .btn-compare-remove-modal + br,
    .btn-compare-action,
    tr.action-row,
    .action-row,
    .features-loading-row,
    .filter-popup,
    .info-icon,
    .back-to-top,
    .scroll-to-top {
        display: none !important;
    }

    #lango-compare-modal {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        background: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        display: block !important;
        overflow: visible !important;
    }

    .lango-compare-modal-content {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #ffffff !important;
        display: block !important;
        overflow: visible !important;
    }

    .lango-compare-modal-body {
        padding: 0 !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    .lango-compare-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
        border: 1px solid #cccccc !important;
    }

    .lango-compare-table thead,
    .lango-compare-table thead tr,
    .lango-compare-table thead tr th,
    .lango-compare-table thead tr td,
    .lango-compare-table tbody th.label-col {
        position: static !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    .lango-compare-table th,
    .lango-compare-table td {
        padding: 8px 10px !important;
        border: 1px solid #cccccc !important;
        font-size: 11px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .lango-compare-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}