/* ================================================================
   Seasons Floating Cart Panel — floating-cart.css  v1.2.0
   ================================================================ */

:root {
    --fcs-primary:    #95C138;
    --fcs-primary-dk: #7a9e2e;
    --fcs-bg:         #ffffff;
    --fcs-border:     #e2e8f0;
    --fcs-text:       #2d3748;
    --fcs-label:      #718096;
    --fcs-shadow:     -4px 0 24px rgba(0, 0, 0, 0.14);
    --fcs-radius:     10px;
    --fcs-z:          9999;
    --fcs-width:      265px;
}

/* ── Wrapper ──────────────────────────────────────────────── */

.fcs-wrapper {
    position: fixed;
    right: 0;
    top: 150px;
    z-index: var(--fcs-z);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.fcs-wrapper.fcs-hidden {
    display: none !important;
}

/* ── Panel (flex column, max-height pre scroll) ───────────── */

.fcs-panel {
    display: flex;
    flex-direction: column;
    width: var(--fcs-width);
    max-height: calc(100vh - 180px);
    background: var(--fcs-bg);
    border-radius: var(--fcs-radius) 0 0 var(--fcs-radius);
    box-shadow: var(--fcs-shadow);
    overflow: hidden;
    animation: fcs-slide-in 0.3s ease;
}

.fcs-wrapper.fcs-minimized .fcs-panel {
    display: none;
}

@keyframes fcs-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

/* ── Hlavička (fixed top) ─────────────────────────────────── */

.fcs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: var(--fcs-primary);
    color: #fff;
    flex-shrink: 0;
}

.fcs-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.fcs-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}
.fcs-close:hover { opacity: 1; }

/* ── Minimálne množstvo – varovanie ──────────────────────── */

.fcs-min-warning {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: #fffbeb;
    border-bottom: 1px solid #fcd34d;
    color: #92400e;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.fcs-min-warning svg {
    flex-shrink: 0;
    color: #d97706;
}

/* ── Scrollovateľná stredná časť ──────────────────────────── */

.fcs-panel-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* kľúčové pre flex scroll */
}

.fcs-panel-scroll::-webkit-scrollbar { width: 4px; }
.fcs-panel-scroll::-webkit-scrollbar-track { background: #f1f1f1; }
.fcs-panel-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── Štatistické riadky ───────────────────────────────────── */

.fcs-body {
    padding: 10px 14px 6px;
}

.fcs-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--fcs-text);
    padding: 7px 0;
    border-bottom: 1px solid var(--fcs-border);
}

.fcs-row:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.fcs-label {
    color: var(--fcs-label);
    white-space: nowrap;
    flex-shrink: 0;
}

.fcs-value {
    text-align: right;
    font-size: 12px;
    line-height: 1.4;
}

.fcs-value small {
    display: block;
    font-size: 10px;
    color: var(--fcs-label);
    margin-top: 1px;
}

/* ── CC Vozíky riadok s progress barom ───────────────────── */

.fcs-row-cc {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
}

.fcs-cc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fcs-cc-full {
    font-size: 12px;
    color: var(--fcs-text);
    text-align: right;
}

.fcs-cc-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fcs-cc-next-label {
    color: var(--fcs-label);
    white-space: nowrap;
    flex-shrink: 0;
}

.fcs-cc-bar-wrap {
    flex: 1;
    height: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.fcs-cc-bar-fill {
    height: 100%;
    background: var(--fcs-primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.fcs-cc-fraction {
    font-size: 11px;
    font-weight: 700;
    color: var(--fcs-text);
    white-space: nowrap;
}

/* ── Sekcia produktov ─────────────────────────────────────── */

.fcs-products-section {
    border-top: 1px solid var(--fcs-border);
}

.fcs-products-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f7f8fa;
    border: none;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--fcs-text);
    transition: background 0.2s;
}

.fcs-products-toggle:hover { background: #edf0f5; }

.fcs-products-section.fcs-open .fcs-products-toggle {
    border-bottom-color: var(--fcs-border);
}

.fcs-toggle-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fcs-products-count {
    color: var(--fcs-label);
    font-weight: 400;
}

.fcs-toggle-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--fcs-label);
}

.fcs-products-section.fcs-open .fcs-toggle-arrow {
    transform: rotate(180deg);
}

/* Slide-down animácia cez max-height */
.fcs-products-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.fcs-products-section.fcs-open .fcs-products-list {
    max-height: 800px;
}

/* ── Riadok produktu ──────────────────────────────────────── */

.fcs-product-row {
    padding: 7px 14px;
    border-bottom: 1px solid var(--fcs-border);
    transition: background 0.2s, opacity 0.3s;
}

.fcs-product-row:last-child { border-bottom: none; }

/* Loading stav počas AJAX */
.fcs-product-row.fcs-loading {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
}

.fcs-product-row.fcs-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 2px solid var(--fcs-border);
    border-top-color: var(--fcs-primary);
    border-radius: 50%;
    animation: fcs-spin 0.6s linear infinite;
}

@keyframes fcs-spin {
    to { transform: rotate(360deg); }
}

/* Stav "čaká na odstránenie" (undo) */
.fcs-product-row.fcs-removing {
    opacity: 0.3;
    pointer-events: none;
}

