/**
 * Copyright since 2011 BEST FOR NET s.r.o.
 *
 * COPYRIGHT NOTICE / UPOZORNĚNÍ NA AUTORSKÁ PRÁVA
 *
 * This code is protected by copyright and may not be distributed without prior written consent of the author.
 * Under the license terms, you may use and modify this code only for your own needs.
 * For any questions or further information, please contact us.
 *
 * Tento software je chráněn autorským právem a jeho šíření bez předchozího písemného souhlasu autora není povoleno.
 * Tento kód smíte v souladu s licencí používat a upravovat jen pro své vlastní účely.
 * V případě dotazů nebo zájmu o další informace nás neváhejte kontaktovat.
 *
 * @author    BEST FOR NET s.r.o. <info@bestfornet.cz>
 * @copyright Since 2011 BEST FOR NET s.r.o.
 * @license   Komerční licence – použití, šíření a úpravy tohoto software jsou možné pouze na základě individuální smlouvy s autorem. Pro více informací kontaktujte info@bestfornet.cz
 */
/* B4N Product Gifts — frontend styles */

/* Gift link under cart items */
.b4npg-gift-link-row {
    font-size: 0.9em;
    padding: 4px 0;
}

.b4npg-gift-link {
    cursor: pointer;
    color: #6c19ab;
    text-decoration: none;
    font-weight: 700;
    background-image: url(../../img/gift-box.svg);
    background-size: 16px;
    background-repeat: no-repeat;
    background-position: left top;
    padding-left: 25px;
}

.b4npg-gift-link:hover {
    color: #964acf;
    border-bottom-color: #964acf;
}

.b4npg-gift-icon {
    display: inline-block;
    margin-right: 2px;
}

/* Modal overlay */
.b4npg-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.b4npg-modal.is-open {
    display: block;
}

.b4npg-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
}

.b4npg-modal-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.22);
    width: 94%;
    max-width: 880px;
    max-height: 88vh;
    overflow-y: auto;
    transition: max-width 0.2s ease;
}

/* Dialog width adapts to the number of visible gift slides (set by JS in openModal). */
.b4npg-modal-dialog.b4npg-cols-1 { max-width: 420px; }
.b4npg-modal-dialog.b4npg-cols-2 { max-width: 640px; }
.b4npg-modal-dialog.b4npg-cols-3 { max-width: 880px; }

.b4npg-modal-header {
    text-align: center;
    padding: 3rem;
}

.b4npg-modal-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.b4npg-modal-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #000;
    font-family: var(--font-family-secondary);
}

.b4npg-modal-subtitle {
    font-size: 0.88em;
    color: #555;
    font-weight: 400;
}

.b4npg-modal-close {
    width: 27px;
    height: 27px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #fff;
    position: absolute;
    right: 16px;
    top: 16px;
    background: #d51c1c;
    border-radius: 50px;
    padding: 1rem; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.b4npg-modal-close:hover {
    color: #333;
}

.b4npg-modal-body {
    padding: 20px;
}

/* Swiper */
.b4npg-swiper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.b4npg-swiper-track {
    flex: 1;
    overflow: hidden;
}

.b4npg-swiper-slides {
    display: flex;
    transition: transform 0.3s ease;
}

/* Default: 1 per view. Slide flex-basis is overridden below based on the
   b4npg-cols-* class set on the modal dialog by JS. */
.b4npg-swiper-slide {
    flex: 0 0 100%;
    padding: 8px;
    box-sizing: border-box;
    text-align: center;
}

.b4npg-modal-dialog.b4npg-cols-1 .b4npg-swiper-slide { flex: 0 0 100%; }
.b4npg-modal-dialog.b4npg-cols-2 .b4npg-swiper-slide { flex: 0 0 50%; }
.b4npg-modal-dialog.b4npg-cols-3 .b4npg-swiper-slide { flex: 0 0 33.333%; }

.b4npg-swiper-prev,
.b4npg-swiper-next {
    background: none;
    border: none;
    font-size: 8rem;
    cursor: pointer;
    color: #000;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.b4npg-swiper-prev:disabled,
.b4npg-swiper-next:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Dots */
.b4npg-swiper-dots {
    text-align: center;
    margin-top: 12px;
}

.b4npg-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    margin: 0 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.b4npg-dot.is-active {
    background: #6c19ab;
}

/* Gift card inside slide */
.b4npg-gift-card {
    border: none;
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    transition: border-color 0.2s;
    height: 100%;
    box-sizing: border-box;
}

.b4npg-gift-card.is-selected {
    border: 1px solid #3d8b3d;
}

.b4npg-gift-card img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.b4npg-gift-card .b4npg-gift-name {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    min-height: 70px;
}

.b4npg-gift-card .b4npg-gift-attr {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 6px;
}

.b4npg-gift-card .b4npg-gift-stock {
    font-size: 0.82em;
    color: #666;
    margin-bottom: 12px;
}

.b4npg-gift-card .b4npg-gift-stock.in-stock {
    color: #3d8b3d;
}

.b4npg-gift-card .b4npg-gift-stock.out-of-stock {
    color: #c0392b;
}

.b4npg-select-btn {
    display: inline-block;
    padding: 8px 18px;
    background: #6c19ab;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.b4npg-select-btn:hover {
    background: #964acf;
}

.b4npg-select-btn.is-selected {
    background: #3d8b3d;
}

.b4npg-select-btn.is-selected:hover {
    background: #3d8b3d;
}
