/* ==========================================================
   Vynk FBT — Frontend Widget
   Brand: Negro #111 | Rojo #E31837 | Blanco #FFF
   ========================================================== */

.vynk-fbt-widget {
    --vynk-red:         #E31837;
    --vynk-red-dark:    #C0132D;
    --vynk-red-light:   #FEF0F2;
    --vynk-red-ring:    rgba(227,24,55,0.15);
    --vynk-black:       #111111;
    --vynk-text:        #111111;
    --vynk-text-mid:    #555555;
    --vynk-text-light:  #888888;
    --vynk-border:      #E0E0E0;
    --vynk-card-bg:     #F9F9F9;
    --vynk-radius:      10px;
    --vynk-radius-sm:   6px;

    /* Overrideable via Elementor controls */
    --vynk-fbt-title-color:  var(--vynk-black);
    --vynk-fbt-price-color:  var(--vynk-red);
    --vynk-fbt-btn-bg:       var(--vynk-red);
    --vynk-fbt-btn-hover:    var(--vynk-red-dark);
}

/* ── Container ── */
.vynk-fbt-widget {
    background: #fff;
    border: 1px solid var(--vynk-border);
    border-radius: var(--vynk-radius);
    padding: 22px 24px 0;
    margin: 28px 0;
    font-family: inherit;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.vynk-fbt-widget--preview {
    border: 2px dashed var(--vynk-red);
    background: var(--vynk-red-light);
    pointer-events: none;
    opacity: .9;
}

/* ── Title — color & font controlled by Elementor ── */
.vynk-fbt-widget__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--vynk-fbt-title-color);
    margin: 0 0 18px;
    padding: 0;
    border: none;
    letter-spacing: -.01em;
    line-height: 1.3;
}

/* ── Products Row ── */
.vynk-fbt-products--horizontal {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}
.vynk-fbt-products--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

/* ── Plus connector ── */
.vynk-fbt-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--vynk-red-light);
    color: var(--vynk-red);
    font-size: 18px;
    font-weight: 300;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
    margin: 0 2px;
}
.vynk-fbt-products--grid .vynk-fbt-plus { display: none; }

/* ── Product Card ── */
.vynk-fbt-product-card {
    position: relative;
    background: var(--vynk-card-bg);
    border: 1.5px solid var(--vynk-border);
    border-radius: var(--vynk-radius-sm);
    padding: 12px 10px 10px;
    width: 148px;
    flex-shrink: 0;
    transition: border-color .18s, box-shadow .18s, background .18s;
    cursor: pointer;
}
.vynk-fbt-products--grid .vynk-fbt-product-card { width: 100%; }
.vynk-fbt-product-card:has(.vynk-fbt-checkbox:checked) {
    border-color: var(--vynk-red);
    background: #fff;
    box-shadow: 0 0 0 3px var(--vynk-red-ring);
}

/* ── Checkbox ── */
.vynk-fbt-product-card__checkbox-wrap {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 2;
    cursor: pointer;
    display: block;
}
.vynk-fbt-checkbox { display: none; }
.vynk-fbt-product-card__check-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: background .15s, border-color .15s;
}
.vynk-fbt-checkbox:checked + .vynk-fbt-product-card__check-indicator,
.vynk-fbt-checkbox:disabled + .vynk-fbt-product-card__check-indicator {
    background: var(--vynk-red);
    border-color: var(--vynk-red);
}
.vynk-fbt-checkbox:checked + .vynk-fbt-product-card__check-indicator::after,
.vynk-fbt-checkbox:disabled + .vynk-fbt-product-card__check-indicator::after {
    content: '';
    display: block;
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: 0; border-left: 0;
    transform: rotate(45deg) translateY(-1px);
}

/* ── "Este producto" Badge ── */
.vynk-fbt-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--vynk-red-light);
    color: var(--vynk-red);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1.5;
}

/* ── Image ── */
.vynk-fbt-product-card__img-link {
    display: block;
    margin: 22px 0 8px;
    text-align: center;
}
.vynk-fbt-product-card__img {
    width: 100%;
    max-width: 108px;
    height: 108px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    transition: transform .2s;
}
.vynk-fbt-product-card:hover .vynk-fbt-product-card__img {
    transform: scale(1.04);
}

/* ── Card Info ── */
.vynk-fbt-product-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.vynk-fbt-product-card__name {
    font-size: 12px;
    font-weight: 500;
    color: var(--vynk-text);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.vynk-fbt-product-card__name:hover { color: var(--vynk-red); }

/* ── Price — color controlled by Elementor ── */
.vynk-fbt-product-card__price {
    font-size: 13px;
    font-weight: 700;
    color: var(--vynk-fbt-price-color);
}
.vynk-fbt-product-card__price .woocommerce-Price-amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* ── Actions Bar ── */
.vynk-fbt-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--vynk-border);
    margin-top: 14px;
}
.vynk-fbt-total {
    display: flex;
    align-items: baseline;
    gap: 7px;
}
.vynk-fbt-total__label {
    font-size: 13px;
    color: var(--vynk-text-mid);
    font-weight: 500;
}
.vynk-fbt-total__price {
    font-size: 22px;
    font-weight: 800;
    color: var(--vynk-text);
    letter-spacing: -.02em;
}
.vynk-fbt-total__price .woocommerce-Price-amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* ── CTA Button — bg controlled by Elementor ── */
.vynk-fbt-add-all.button,
.vynk-fbt-add-all {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 11px 26px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .01em;
    border-radius: 6px !important;
    cursor: pointer;
    background-color: var(--vynk-fbt-btn-bg) !important;
    border-color: var(--vynk-fbt-btn-bg) !important;
    color: #fff !important;
    transition: background .18s, transform .1s, box-shadow .18s;
    box-shadow: 0 2px 8px rgba(227,24,55,.22);
    text-decoration: none !important;
    font-family: inherit;
}
.vynk-fbt-add-all:hover,
.vynk-fbt-add-all.button:hover {
    background-color: var(--vynk-fbt-btn-hover) !important;
    border-color: var(--vynk-fbt-btn-hover) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(227,24,55,.32);
}
.vynk-fbt-add-all:active { transform: scale(.98); }

/* ── Spinner ── */
.vynk-fbt-add-all__spinner {
    display: none;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vynk-spin .55s linear infinite;
    flex-shrink: 0;
}
.vynk-fbt-add-all.is-loading .vynk-fbt-add-all__spinner { display: block; }
.vynk-fbt-add-all.is-loading .vynk-fbt-add-all__text { opacity: .75; }
@keyframes vynk-spin { to { transform: rotate(360deg); } }
.vynk-fbt-add-all.is-added,
.vynk-fbt-add-all.is-added.button {
    background-color: #1a7a3a !important;
    border-color: #1a7a3a !important;
    box-shadow: 0 2px 8px rgba(26,122,58,.28) !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .vynk-fbt-widget { padding: 16px 14px 0; }
    .vynk-fbt-product-card { width: calc(50% - 20px); min-width: 120px; }
    .vynk-fbt-plus { display: none; }
    .vynk-fbt-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .vynk-fbt-add-all, .vynk-fbt-add-all.button { width: 100%; justify-content: center; }
    .vynk-fbt-total { justify-content: space-between; width: 100%; }
}
@media (max-width: 420px) {
    .vynk-fbt-product-card { width: calc(50% - 14px); }
    .vynk-fbt-product-card__img { max-width: 80px; height: 80px; }
}
