/* MPJ - Mix Box - Premium Styles */

.mpj-mix-box-container {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Fix for sticky behavior in Warehouse theme */
main#main,
main#main-page-content,
#content-wrapper,
body.module-ultimateproductbox-BoxProduct {
    overflow: visible !important;
}

.flying-item {
    position: fixed;
    z-index: 999999 !important;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    background: #fff;
    will-change: transform, opacity;
}

.pulse-slot {
    animation: pulseSlot 0.5s ease-out;
}

@keyframes pulseSlot {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(40, 167, 69, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.mixbox-header {
    text-align: center;
    margin-bottom: 40px;
}

.mixbox-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #222;
}

.product-description-short {
    color: #666;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

.mixbox-columns {
    display: flex;
    gap: 30px;
    align-items: stretch;
    /* Crucial: Makes right column as tall as left column */
    position: relative;
}

/* LEFT COLUMN - Product Grid */
.mixbox-left-column {
    flex: 1;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-image-container {
    position: relative;
    padding: 0;
    /* Removed padding so image fills the area */
    background: #f9f9f9;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Make photo fill the square */
    transition: transform 0.5s ease;
}

.product-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
    /* Override Warehouse theme margins */
}

.product-card:hover .product-thumbnail {
    transform: scale(1.1);
}

.product-actions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    /* Subtle dark overlay on hover */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image-container:hover .product-actions-overlay {
    opacity: 1;
}

.btn-add-to-mix {
    width: 60px;
    /* Larger button */
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: var(--box-primary-color, #ff6b6b);
    color: #fff;
}

.btn-add-to-mix i {
    font-size: 32px;
    /* Larger icon */
}

.btn-add-to-mix:hover {
    background: #e65a5a;
    transform: scale(1.15);
}

.product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    /* Center align text */
    align-items: center;
}

.product-title {
    font-size: 1.15rem;
    /* Larger font */
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #222;
    line-height: 1.3;
}

.product-short-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    text-align: center;
}

.product-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    /* Stack price and qty */
    align-items: center;
    gap: 10px;
    width: 100%;
}

.product-price {
    font-weight: 800;
    color: var(--box-primary-color);
    font-size: 1.3rem;
    /* Larger price */
}

.qty-selector {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 2px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    font-weight: bold;
    cursor: pointer;
    color: #555;
}

.item_qty {
    width: 30px;
    text-align: center;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
}

/* RIGHT COLUMN - Sticky Summary */
.mixbox-right-column {
    width: 350px;
    flex-shrink: 0;
    position: relative;
}

.summary-sticky-panel {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    /* Fixed position from top when scrolling */
    z-index: 100;
}

.summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
}

.mix-name-placeholder {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

/* Visual Box Progress */
.visual-box-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    list-style: none;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 200px;
    margin-bottom: 25px;
    border: 2px dashed #ddd;
}

.visual-box-grid li {
    aspect-ratio: 1/1;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #eee;
    overflow: hidden;
}

.visual-box-grid li.empty-slot::after {
    content: '';
    width: 20px;
    height: 20px;
    background: #eee;
    border-radius: 50%;
}

