:root {
    --mcdb-width: 420px;
    --mcdb-bg: #ffffff;
    --mcdb-text: #333333;
    --mcdb-border: #e5e5e5;
    --mcdb-blue: #0066cc; /* Blue CTA */
    --mcdb-blue-hover: #0052a3;
    --mcdb-red: #e74c3c;
    --mcdb-yellow: #f1c40f;
    --mcdb-green: #27ae60;
    
    /* Defaults - Overridden by PHP */
    --mcdb_float_right_desktop: 20px;
    --mcdb_float_bottom_desktop: 40px;
    --mcdb_float_right_mobile: 20px;
    --mcdb_float_bottom_mobile: 160px;
}

/* Wrapper & Overlay */
.mcdb-drawer-wrapper {
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    visibility: hidden;
    pointer-events: none;
}

.mcdb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mcdb-drawer-wrapper.open {
    visibility: visible;
    pointer-events: auto;
}
.mcdb-drawer-wrapper.open .mcdb-overlay {
    opacity: 1;
}

/* Drawer Container */
.mcdb-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--mcdb-width);
    max-width: 100%;
    height: 100vh;
    background: var(--mcdb-bg);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
}

.mcdb-drawer-wrapper.open .mcdb-drawer {
    transform: translateX(0);
}

/* Header */
.mcdb-header {
    padding: 20px;
    border-bottom: 1px solid var(--mcdb-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}
.mcdb-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mcdb-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Free Shipping Bar */
.mcdb-free-shipping {
    padding: 15px 20px;
    background: #f9f9f9;
    text-align: center;
    border-bottom: 1px solid var(--mcdb-border);
}
.mcdb-fs-text {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}
.mcdb-fs-bar-bg {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}
.mcdb-fs-bar-fill {
    height: 100%;
    transition: width 0.5s ease, background 0.3s ease;
}
.mcdb-fs-bar-fill.red { background: var(--mcdb-red); }
.mcdb-fs-bar-fill.yellow { background: var(--mcdb-yellow); }
.mcdb-fs-bar-fill.green { background: var(--mcdb-green); }

/* Items List */
.mcdb-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.mcdb-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.mcdb-item:last-child {
    border-bottom: none;
}
.mcdb-item-thumb img {
    width: 70px;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}
.mcdb-item-details {
    flex: 1;
}
.mcdb-item-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}
.mcdb-item-name {
    font-weight: 600;
    text-decoration: none;
    color: var(--mcdb-text);
    font-size: 14px;
    line-height: 1.2;
}
.mcdb-item-price {
    font-weight: 700;
}
.mcdb-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.mcdb-qty {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.mcdb-qty button {
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}
.mcdb-qty input {
    width: 40px;
    text-align: center;
    border: none;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
}
.mcdb-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
}
.mcdb-remove:hover {
    color: var(--mcdb-red);
}

/* Suggestions */
.mcdb-suggestions {
    padding: 15px 20px;
    background: #f8f8f8;
    border-top: 1px solid var(--mcdb-border);
}
.mcdb-suggestions-title {
    font-size: 13px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 10px;
}
.mcdb-suggestions-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.mcdb-sugg-card {
    min-width: 110px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    position: relative;
}
.mcdb-sugg-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    margin-bottom: 5px;
}
.mcdb-sugg-name {
    font-size: 11px;
    display: block;
    line-height: 1.2;
    margin-bottom: 3px;
}
.mcdb-sugg-price {
    font-size: 11px;
    font-weight: bold;
}
.mcdb-add-sugg {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--mcdb-green);
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer & Calculations */
.mcdb-footer {
    padding: 20px;
    border-top: 1px solid var(--mcdb-border);
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.mcdb-accordion-header {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}
.mcdb-accordion-body {
    display: none;
    margin-bottom: 15px;
}
.mcdb-accordion-body.active { display: block; }
.mcdb-cep-input-group {
    display: flex;
    gap: 5px;
}
.mcdb-cep-input-group input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.mcdb-cep-input-group button {
    padding: 8px 15px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.mcdb-shipping-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}
.mcdb-shipping-list li {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.mcdb-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}
.mcdb-btn-checkout {
    display: block;
    width: 100%;
    background: var(--mcdb-blue);
    color: #fff;
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.2s;
}
.mcdb-btn-checkout:hover {
    background: var(--mcdb-blue-hover);
}
.mcdb-btn-continue {
    display: block;
    width: 100%;
    background: none;
    border: none;
    text-decoration: underline;
    margin-top: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

/* Floating Trigger */
.mcdb-floating-trigger {
    position: fixed;
    right: var(--mcdb_float_right_desktop);
    bottom: var(--mcdb_float_bottom_desktop);
    z-index: 99990;
    background: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid #eee;
}
.mcdb-floating-trigger:hover {
    transform: translateY(-2px);
}
.mcdb-float-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
}
.mcdb-float-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.mcdb-float-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--mcdb-red);
    color: #fff;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Loading States */
.mcdb-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile Specifics */
@media (max-width: 768px) {
    .mcdb-drawer {
        width: 100%;
        height: 75vh;
        top: auto;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    .mcdb-drawer-wrapper.open .mcdb-drawer {
        transform: translateY(0);
    }
    
    .mcdb-floating-trigger {
        right: var(--mcdb_float_right_mobile);
        bottom: var(--mcdb_float_bottom_mobile);
    }
}