/* ============================================================
   WooCommerce Page Builder - AJAX Cart / Mini Cart
   ============================================================ */

.wpb-cart {
    position: relative;
    display: inline-block;
}

.wpb-cart-align-left { text-align: left; }
.wpb-cart-align-center { text-align: center; }
.wpb-cart-align-right { text-align: right; }

/* Trigger */
.wpb-cart-trigger {
    position: relative;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #ffffff;
    color: #222222;
    padding: 10px 14px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}

.wpb-cart-trigger:hover {
    text-decoration: none;
}

/* Icon-only trigger (slide-in panel style): no card/box around the icon */
.wpb-cart.wpb-cart-panel .wpb-cart-trigger {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    color: #222222;
}

.wpb-cart.wpb-cart-panel .wpb-cart-icon svg {
    width: 28px;
    height: 28px;
}

.wpb-cart-label {
    font-size: 14px;
    font-weight: 600;
}

/* Icons (inline SVG) */
.wpb-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.wpb-cart-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
}

/* Count badge */
.wpb-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e74c3c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* Subtotal near trigger */
.wpb-cart-subtotal-trigger {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    font-weight: 600;
    vertical-align: middle;
}

/* Panel / Dropdown */
.wpb-cart-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 9999;
    width: 340px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
    text-align: left;
}

.wpb-cart.wpb-cart-dropdown.wpb-cart-open .wpb-cart-panel,
.wpb-cart.wpb-cart-inline.wpb-cart-open .wpb-cart-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wpb-cart-items {
    max-height: 320px;
    overflow-y: auto;
    padding: 12px;
}

.wpb-cart-empty {
    padding: 24px 12px;
    text-align: center;
    color: #888888;
    font-size: 14px;
}

/* Single item */
.wpb-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}

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

.wpb-cart-item-thumb {
    flex: 0 0 56px;
    width: 56px;
    display: block;
}

.wpb-cart-item-thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

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

.wpb-cart-item-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #222222;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpb-cart-item-qty {
    font-size: 12px;
    color: #888888;
    margin-right: 6px;
}

.wpb-cart-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
}

.wpb-cart-remove {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #999999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
}

.wpb-cart-remove:hover {
    color: #e74c3c;
}

/* Footer */
.wpb-cart-footer {
    border-top: 1px solid #ececec;
    padding: 14px 12px;
}

.wpb-cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #222222;
}

.wpb-cart-actions {
    display: flex;
    gap: 10px;
}

.wpb-cart-view-btn,
.wpb-cart-checkout-btn {
    flex: 1 1 0;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: opacity .15s;
}

.wpb-cart-view-btn {
    background: #f5f5f5;
    color: #222222;
}

.wpb-cart-checkout-btn {
    background: #222222;
    color: #ffffff;
}

.wpb-cart-view-btn:hover,
.wpb-cart-checkout-btn:hover {
    opacity: .9;
    text-decoration: none;
}

/* Slide-in Panel (off-canvas) */
.wpb-cart-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

body.wpb-cart-panel-open .wpb-cart-panel-overlay {
    opacity: 1;
    visibility: visible;
}

.wpb-cart.wpb-cart-panel .wpb-cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 360px;
    max-width: 90vw;
    border-radius: 0;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transition: transform .3s ease;
}

body.wpb-cart-panel-open .wpb-cart.wpb-cart-panel .wpb-cart-panel {
    transform: translateX(0);
}

.wpb-cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px;
    border-bottom: 1px solid #ececec;
}

.wpb-cart-panel-title {
    font-size: 16px;
    font-weight: 700;
}

.wpb-cart-close {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #888888;
}

.wpb-cart.wpb-cart-panel .wpb-cart-items {
    flex: 1 1 auto;
    max-height: none;
}

.wpb-cart.wpb-cart-panel .wpb-cart-footer {
    border-top: 1px solid #ececec;
}

/* Inline style */
.wpb-cart.wpb-cart-inline .wpb-cart-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
}

@media (max-width: 480px) {
    .wpb-cart-panel {
        width: 300px;
    }
    .wpb-cart.wpb-cart-panel .wpb-cart-panel {
        width: 320px;
    }
}
