/* ─── Cart Icon (Header) ───────────────────────────────────────────────────── */

.tt-cart-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-right: 20px;
    text-decoration: none;
    color: #232323;
}

.tt-cart-icon-wrapper i {
    font-size: 1.25rem;
    line-height: 1;
}

.tt-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #91D800;
    color: #232323;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ─── Cart Overlay ─────────────────────────────────────────────────────────── */

#tt-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#tt-cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ─── Cart Drawer ──────────────────────────────────────────────────────────── */

#tt-cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#tt-cart-drawer.open {
    right: 0;
}

/* Header */
#tt-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 25px;
    border-bottom: 1px solid #ebebeb;
    background: #232323;
    color: #fff;
    flex-shrink: 0;
}

.tt-cart-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
    color: #fff;
}

#tt-cart-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#tt-cart-close:hover {
    opacity: 1;
}

/* Body */
#tt-cart-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 25px;
    min-height: 0;
}

/* Empty state */
#tt-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

#tt-cart-empty i {
    display: block;
    margin-bottom: 15px;
    font-size: 2.5rem;
    color: #91D800;
}

#tt-cart-empty p {
    margin: 0 0 6px;
    font-size: 15px;
}

#tt-cart-empty .fs-14 {
    font-size: 13px;
}

/* Cart Items */
#tt-cart-items {
    display: none;
}

.tt-cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tt-cart-item:last-child {
    border-bottom: none;
}

.tt-cart-item-image {
    flex-shrink: 0;
    width: 75px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tt-cart-item-info {
    flex: 1;
    min-width: 0;
}

.tt-cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #232323;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-cart-item-variant {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.tt-cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #232323;
    margin-bottom: 10px;
}

.tt-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-qty-btn {
    background: #f5f5f5;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #232323;
    transition: background 0.2s;
    line-height: 1;
}

.tt-qty-btn:hover {
    background: #91D800;
}

.tt-cart-item-qty > span {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    color: #232323;
}

.tt-remove-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    margin-left: 4px;
    transition: color 0.2s;
    line-height: 1;
}

.tt-remove-btn:hover {
    color: #e74c3c;
}

/* Footer */
#tt-cart-footer {
    padding: 20px 25px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    border-top: 1px solid #ebebeb;
    background: #fff;
    flex-shrink: 0;
}

.tt-cart-subtotal {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #232323;
}

#tt-cart-checkout {
    display: none;
    width: 100%;
    text-align: center;
    background: #232323;
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s;
}

#tt-cart-checkout:hover {
    background: #91D800;
    color: #232323;
}

/* ─── Add to Cart Button States ────────────────────────────────────────────── */

[data-add-to-cart]:disabled,
[data-add-to-cart].loading {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    #tt-cart-drawer {
        width: 100vw;
        right: -100vw;
    }

    #tt-cart-header {
        padding: 18px 20px;
    }

    #tt-cart-body {
        padding: 16px 20px;
    }

    #tt-cart-footer {
        padding: 16px 20px;
    }
}

@media (max-width: 479px) {
    #tt-cart-header {
        padding: 16px 18px;
    }

    #tt-cart-body {
        padding: 14px 18px;
    }

    #tt-cart-footer {
        padding: 14px 18px;
    }

    .tt-cart-item-image {
        width: 60px;
        height: 60px;
    }

    .tt-cart-item-title {
        font-size: 13px;
    }
}
