/* ===== 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; }

.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: #fff;
    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 20px 14px;
    border-bottom: 1px solid #eee;
}
.ccd-title {
    font-size: 36px;
    font-weight: 400;
    color: #235DA7;
    margin: 0;
    font-family: 'iCiel BCCubano', sans-serif;
}
.ccd-close-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ccd-close-btn:hover { background: #f0f0f0; }

/* ===== 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: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.ccd-item-thumb {
    flex-shrink: 0;
    width: 148px;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 6px;
    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.3px;
    line-height: 1.3;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'iCiel BCCubano', sans-serif;
}
.ccd-item-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ccd-item-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ccd-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}
.ccd-item-price .woocommerce-Price-amount { font-size: 18px; color: inherit; }

.ccd-item-reg-price {
    font-size: 13px;
    color: #bbb;
    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;
}
.ccd-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.ccd-qty-btn {
    background: #f5f5f5;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    margin-right: 0;
}
.ccd-qty-btn:hover { background: #e0e0e0; }
.ccd-qty-val {
    width: 34px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.ccd-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.ccd-remove-btn:hover { opacity: 1; }

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

.ccd-checkout-btn {
    display: block;
    width: 100%;
    background: #F9A51E;
    color: #235DA7 !important;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 1px;
    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: 30px;
    }
    .ccd-item {
        gap: 12px;
        padding: 14px 16px;
    }
    .ccd-item-thumb {
        width: 112px;
        height: 112px;
    }
    .ccd-footer {
        padding: 18px;
    }
    .ccd-checkout-btn {
        font-size: 17px;
    }
}

/* ===== 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: 26px;
        line-height: 1.1;
    }
    .ccd-close-btn {
        width: 34px;
        height: 34px;
    }
    .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: 10px;
        padding: 12px 14px;
    }
    .ccd-item-thumb {
        width: 86px;
        height: 86px;
        border-radius: 8px;
    }
    .ccd-item-name {
        font-size: 14px;
    }
    .ccd-item-pricing {
        gap: 6px;
        margin-bottom: 6px;
    }
    .ccd-item-price .woocommerce-Price-amount {
        font-size: 16px;
    }
    .ccd-item-reg-price {
        font-size: 12px;
    }
    .ccd-item-qty-row {
        gap: 8px;
    }
    .ccd-qty-btn {
        width: 28px;
        height: 28px;
    }
    .ccd-qty-val {
        width: 30px;
    }
    .ccd-footer {
        padding: 14px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
    .ccd-total-label {
        font-size: 15px;
    }
    .ccd-total-amount {
        font-size: 18px;
    }
    .ccd-checkout-btn {
        padding: 14px;
        font-size: 16px;
        border-radius: 10px;
    }
}

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