/* Zelený flash po úspešnej aktualizácii množstva */
@keyframes fcs-row-flash {
    0%   { background: rgba(149, 193, 56, 0.28); }
    100% { background: transparent; }
}

.fcs-product-row.fcs-row-updated {
    animation: fcs-row-flash 0.9s ease;
}

/* Horný riadok: názov + odstrániť */
.fcs-product-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 5px;
}

.fcs-product-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--fcs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.fcs-remove-item {
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.fcs-remove-item:hover { color: #e53e3e; }

/* Dolný riadok: SKU | cena/ks | qty | spolu */
.fcs-product-bottom {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* SKU badge – prvý element, zarovnaný vľavo */
.fcs-sku {
    font-size: 10px;
    font-weight: 700;
    color: var(--fcs-label);
    background: #edf2f7;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

/* Cena/ks – odsunie celú skupinu (cena + qty + spolu) doprava od SKU */
.fcs-unit-price {
    font-size: 11px;
    color: var(--fcs-label);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.fcs-unit-price .woocommerce-Price-amount,
.fcs-line-total .woocommerce-Price-amount {
    font-size: 11px;
}

.fcs-per-unit {
    font-size: 10px;
    color: var(--fcs-label);
}

.fcs-math-sym {
    font-size: 10px;
    color: var(--fcs-label);
    flex-shrink: 0;
}

.fcs-line-total {
    font-size: 11px;
    font-weight: 700;
    color: var(--fcs-text);
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

/* ── Qty vstup s šípkami ──────────────────────────────────── */

.fcs-qty-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--fcs-border);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.fcs-qty-input {
    width: 32px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--fcs-text);
    background: #fff;
    padding: 0;
    -moz-appearance: textfield;
}

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

.fcs-qty-arrows {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--fcs-border);
}

.fcs-qty-up,
.fcs-qty-down {
    background: #f7f8fa;
    border: none;
    cursor: pointer;
    padding: 1px 5px;
    font-size: 7px;
    line-height: 1;
    color: var(--fcs-text);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.fcs-qty-up { border-bottom: 1px solid var(--fcs-border); }

.fcs-qty-up:hover,
.fcs-qty-down:hover { background: #e2e8f0; }

/* ── Päta: celková suma + tlačidlo (fixed bottom) ─────────── */

.fcs-footer {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--fcs-border);
    flex-shrink: 0;
    background: var(--fcs-bg);
}

.fcs-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.fcs-total-label { color: var(--fcs-label); font-weight: 500; }

.fcs-total-value {
    font-weight: 700;
    color: var(--fcs-text);
    font-size: 13px;
}

.fcs-total-value .woocommerce-Price-amount {
    font-size: 13px;
    font-weight: 700;
}

.fcs-btn {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: var(--fcs-primary);
    color: #fff !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s;
    box-sizing: border-box;
}

.fcs-btn:hover {
    background: var(--fcs-primary-dk);
    color: #fff !important;
}

/* ── Badge (minimalizovaný stav) ──────────────────────────── */

.fcs-badge {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--fcs-primary);
    color: #fff;
    border: none;
    border-radius: var(--fcs-radius) 0 0 var(--fcs-radius);
    padding: 16px 11px;
    cursor: pointer;
    box-shadow: var(--fcs-shadow);
    transition: background 0.2s;
    min-width: 44px;
    animation: fcs-badge-in 0.3s ease;
}

.fcs-badge:hover { background: var(--fcs-primary-dk); }

.fcs-wrapper.fcs-minimized .fcs-badge { display: flex; }

@keyframes fcs-badge-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

.fcs-badge-icon {
    width: 20px;
    height: 20px;
    stroke: #fff;
    flex-shrink: 0;
}

.fcs-badge-count {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: inline-block;
}

@keyframes fcs-count-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.6); }
    100% { transform: scale(1); }
}

.fcs-badge-count.fcs-count-bump {
    animation: fcs-count-bump 0.4s ease;
}

/* ── Undo toast ───────────────────────────────────────────── */

.fcs-undo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2d3748;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: calc(var(--fcs-z) + 1);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    max-width: 300px;
}

.fcs-undo-toast.fcs-undo-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.fcs-undo-msg {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fcs-undo-btn {
    background: var(--fcs-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}

.fcs-undo-btn:hover { background: var(--fcs-primary-dk); }

/* ── Mobilné zariadenia (max 767px) ───────────────────────── */

@media (max-width: 767px) {
    :root { --fcs-width: 230px; }

    .fcs-wrapper {
        top: auto;
        bottom: 72px;
    }

    .fcs-panel {
        max-height: calc(100vh - 100px);
    }

    .fcs-header  { padding: 10px 12px; }
    .fcs-title   { font-size: 12px; }
    .fcs-body    { padding: 8px 12px 4px; }
    .fcs-footer  { padding: 8px 12px 12px; }

    .fcs-row, .fcs-value { font-size: 11px; }

    .fcs-product-row { padding: 6px 12px; }

    .fcs-btn   { font-size: 12px; padding: 8px 10px; }
    .fcs-badge { padding: 13px 10px; }

    .fcs-badge-icon  { width: 18px; height: 18px; }
    .fcs-badge-count { font-size: 13px; }

    .fcs-undo-toast {
        bottom: 80px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}
