:root {
    --tdsc-primary: #6BAA3A;
    --tdsc-accent: #D4AF37;
    --tdsc-bg: #ffffff;
    --tdsc-text: #2f2935;
    --tdsc-muted: #77727d;
    --tdsc-border: #ece8ef;
    --tdsc-shadow: 0 20px 70px rgba(30, 22, 40, .22);
}

body.tdsc-lock {
    overflow: hidden;
}

.tdsc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 15, 23, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
    z-index: 2147483000;
}

.tdsc-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.tdsc-cart {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(440px, 94vw);
    background: var(--tdsc-bg);
    color: var(--tdsc-text);
    z-index: 2147483001;
    box-shadow: var(--tdsc-shadow);
    display: flex;
    flex-direction: column;
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    font-family: inherit;
}

.tdsc-position-right {
    right: 0;
    transform: translateX(110%);
}

.tdsc-position-left {
    left: 0;
    transform: translateX(-110%);
}

.tdsc-cart.is-open {
    transform: translateX(0);
}

.tdsc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--tdsc-border);
}

.tdsc-kicker {
    font-size: 13px;
    color: var(--tdsc-primary);
    font-weight: 700;
    margin-bottom: 2px;
}

.tdsc-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
}

.tdsc-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f4f1f5;
    color: var(--tdsc-text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.tdsc-content {
    overflow: auto;
    padding: 16px 18px 20px;
    -webkit-overflow-scrolling: touch;
}

.tdsc-loading,
.tdsc-empty {
    padding: 30px 10px;
    color: var(--tdsc-muted);
    text-align: center;
}

.tdsc-items {
    display: grid;
    gap: 12px;
}

.tdsc-item {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--tdsc-border);
    border-radius: 16px;
    background: #fff;
}

.tdsc-item img {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 12px;
    background: #f7f4f8;
}

.tdsc-item-name,
.tdsc-item-name a {
    color: var(--tdsc-text);
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.25;
}

.tdsc-item-meta {
    color: var(--tdsc-muted);
    font-size: 13px;
    margin-top: 5px;
}

.tdsc-item-price {
    font-weight: 800;
    white-space: nowrap;
    font-size: 14px;
}

.tdsc-benefits {
    margin: 16px 0;
    display: grid;
    gap: 10px;
}

.tdsc-benefit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f7faf4;
    border: 1px solid rgba(107,170,58,.18);
}

.tdsc-benefit span {
    color: var(--tdsc-muted);
    font-size: 13px;
}

.tdsc-benefit strong {
    color: var(--tdsc-primary);
    font-size: 16px;
    white-space: nowrap;
}

.tdsc-benefit-gold {
    background: linear-gradient(135deg, rgba(245,215,110,.27), rgba(212,175,55,.14));
    border-color: rgba(212,175,55,.36);
}

.tdsc-benefit-gold strong {
    color: #9b7415;
}

.tdsc-progress-block {
    padding: 12px 14px;
    border-radius: 16px;
    background: #fbfafc;
    border: 1px solid var(--tdsc-border);
}

.tdsc-progress-title {
    font-size: 13px;
    color: var(--tdsc-text);
    margin-bottom: 9px;
}

.tdsc-progress {
    height: 9px;
    background: #eee8f0;
    overflow: hidden;
    border-radius: 999px;
}

.tdsc-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--tdsc-primary), var(--tdsc-accent));
    border-radius: 999px;
    transition: width .35s ease;
}

.tdsc-recommend {
    margin: 18px 0 12px;
}

.tdsc-recommend h3 {
    font-size: 16px;
    margin: 0 0 10px;
}

.tdsc-recommend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tdsc-rec {
    color: var(--tdsc-text);
    border: 1px solid var(--tdsc-border);
    border-radius: 15px;
    padding: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tdsc-rec-link {
    color: inherit;
    text-decoration: none !important;
    display: block;
    min-width: 0;
}

.tdsc-rec img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    border-radius: 12px;
    background: #fbfafc;
}

.tdsc-rec span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
    margin-top: 7px;
    font-size: 12px;
    font-weight: 700;
}

.tdsc-rec-bottom {
    margin-top: auto;
    padding-top: 8px;
}

.tdsc-rec-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
    font-size: 16px;
    line-height: 1.15;
    color: var(--tdsc-primary);
    font-weight: 900;
}

.tdsc-rec-price .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tdsc-rec-price del,
.tdsc-rec-price ins,
.tdsc-rec-price .amount,
.tdsc-rec-price bdi,
.tdsc-rec-price .woocommerce-Price-amount,
.tdsc-rec-price .woocommerce-Price-currencySymbol {
    display: inline !important;
    white-space: nowrap !important;
}

