/**
 * FurryNestLab High-Converting Slide-Out Drawer Cart, Express Checkout & In-Drawer Upsell Styles
 */

/* 1. Backdrop Overlay */
.fnl-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.fnl-drawer-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* 2. Slide-out Drawer Panel */
.fnl-drawer-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 999999;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    font-family: var(--font-body, 'DM Sans', -apple-system, sans-serif);
}

.fnl-drawer-cart.is-active {
    transform: translateX(0);
}

/* 3. Drawer Header */
.fnl-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.fnl-drawer-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fnl-drawer-count-badge {
    background: #0d9488;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.fnl-drawer-close {
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.fnl-drawer-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* 4. Dynamic Free Shipping / AOV Progress Banner */
.fnl-drawer-shipping-banner {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 13px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.3s, border-color 0.3s;
}

.fnl-drawer-shipping-banner.is-unlocked {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    border-bottom-color: #a7f3d0;
}

.fnl-drawer-shipping-text {
    font-size: 12.5px;
    line-height: 1.4;
    color: #334155;
    font-weight: 500;
}

.fnl-drawer-shipping-banner.is-unlocked .fnl-drawer-shipping-text {
    color: #065f46;
    font-weight: 600;
}

.fnl-drawer-shipping-progress {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.fnl-drawer-shipping-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fnl-drawer-shipping-banner.is-unlocked .fnl-drawer-shipping-bar {
    background: linear-gradient(90deg, #10b981, #059669);
}

.fnl-drawer-shipping-banner.is-tier-2 {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
    border-bottom-color: #99f6e4;
}

.fnl-drawer-shipping-banner.is-all-unlocked {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-bottom-color: #fde68a;
}

.fnl-drawer-shipping-banner.is-all-unlocked .fnl-drawer-shipping-text {
    color: #92400e;
    font-weight: 700;
}

.fnl-drawer-shipping-banner.is-all-unlocked .fnl-drawer-shipping-bar {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* Multi-Tier Milestones Pins */
.fnl-milestone-pins {
    position: relative;
    width: 100%;
    height: 18px;
    margin-top: 4px;
}

.fnl-milestone-pin {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    transition: color 0.25s, transform 0.2s;
}

.fnl-milestone-pin:first-child {
    transform: translateX(-50%);
}

.fnl-milestone-pin:nth-child(2) {
    transform: translateX(-50%);
}

.fnl-milestone-pin:last-child {
    transform: translateX(-100%);
}

.fnl-pin-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #ffffff;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    transition: all 0.25s ease;
}

.fnl-milestone-pin.is-achieved {
    color: #0f766e;
    font-weight: 700;
}

.fnl-milestone-pin.is-achieved .fnl-pin-dot {
    background: #0d9488;
}

.fnl-milestone-pin:last-child.is-achieved {
    color: #b45309;
}

.fnl-milestone-pin:last-child.is-achieved .fnl-pin-dot {
    background: #f59e0b;
}

/* 5. Scrollable Items Area */
.fnl-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    -webkit-overflow-scrolling: touch;
}

.fnl-drawer-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fnl-drawer-item {
    display: flex;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
}

.fnl-drawer-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fnl-drawer-item-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.fnl-drawer-item-details {
    flex: 1;
    min-width: 0;
}

.fnl-drawer-item-title {
    margin: 0 0 4px 0;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
}

.fnl-drawer-item-title a {
    color: #0f172a;
    text-decoration: none;
}

.fnl-drawer-item-title a:hover {
    color: #0d9488;
}

.fnl-drawer-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fnl-drawer-item-price {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

/* Quantity Stepper */
.fnl-drawer-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.fnl-qty-btn {
    background: #f8fafc;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.fnl-qty-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.fnl-qty-val {
    width: 32px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
}

.fnl-drawer-item-remove {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.15s;
}

.fnl-drawer-item-remove:hover {
    color: #e11d48;
}

/* 6. In-Drawer Smart Cross-Sell & Upsell Section */
.fnl-drawer-upsell-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #cbd5e1;
}

.fnl-drawer-upsell-header {
    margin-bottom: 12px;
}

.fnl-drawer-upsell-title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fnl-drawer-upsell-sub {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

.fnl-drawer-upsell-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fnl-drawer-upsell-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.fnl-drawer-upsell-card:hover {
    background: #ffffff;
    border-color: #0d9488;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.08);
}

.fnl-drawer-upsell-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.fnl-drawer-upsell-info {
    flex: 1;
    min-width: 0;
}

.fnl-drawer-upsell-name {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    transition: color 0.15s;
}

.fnl-drawer-upsell-name:hover {
    color: #0d9488;
}

.fnl-drawer-upsell-price {
    font-size: 12px;
    font-weight: 700;
    color: #0f766e;
}

.fnl-drawer-upsell-add-btn {
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fnl-drawer-upsell-add-btn:hover {
    background: #0d9488;
}

.fnl-drawer-upsell-add-btn:active {
    transform: scale(0.96);
}

.fnl-drawer-upsell-add-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* Empty State in Drawer */
.fnl-drawer-empty {
    text-align: center;
    padding: 32px 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fnl-drawer-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.fnl-drawer-empty h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.fnl-drawer-empty p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #64748b;
    max-width: 260px;
}

.fnl-drawer-shop-btn {
    display: inline-block;
    background: #0d9488;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s;
}

.fnl-drawer-shop-btn:hover {
    background: #0f766e;
    color: #ffffff;
}

/* 7. Drawer Footer & Sticky Checkout Button */
.fnl-drawer-footer {
    padding: 18px 22px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.fnl-drawer-subtotal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fnl-drawer-subtotal-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.fnl-drawer-subtotal-amount {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
}

.fnl-drawer-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    background: #0d9488;
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    transition: background 0.15s, transform 0.15s;
}

.fnl-drawer-checkout-btn:hover {
    background: #0f766e;
    color: #ffffff;
    transform: translateY(-1px);
}

.fnl-drawer-view-bag {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-decoration: underline;
}

.fnl-drawer-view-bag:hover {
    color: #0f172a;
}

/* Trust Badges in Drawer Footer */
.fnl-drawer-trust-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.fnl-drawer-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Responsive adjustment for small mobile screens */
@media (max-width: 440px) {
    .fnl-drawer-cart {
        max-width: 100vw;
    }
}
