/* =========================================
   Floating Cart Bar – Styles v1.0.1
   ========================================= */

:root {
    --fcb-bg: #ffffff;
    --fcb-border: #e0e0e0;
    --fcb-text: #111111;
    --fcb-text-muted: #555555;
    --fcb-gold: #c9a84c;
    --fcb-gold-hover: #b8943e;
    --fcb-gold-active: #a07a2e;
    --fcb-gold-text: #ffffff;
    --fcb-shadow: 0 -4px 20px rgba(0, 0, 0, 0.10), 0 -1px 4px rgba(0, 0, 0, 0.05);
    --fcb-transition: 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --fcb-z: 99999;
}

/* ── Bar container ── */
.fcb-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--fcb-z);
    background: var(--fcb-bg);
    border-top: 1px solid var(--fcb-border);
    box-shadow: var(--fcb-shadow);
    transform: translateY(100%);
    transition: transform var(--fcb-transition), opacity var(--fcb-transition);
    opacity: 0;
    will-change: transform;
}

.fcb-bar.fcb-visible {
    transform: translateY(0);
    opacity: 1;
}

.fcb-bar.fcb-hidden {
    pointer-events: none;
}

/* ── Inner layout ── */
.fcb-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    height: 68px;
    box-sizing: border-box;
}

/* ── Lewa strona: miniatura + nazwa ── */
.fcb-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.fcb-thumbnail {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border: 1px solid var(--fcb-border);
    background: #f5f5f5;
    /* brak border-radius */
}

.fcb-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fcb-name {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--fcb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
    line-height: 1.3;
}

/* ── Prawa strona: cena + ilość + przycisk ── */
.fcb-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* ── Cena (teraz obok ilości) ── */
.fcb-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--fcb-text);
    white-space: nowrap;
    line-height: 1;
}

.fcb-price .woocommerce-Price-amount {
    color: var(--fcb-text);
}

.fcb-price del {
    opacity: 0.5;
    font-weight: 400;
    font-size: 12px;
    margin-right: 4px;
}

.fcb-price ins {
    text-decoration: none;
}

/* ── Quantity ── */
.fcb-qty-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--fcb-border);
    overflow: hidden;
    background: #fafafa;
    height: 42px;
    /* brak border-radius */
}

.fcb-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 300;
    color: var(--fcb-text);
    transition: background 0.15s ease;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    user-select: none;
    /* brak border-radius */
}

.fcb-qty-btn:hover {
    background: #f0f0f0;
    color: var(--fcb-gold);
}

.fcb-qty-btn:active {
    background: #e8e8e8;
}

.fcb-qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.fcb-qty-input {
    width: 42px;
    height: 100%;
    border: none;
    border-left: 1.5px solid var(--fcb-border);
    border-right: 1.5px solid var(--fcb-border);
    background: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--fcb-text);
    padding: 0 4px;
    box-sizing: border-box;
    -moz-appearance: textfield;
    outline: none;
    /* brak border-radius */
}

.fcb-qty-input::-webkit-outer-spin-button,
.fcb-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Add to cart button ── */
.fcb-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 22px;
    height: 42px;
    background: var(--fcb-gold);
    color: var(--fcb-gold-text);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-transform: uppercase;
    font-family: inherit;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
    /* brak border-radius */
}

.fcb-add-btn:hover {
    background: var(--fcb-gold-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.40);
}

.fcb-add-btn:active {
    background: var(--fcb-gold-active);
    transform: translateY(0);
    box-shadow: none;
}

.fcb-add-btn:disabled {
    background: #cccccc;
    color: #888888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fcb-add-btn.fcb-loading {
    pointer-events: none;
    opacity: 0.80;
}

.fcb-add-btn.fcb-success {
    background: #2e7d32;
    box-shadow: none;
}

.fcb-add-btn.fcb-error {
    background: #c62828;
    box-shadow: none;
}

.fcb-btn-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Spinner ── */
@keyframes fcb-spin {
    to { transform: rotate(360deg); }
}

.fcb-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%; /* spinner zawsze okrągły */
    animation: fcb-spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ── Checkmark animation ── */
@keyframes fcb-check {
    0%   { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}

.fcb-check-icon path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: fcb-check 0.35s ease forwards;
}

/* ── Toast notification ── */
.fcb-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #111111;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    /* brak border-radius */
    opacity: 0;
    pointer-events: none;
    z-index: calc(var(--fcb-z) + 1);
    white-space: nowrap;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.fcb-toast.fcb-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fcb-toast.fcb-toast-success {
    background: #2e7d32;
}

.fcb-toast.fcb-toast-error {
    background: #c62828;
}

/* ── Separator ── */
.fcb-sep {
    width: 1px;
    height: 28px;
    background: var(--fcb-border);
    flex-shrink: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .fcb-name {
        max-width: 180px;
    }

    .fcb-actions {
        gap: 10px;
    }

    .fcb-add-btn {
        padding: 0 16px;
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .fcb-inner {
        padding: 10px 12px;
        gap: 10px;
        height: auto;
        min-height: 60px;
    }

    /* Na mobile ukryj nazwę — zostaje tylko miniatura */
    .fcb-name {
        display: none;
    }

    .fcb-thumbnail {
        width: 38px;
        height: 38px;
    }

    .fcb-price {
        font-size: 13px;
    }

    .fcb-qty-wrap {
        height: 38px;
    }

    .fcb-qty-btn {
        width: 28px;
    }

    .fcb-qty-input {
        width: 34px;
        font-size: 13px;
    }

    .fcb-add-btn {
        height: 38px;
        padding: 0 12px;
        font-size: 11px;
        gap: 6px;
        letter-spacing: 0.3px;
    }

    .fcb-btn-icon svg {
        width: 14px;
        height: 14px;
    }

    .fcb-sep {
        display: none;
    }
}

/* ── WooCommerce price overrides ── */
.fcb-price .amount {
    font-size: inherit;
}