.tdsc-rec-price del {
    opacity: .72;
    font-size: 12px;
    font-weight: 700;
    color: #7f7a84;
}

.tdsc-rec-price ins {
    text-decoration: none;
    color: var(--tdsc-primary);
    font-size: 16px;
    font-weight: 900;
}

.tdsc-rec-add {
    width: 100%;
    margin-top: 9px;
    min-height: 34px;
    border: 0;
    border-radius: 10px;
    background: var(--tdsc-primary);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.tdsc-rec-add:hover {
    filter: brightness(.96);
}

.tdsc-rec-add.is-disabled {
    background: #f0edf2;
    color: #332c3a;
}

.tdsc-summary {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px -18px 0;
    padding: 14px 18px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--tdsc-border);
    font-size: 15px;
}

.tdsc-summary strong {
    font-size: 20px;
}

.tdsc-actions {
    position: sticky;
    bottom: -20px;
    display: grid;
    gap: 9px;
    margin: 0 -18px -20px;
    padding: 14px 18px 18px;
    background: #ffffff;
    border-top: 1px solid var(--tdsc-border);
    box-shadow: 0 -18px 32px rgba(255,255,255,.98), 0 -10px 24px rgba(30,22,40,.08);
    z-index: 10;
}

.tdsc-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    border-radius: 14px;
    border: 0;
    cursor: pointer;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 15px;
}

.tdsc-btn-primary {
    background: var(--tdsc-primary);
    color: white !important;
}

.tdsc-btn {
    transition: background-color .18s ease,
                transform .15s ease,
                box-shadow .18s ease;
}

.tdsc-btn-primary:hover,
.tdsc-btn-primary:focus {
    background: #5c9932 !important;   /* cca o 10 % tmavší */
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(107,170,58,.28);
}

.tdsc-btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.tdsc-btn-secondary:hover,
.tdsc-btn-secondary:focus {
    background: #e3dde8;
    color: var(--tdsc-text) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(40,30,50,.08);
}

.tdsc-btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

.tdsc-actions .tdsc-btn-primary,
.tdsc-actions .tdsc-btn-primary:hover,
.tdsc-actions .tdsc-btn-primary:focus,
.tdsc-actions .tdsc-btn-primary:active {
    color: #ffffff !important;
}


.tdsc-btn-secondary {
    background: #f1edf3;
    color: var(--tdsc-text) !important;
}

.tdsc-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2147483001;
    background: #fff;
    color: var(--tdsc-text);
    border: 1px solid var(--tdsc-border);
    box-shadow: var(--tdsc-shadow);
    border-radius: 16px;
    padding: 14px 16px;
    min-width: 240px;
    transform: translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
}

.tdsc-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.tdsc-handle {
    display: none;
}

@media (max-width: 768px) {
    .tdsc-cart.tdsc-mobile-bottom_sheet {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 88vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(110%);
    }

    .tdsc-cart.tdsc-mobile-bottom_sheet.is-open {
        transform: translateY(0);
    }

    .tdsc-cart.tdsc-mobile-bottom_sheet .tdsc-handle {
        display: block;
        width: 42px;
        height: 5px;
        border-radius: 999px;
        background: #ded8e2;
        margin: 10px auto 0;
    }

    .tdsc-header {
        padding: 12px 18px 12px;
    }

    .tdsc-header h2 {
        font-size: 21px;
    }

    .tdsc-content {
        padding: 12px 14px 16px;
        max-height: calc(88vh - 76px);
    }

    .tdsc-item {
        grid-template-columns: 54px 1fr;
        position: relative;
    }

    .tdsc-item img {
        width: 54px;
        height: 54px;
    }

    .tdsc-item-price {
        grid-column: 2;
        margin-top: -4px;
    }

    .tdsc-recommend-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tdsc-summary,
    .tdsc-actions {
        margin-left: -14px;
        margin-right: -14px;
    }

    .tdsc-toast {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }
}

