/**
 * 2007-2023 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    ITnes
 * @copyright 2007-2023 ITnes
 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/* Container główny */
.itnes-product-bundles-section {
    margin: 30px 0 0 0;
    /* padding: 20px 0; */
}

/* SEKCJA BUNDLI */
.bundles-container {
    /* margin-bottom: 40px; */
    border-radius: var(--border-radius);
    background: #fff;
    padding: 20px 40px;
}

.bundles-compact-container-title {
    font-size: 18px;
    font-weight: 400;
    color: #333;
    /* margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5; */
}

/* .bundle-compact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
} */

.bundle-compact-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    margin: 1em 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    position: relative;
    transform: translateY(0);
    gap: .7em;
}

.bundle-compact-item-button {
    display: flex; 
    flex-direction: column; 
    align-items: flex-end;
}

.bundle-compact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #006bb7;
    background: #f8fcff;
}

.bundle-compact-item .bundle-compact-item-accessories {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1em;
    cursor: pointer;
    transition: opacity 0.2s;
}

.bundle-compact-item .bundle-compact-item-accessories:hover {
    opacity: 0.8;
}

.bundle-accessories-box {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    border-width: 2px;
    border-style: dashed;
    border-radius: 6px;
    padding: 25px 3em 15px 3em;
    gap: 3em;
    flex-direction: row;
    align-items: center;
    border-color: #e5e5e5;
}

.bundle-accessories-box > p {
    position: absolute;
    top: -14px;
    left: 14px;
    padding-left: 5px;
    padding-right: 5px;
    background: white;
}

.bundle-compact-title {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.bundle-compact-title:hover {
    color: #2fb5d2;
    text-decoration: underline;
    cursor: pointer;
}

.bundles-container hr {
    border: 1px solid #e5e5e5;
    border-top: #e5e5e5;
    margin: 2em 0;
}

.itnes-product-bundles-compact {
    margin-top: 60px;
    margin-bottom: 20px;
}

.itnes-product-configurator {
    border: 0 !important;
    margin: 30px 0 40px 0 !important;
}

.itnes-product-bundles-compact hr {
    border: 1px solid #e5e5e5;
    border-top: #e5e5e5;
    margin: 1em 0;
}

/* Bundle Box - główny kontener */
.bundle-box {
    /* border: 2px solid #e0e0e0; */
    /* margin-bottom: 25px; */
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}


/* Bundle Header */
.bundle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 20px; */
    padding-bottom: 15px;
    /* border-bottom: 1px solid #e0e0e0; */
    font-weight: 500;
    font-size: 20px;
}

.bundle-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.bundle-discount {
    background: #ff3838;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
}

/* Bundle Products Row - produkty obok siebie */
.bundle-products-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    /* margin-bottom: 20px; */
    flex-wrap: wrap;
}

