/* ===== Cart Icon Button ===== */
.ccd-cart-wrapper {
    display: inline-block;
    position: relative;
    z-index: 3;
}

.ccd-cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
	align-items: flex-end;
    pointer-events: auto;
    touch-action: manipulation;
}
.ccd-cart-btn:hover { color: #f5a623; }

/* Đảm bảo icon SVG luôn hiển thị, tránh bị theme (Flatsome…) ẩn/override */
.ccd-cart-btn svg {
    display: inline-block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    opacity: 1 !important;
    visibility: visible !important;
    fill: #235DA7;
}
.ccd-cart-btn svg path { fill: #235DA7 !important; }

.ccd-cart-count {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #f5a623;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* ===== Overlay ===== */
.ccd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ccd-overlay.ccd-visible {
    display: block;
    opacity: 1;
}

/* ===== Drawer ===== */
.ccd-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 540px;
    max-width: 100vw;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
}
.ccd-drawer.ccd-open { transform: translateX(0); }
.ccd-drawer-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===== Header ===== */
.ccd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #e7edf4;
}
.ccd-title {
    font-size: 36px;
    font-weight: 400;
    color: #235DA7;
    margin: 0;
    font-family: 'iCiel BCCubano', sans-serif;
    line-height: 1;
    text-transform: uppercase;
}
.ccd-close-btn {
    background: #ffffff;
    border: 1px solid #9ea5b1;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ccd-close-btn:hover {
    background: #f8fafc;
    border-color: #7f8897;
    color: #3d4654;
}

/* ===== Items ===== */
.ccd-items {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ccd-items.ccd-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Empty Cart ===== */
.ccd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 48px 60px;
    text-align: center;
    height: 100%;
    min-height: 320px;
}
.ccd-empty-icon {
    margin-bottom: 20px;
    opacity: 0.85;
}
.ccd-empty-text {
    font-size: 16px;
    color: #000;
    line-height: 1.6;
    margin-bottom: 30px!important;
}
.ccd-empty-text strong {
    font-weight: 700;
    color: #222;
}
.ccd-continue-btn {
    display: inline-block;
    background: #F9A51E;
    color: #235DA7 !important;
    text-align: center;
    padding: 16px 108px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 1px;
    text-decoration: none !important;
    font-family: 'iCiel BCCubano', sans-serif;
    transition: background 0.2s, transform 0.1s;
}
.ccd-continue-btn:hover {
    background: #e0931a;
    transform: translateY(-1px);
}

/* ===== Single Item ===== */
.ccd-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px 20px;
    border-bottom: 1px solid #d8dee8;
}
.ccd-item-thumb {
    flex-shrink: 0;
    width: 146px;
    height: 146px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
}
.ccd-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ccd-item-info {
    flex: 1;
    min-width: 0;
}

.ccd-item-name {
    font-size: 16px;
    font-weight: 400;
    color: #235DA7;
    letter-spacing: 0.2px;
    line-height: 1.18;
    margin-bottom: 4px;
    white-space: normal;
    overflow: hidden;
    font-family: 'iCiel BCCubano', sans-serif;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ccd-item-desc {
    font-size: 14px;
    color: #888;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ccd-item-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ccd-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #111111;
}
.ccd-item-price .woocommerce-Price-amount { font-size: 18px; color: inherit; }

.ccd-item-reg-price {
    font-size: 14px;
    color: #aab2bd;
    text-decoration: line-through;
}
.ccd-item-reg-price .woocommerce-Price-amount { color: inherit; }

/* ===== Qty ===== */
.ccd-item-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.ccd-qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid #dedede;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    height: 40px;
}
.ccd-qty-btn {
    background: #ffffff;
    border: none;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 18px;
    color: #1d2631;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    margin-right: 0;
    margin: 0;
}
.ccd-qty-btn:hover { background: #f4f7fb; }
.ccd-qty-val {
    width: 32px;
    text-align: center;
    font-size: 15px;
    font-weight: 400;
    color: #1d2631;
}
.ccd-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.ccd-remove-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.ccd-remove-btn svg {
    display: block;
}

/* ===== Footer ===== */
.ccd-footer {
    padding: 22px 24px 24px;
    background: #eaf1f9;
}
.ccd-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.ccd-total-label { font-size: 16px; color: #1d2631; font-weight: 600; }
.ccd-total-amount { font-size: 20px; font-weight: 700; color: #235DA7; }
.ccd-total-amount .woocommerce-Price-amount { font-size: inherit; color: inherit; }

.ccd-checkout-btn {
    display: block;
    width: 100%;
    min-height: 56px;
    background: #F9A51E;
    color: #235DA7 !important;
    text-align: center;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 24px;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.1s;
    font-family: 'iCiel BCCubano', sans-serif;
}
.ccd-checkout-btn:hover {
    background: #e0931a;
    transform: translateY(-1px);
}
.ccd-checkout-btn:active { transform: translateY(0); }

/* ===== Tablet ===== */
@media (max-width: 991px) {
    .ccd-drawer {
        width: min(100vw, 460px);
    }
    .ccd-title {
        font-size: 34px;
    }
    .ccd-item {
        gap: 14px;
        padding: 14px 18px 16px;
    }
    .ccd-item-thumb {
        width: 120px;
        height: 120px;
    }
    .ccd-footer {
        padding: 18px;
    }
    .ccd-checkout-btn {
        font-size: 22px;
    }
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
    .ccd-drawer {
        width: 100vw;
        border-top-left-radius: 14px;
        border-bottom-left-radius: 14px;
    }
    .ccd-header {
        padding: 14px 14px 12px;
    }
    .ccd-title {
        font-size: 30px;
        line-height: 1.1;
    }
    .ccd-close-btn {
        width: 20px;
        height: 20px;
    }
    .ccd-empty {
        padding: 32px 20px;
    }
    .ccd-empty-text {
        margin-bottom: 20px !important;
    }
    .ccd-continue-btn {
        width: 100%;
        max-width: 320px;
        padding: 14px 20px;
    }
    .ccd-item {
        align-items: flex-start;
        gap: 12px;
        padding: 12px 14px;
    }
    .ccd-item-thumb {
        width: 92px;
        height: 92px;
        border-radius: 8px;
    }
    .ccd-item-name {
        font-size: 15px;
    }
    .ccd-item-pricing {
        gap: 6px;
        margin-bottom: 6px;
    }
    .ccd-item-price .woocommerce-Price-amount {
        font-size: 18px;
    }
    .ccd-item-reg-price {
        font-size: 12px;
    }
    .ccd-item-qty-row {
        gap: 8px;
    }
    .ccd-qty-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .ccd-qty-val {
        width: 30px;
        font-size: 14px;
    }
    .ccd-qty-control {
        height: 34px;
    }
    .ccd-footer {
        padding: 14px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
    .ccd-total-label {
        font-size: 15px;
    }
    .ccd-total-amount {
        font-size: 19px;
    }
    .ccd-checkout-btn {
        padding: 14px;
        font-size: 17px;
        border-radius: 10px;
    }
}

/* ===== Small Mobile ===== */
@media (max-width: 380px) {
    .ccd-title {
        font-size: 26px;
    }
    .ccd-item-thumb {
        width: 78px;
        height: 78px;
    }
    .ccd-item-name {
        font-size: 13px;
    }
    .ccd-checkout-btn {
        letter-spacing: 0.4px;
    }
}