/* Popup mode: skutečný modal, ne drawer */
.tdsc-cart.tdsc-mode-popup {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(560px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    border-radius: 24px;
    overflow: hidden;
    transform: translate(-50%, -46%) scale(.96);
    opacity: 0;
    pointer-events: none;
}

.tdsc-cart.tdsc-mode-popup.is-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.tdsc-cart.tdsc-mode-popup .tdsc-content {
    max-height: calc(min(760px, 100vh - 28px) - 82px);
}

.tdsc-cart.tdsc-mode-popup .tdsc-actions {
    bottom: -20px;
    background: #fff;
    box-shadow: 0 -22px 36px rgba(255,255,255,1), 0 -10px 26px rgba(30,22,40,.10);
}

.tdsc-cart.tdsc-mode-popup .tdsc-recommend {
    padding-bottom: 8px;
}


.tdsc-item-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.tdsc-qty {
    display: inline-flex;
    align-items: center;
    height: 34px;
    border: 1px solid var(--tdsc-border);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.tdsc-qty button {
    width: 32px;
    height: 34px;
    border: 0;
    background: #f5f2f6;
    color: var(--tdsc-text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
}

.tdsc-qty button:disabled,
.tdsc-qty input:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.tdsc-qty-input {
    width: 42px !important;
    height: 34px !important;
    min-height: 34px !important;
    border: 0 !important;
    padding: 0 !important;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    background: #fff;
    color: var(--tdsc-text);
    appearance: textfield;
    -moz-appearance: textfield;
}

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

.tdsc-remove {
    border: 0;
    background: transparent;
    color: #a33;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 2px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tdsc-cart.is-updating .tdsc-content {
    opacity: .62;
    pointer-events: none;
}

.tdsc-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff1f1;
    border: 1px solid #ffd1d1;
    color: #9b1c1c;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .tdsc-cart.tdsc-mode-popup {
        top: 50%;
        width: calc(100vw - 22px);
        max-height: calc(100vh - 22px);
        border-radius: 20px;
    }

    .tdsc-item-controls {
        gap: 7px;
    }

    .tdsc-qty {
        height: 36px;
    }

    .tdsc-qty button {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .tdsc-qty-input {
        width: 44px !important;
        height: 36px !important;
        min-height: 36px !important;
    }

    .tdsc-remove {
        font-size: 13px;
        padding: 7px 2px;
    }
}


.tdsc-item-gift {
    border-color: rgba(212,175,55,.42);
    background: linear-gradient(135deg, rgba(245,215,110,.18), rgba(255,255,255,1) 62%);
}

.tdsc-gift-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.tdsc-gift-badges span,
.tdsc-gift-qty {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(212,175,55,.18);
    color: #8b6815;
    font-size: 11px;
    font-weight: 800;
}

.tdsc-item-gift .tdsc-item-price {
    color: #8b6815;
}


.tdsc-item-bundle-parent {
    border-color: rgba(107,170,58,.28);
    background: #fbfff8;
}

.tdsc-item-bundle-child {
    margin-left: 18px;
    border-left: 3px solid rgba(107,170,58,.35);
}

.tdsc-item-price-empty {
    min-width: 1px;
}

.tdsc-item-bundle-child .tdsc-gift-qty {
    background: #f7f4f8;
    color: var(--tdsc-muted);
}

/* Bundle grouping + locked automatic gifts */
.tdsc-bundle-group {
    border: 1px solid var(--tdsc-border);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
}

.tdsc-bundle-group > .tdsc-item {
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--tdsc-border);
}

.tdsc-bundle-children {
    display: grid;
    gap: 0;
    background: #fbfafc;
}

.tdsc-bundle-children .tdsc-item {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding-left: 22px;
    grid-template-columns: 48px 1fr auto;
    position: relative;
}

.tdsc-bundle-children .tdsc-item::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    border-radius: 99px;
    background: #e5dfea;
}

.tdsc-bundle-children .tdsc-item + .tdsc-item {
    border-top: 1px dashed #e7e1ec;
}

.tdsc-bundle-children .tdsc-item img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.tdsc-bundle-children .tdsc-item-name,
.tdsc-bundle-children .tdsc-item-name a {
    font-size: 13px;
    font-weight: 700;
}

.tdsc-bundle-children .tdsc-item-price {
    font-size: 13px;
}

.tdsc-bundle-meta {
    color: var(--tdsc-primary);
    font-weight: 700;
}

.tdsc-locked-note {
    font-size: 12px;
    font-weight: 800;
    color: #8a6b16;
    background: #fbf1d1;
    border-radius: 999px;
    padding: 5px 9px;
}

.tdsc-item-gift .tdsc-locked-note {
    margin-left: 0;
}

@media (max-width: 768px) {
    .tdsc-bundle-children .tdsc-item {
        grid-template-columns: 44px 1fr;
        padding-left: 20px;
    }

    .tdsc-bundle-children .tdsc-item img {
        width: 44px;
        height: 44px;
    }

    .tdsc-bundle-children .tdsc-item-price {
        grid-column: 2;
        margin-top: -4px;
    }
}