/* Bundle Product Card - pojedynczy produkt */
.bundle-product-card {
    position: relative;
    flex: 0 0 auto;
    text-align: center;
    padding: 15px 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    max-width: 180px;

    min-height: 270px;
    max-height: 300px;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.bundle-product-card.main-product {
    border-color: #006bb7 !important;
    background: #e6f3ff !important;
    color: #006bb7 !important;
    cursor: default;
}

.bundle-product-card.clickable-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bundle-product-card.clickable-card:hover {
    border-color: #006bb7;
    background: #f8fcff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bundle-product-card .product-image {
    position: relative;
    margin-bottom: 10px;
    flex-shrink: 0 !important;
}

.bundle-product-card .product-image img {
    max-width: 80px;
    height: auto;
    border-radius: 6px;
    border: 1px solid #3333;
    padding: 5px;
    background: white;
}

.bundle-compact-item-accessories .product-image.image-small {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    padding: 6px 8px;
}

.bundle-compact-item-accessories .product-image.image-small img {
    max-width: 40px;
}

.bundle-compact-item-accessories .main-product {
    border-color: #006bb7 !important;
    /* background-color: #e6f3ff !important; */
}

.badge-compact-view {
    position: absolute;
    bottom: -8px;
    right: -12px;
    background: #333;
    color: #fff;
    padding: 1px 6px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
}

.product-qty-badge {
    position: absolute;
    top: -25px;
    left: -25px;
    background: #333;
    color: #fff;
    padding: 5px 9px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: bold;
}

.product-discount-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff3838;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.product-discount-badge-circle {
    position: absolute;
    top: -10px;
    right: -25px;
    background: #ff3838;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    padding: 30px;
    flex-direction: column;
}

.product-discount-badge-circle span {
    position: relative;
    top: 7px;
}

.product-discount-badge-circle small {
    position: relative;
    top: -3px;
}

.bundle-product-card .product-info {
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-height: 0 !important;
}

.bundle-product-card .product-info .product-price {
    font-size: 13px;
}

.bundle-product-card .product-label {
    font-size: 11px;
    color: #666;
    margin: 0 0 5px 0;
    text-transform: uppercase;
}

.bundle-product-card .product-name {
    display: block;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 8px;
    min-height: 36px;
    font-size: 13px;
    line-height: 1.3;
}

/* .bundle-product-card .product-name:hover {
    color: #2fb5d2;
    text-decoration: underline;
} */

.bundle-product-card > .product-price {
    font-size: 14px;
    font-weight: bold;
    /* color: #333; */
    margin: 0 !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

.bundle-product-card .product-price.product-price-accessories  {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bundle-product-card .product-price.product-price-accessories p {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-wrap: wrap;
}

.bundle-product-card .product-price .product-price-accessory {
    text-decoration: line-through;
    font-size: 18px;
    line-height: 1;
}

.bundle-product-card .product-price .product-price-accessory-tax-exc {
    text-decoration: line-through;
    /* font-size: 13px; */
    line-height: 1;
}

.bundle-product-card .product-price-accessories .product-price-accessory-new-price,
.bundle-product-card .product-price-accessories .product-price-net .product-price-accessory-tax-exc-new-price
{
    color: red;
    line-height: 1.5;
}

/* Produkt główny - ceny przed rabatem (przekreślone) */
.bundle-product-card .product-price-main .product-price-main-original,
.bundle-product-card .product-price-main .product-price-main-tax-exc-original {
    text-decoration: line-through;
    font-size: 14px;
    line-height: 1;
    margin-right: 5px;
}

/* Produkt główny - ceny po rabacie (czerwone) */
.bundle-product-card .product-price-main .product-price-main-new,
.bundle-product-card .product-price-main .product-price-main-tax-exc-new {
    /* color: red; */
    /* font-weight: bold; */
    line-height: 1.5;
}

.bundle-product-card .product-price-net {
    font-size: 12px;
    color: #999;
    margin: 3px 0 0 0;
}

.product-price-net {
    margin-top: 10px;
}
/* Plus Icon */
.bundle-plus-icon {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    flex: 0 0 auto;
}

.icon-small {
    font-size: 22px;
}

/* Bundle Summary - podsumowanie i przycisk */
.bundle-summary {
    /* border-top: 1px solid #e0e0e0; */
    /* padding-top: 15px; */
}

.bundle-summary button {
    width: 100%;
}

.bundle-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* margin-bottom: 15px; */
    flex-wrap: wrap;
    gap: 40px;
    padding: 0 2em;
}

.price-info,
.savings-info {
    display: flex;
    flex-direction: column;
}

.price-label,
.savings-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 3px;
}

.price-total {
    /* font-size: 22px; */
    /* font-weight: bold; */
    font-size: 24px;
    font-weight: 500;
    color: var(--price-color);
    /* margin-top: 10px; */
}

.price-tax-info {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
    display: block;
}

.savings-prices {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.savings-amount {
    font-size: 18px;
    font-weight: bold;
    color: #ff3838;
}

.savings-amount-net {
    font-size: 13px;
    color: #ff3838;
    font-weight: 500;
}

.add-bundle-to-cart {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    background: #ffd500;
    border: none;
    color: #000;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.add-bundle-to-cart:hover {
    background: #ffdd33;
}

.add-bundle-to-cart i {
    margin-right: 8px;
    vertical-align: middle;
}

/* SEKCJA AKCESORIÓW */
.accessories-container {
    margin-top: 40px;
}

.accessories-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.accessories-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.accessory-item {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 15px;
    background: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.accessory-item:hover {
    border-color: #2fb5d2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.accessory-image {
    position: relative;
    margin-bottom: 10px;
    text-align: center;
}

.accessory-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.accessory-out-of-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.accessory-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.accessory-name {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.accessory-name:hover {
    color: #2fb5d2;
}

.accessory-price {
    font-size: 16px;
    font-weight: bold;
    color: #2fb5d2;
    margin: 5px 0;
}

.add-accessory-to-cart {
    width: 100%;
    margin-top: auto;
}

/* Info w koszyku */
.itnes-cart-bundles-info {
    margin: 20px 0;
    padding: 15px;
}

.itnes-cart-bundles-info h4 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.itnes-cart-bundles-info ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.itnes-cart-bundles-info li {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .bundle-box {
        flex-direction: column;
    }
    
    .bundle-summary {
        width: 100%;
    }
    
    .bundle-products-row {
        flex-direction: column;
    }

    .bundle-plus-icon {
        transform: rotate(90deg);
    }

    .bundle-product-card {
        max-width: 100%;
        width: 100%;
    }

    .bundle-pricing-row {
        align-items: flex-start;
        width: 100%;
        padding: 0;
        gap: 10px;
        margin: 30px 0;
    }

    .accessories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .bundle-compact-item {
        flex-direction: column;
    }
    
    .bundle-compact-item-button {
        align-items: center;
    }
}

/* ===== SELECTABLE ACCESSORIES (select_one / multiselect) ===== */
.bundle-product-card.selectable-accessory {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.bundle-product-card.selectable-accessory:hover {
    border-color: #006bb7;
    /* background: #f0f9ff; */
    transform: translateY(-3px);
    /* box-shadow: 0 6px 12px rgba(47, 181, 210, 0.2); */
}

.bundle-product-card.selectable-accessory.selected {
    border-color: #006bb7;
    background: #e6f3ff;
    /* box-shadow: 0 4px 12px rgba(0, 107, 183, 0.3); */
}

/* .bundle-product-card.selectable-accessory.selected::before {
    content: '\2713';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: #006bb7;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    z-index: 20;
} */

/* Wyłącz linkowanie dla selectable accessories */
.bundle-product-card.selectable-accessory .product-name {
    pointer-events: none;
    cursor: default;
}

.bundle-product-card.selectable-accessory .product-name:hover {
    color: inherit;
    text-decoration: none;
}