.visual-box-grid li.filled {
    border-color: var(--box-primary-color);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.remove-item {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.visual-box-grid li:hover .remove-item {
    opacity: 1;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.total-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.price.ubp_bundle {
    font-size: 1.5rem;
    font-weight: 800;
    color: #EE6B07;
}

.box-qty-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.box-qty-wrapper label {
    font-weight: 600;
    margin: 0;
}

.box-qty-wrapper input {
    width: 80px;
}

.btn-primary.ubp_box_add_to_cart_button {
    background: #EE6B07;
    border: none;
    padding: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary.ubp_box_add_to_cart_button:hover:not(:disabled) {
    background: #FD7E14;
    transform: scale(1.02);
}

.btn-primary.ubp_box_add_to_cart_button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-clear {
    color: #999;
    font-size: 0.9rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}

.btn-clear:hover:not(:disabled) {
    color: #dc3545;
}

/* Description Section */
.mixbox-description-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.mixbox-description-section h2 {
    margin-bottom: 25px;
    font-weight: 700;
}

/* Loader */
.cart_loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--box-primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .mpj-mix-box-container {
        padding: 10px;
    }

    .mixbox-columns {
        flex-direction: column;
    }

    .mixbox-right-column {
        display: none !important;
        /* Hide the sidebar summary on mobile */
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile as requested */
        gap: 10px;
    }

    .product-card {
        border-radius: 8px;
    }

    .product-info {
        padding: 10px;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .product-short-desc {
        display: none;
        /* Hide description on mobile to save space */
    }

    .product-price {
        font-size: 1rem;
    }

    .product-actions-overlay {
        opacity: 0;
        position: absolute;
        /* Revert from static to absolute for centering */
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.2);
        transition: opacity 0.3s;
    }

    .product-image-container:hover .product-actions-overlay {
        opacity: 1;
    }

    .product-image-container {
        padding: 0;
        /* Removed mobile padding */
    }

    .btn-add-to-mix {
        width: 50px;
        /* Slightly smaller than desktop but still centered and visible */
        height: 50px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    /* Sticky Mobile Bar - Premium Redesign */
    #mixbox-mobile-summary {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
        z-index: 99;
        padding: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .mobile-progress-container {
        height: 8px;
        background: #eee;
        width: calc(100% - 40px);
        margin: 0 auto 15px;
        /* Spaced from content above and bottom */
        border-radius: 10px;
        overflow: hidden;
        position: relative;
    }

    .mobile-progress-fill {
        height: 100%;
        background: #EE6B07;
        width: 0%;
        transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 10px;
        position: relative;
    }

    /* Shine effect on progress bar */
    .mobile-progress-fill::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.3) 50%,
                rgba(255, 255, 255, 0) 100%);
        animation: progressShine 2s infinite;
        transform: translateX(-100%);
    }

    @keyframes progressShine {
        100% {
            transform: translateX(100%);
        }
    }

    .mobile-summary-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        max-width: 600px;
        margin: 0 auto;
    }

    .mobile-summary-left {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .mobile-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #999;
        font-weight: 700;
        margin-bottom: 2px;
    }

    .mobile-summary-price {
        font-size: 1.25rem;
        font-weight: 800;
        color: #222;
        line-height: 1;
    }

    .mobile-summary-price .currency {
        font-size: 0.9rem;
        color: #666;
        margin-left: 2px;
    }

    .mobile-summary-center {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .mobile-counter-pill {
        background: #f8f9fa;
        border: 1px solid #eee;
        padding: 6px 12px;
        border-radius: 20px;
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 700;
        color: #444;
    }

    .mobile-counter-pill i {
        font-size: 16px;
        color: var(--box-primary-color);
    }

    .count-divider {
        color: #ccc;
        margin: 0 2px;
    }

    .max-count {
        color: #888;
    }

    .mobile-summary-right {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }

    .btn-mobile-finish {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: #EE6B07;
        color: #fff;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
        transition: transform 0.2s, background 0.2s;
    }

    .btn-mobile-finish i {
        font-size: 24px;
    }

    .btn-mobile-finish:disabled {
        background: #e0e0e0;
        box-shadow: none;
        color: #aaa;
    }

    .btn-mobile-finish:active {
        transform: scale(0.95);
    }

    /* Adjust page padding for bottom bar */
    .mpj-mix-box-container {
        padding-bottom: 150px;
    }

    /* Mobile thumbnail strip */
    .mobile-thumbnail-strip {
        display: flex;
        flex-direction: row;
        gap: 6px;
        padding: 6px 12px 10px;
        background: rgba(255, 255, 255, 0.98);
    }

    .mobile-thumb-slot {
        flex: 1;
        min-width: 0;
        aspect-ratio: 1 / 1;
        border-radius: 8px;
        border: 2px solid #eee;
        background: #f9f9f9;
        overflow: hidden;
        position: relative;
        transition: border-color 0.2s;
    }

    .mobile-thumb-slot.filled {
        border-color: #EE6B07;
    }

    .mobile-thumb-slot img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .mobile-thumb-slot.empty-slot {
        opacity: 0.35;
    }
}

/* Helper for desktop */
@media (min-width: 992px) {
    #mixbox-mobile-summary {
        display: none !important;
    }
}

/* Tabs Section Styles */
.mixbox-tabs-section {
    margin-top: 60px;
    padding-top: 20px;
}

.mixbox-tabs-section .nav-tabs {
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.mixbox-tabs-section .nav-item {
    margin-bottom: -2px;
}

.mixbox-tabs-section .nav-link {
    border: none;
    padding: 12px 25px;
    font-weight: 700;
    color: #888;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.mixbox-tabs-section .nav-link.active {
    color: var(--box-primary-color);
    border-bottom-color: var(--box-primary-color);
    background: none;
}

.mixbox-tabs-section .tab-content {
    padding: 10px 0;
    line-height: 1.6;
}

.mixbox-tabs-section .tab-pane {
    display: none;
}

.mixbox-tabs-section .tab-pane.active {
    display: block;
}

.mixbox-tabs-section .tab-pane.in {
    opacity: 1;
}

.data-sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.data-sheet dt {
    font-weight: 700;
    color: #222;
    background: none;
    padding: 10px 0;
    margin: 0;
    border-bottom: 1px solid #f1f1f1;
}

.data-sheet dd {
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
    text-align: right;
    color: #444;
}

.product-reference {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.product-reference strong {
    font-weight: 700;
    color: #222;
}

.product-reference span {
    color: #444;
}

.mixbox-tabs-section .nav-tabs {
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 30px;
    display: flex;
    gap: 0;
    padding: 0;
    list-style: none;
}

.mixbox-tabs-section .nav-link {
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    color: #999;
    background: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    font-size: 1.2rem;
}

.mixbox-tabs-section .nav-link.active {
    color: #222;
    border-bottom-color: #ff6b00;
    /* Orange underline from screenshot */
    background: none;
}

.mixbox-tabs-section .nav-link:hover:not(.active) {
    color: #666;
}

/* === Frontend product listing: Kód on product cards === */
.js-product-miniature .product-reference {
    display: block;
    text-align: center;
    font-size: .8rem;
    color: #555;
    border-bottom: none !important;
    border-top: none !important;
    padding: 4px 0;
    margin: 0;
}

.js-product-miniature .product-reference .label,
.js-product-miniature .product-reference span {
    display: inline;
}