/* Dflex Woo Theme - Mini Cart Styles */
.dflex-minicart-panel,
.dflex-minicart-panel *,
.dflex-minicart-overlay {
    box-sizing: border-box;
}

body.dflex-minicart-open {
    overflow: hidden;
}

/* Header Icons */
.dflex-header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dflex-cart-page-wrap {
    padding: 60px 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.dflex-cart-page-wrap .dflex-minicart-empty {
    height: auto;
    padding: 0;
}

.dflex-header-icon {
    position: relative;
    font-size: 22px;
    color: #1a1a1a;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.dflex-header-icon:hover {
    color: var(--dflex-color-primary);
}

.dflex-cart-trigger {
    background: transparent;
    color: #1a1a1a;
}

.dflex-header-icon.dflex-cart-trigger {
    display: inline-flex;
}

.dflex-cart-trigger.has-total {
    gap: 10px;
}

.dflex-cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.dflex-minicart-total-val {
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.dflex-cart-icon-wrap .dflex-badge,
.dflex-header-icon .dflex-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--dflex-color-primary);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Slide Panel */
.dflex-minicart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999998;
}

.dflex-minicart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dflex-minicart-panel {
    position: fixed;
    top: 0;
    width: var(--dflex-minicart-w, 420px);
    /* Base width if style is not applied */
    max-width: 90vw;
    /* Mobile safety */
    bottom: 0;
    height: auto;
    background: #ffffff;
    z-index: 999999;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s;
}

/* Position Right */
.dflex-minicart-panel.pos-right {
    right: 0;
    transform: translateX(100%);
}

.dflex-minicart-panel.pos-right.open {
    transform: translateX(0);
}

/* Position Left */
.dflex-minicart-panel.pos-left {
    left: 0;
    transform: translateX(-100%);
}

.dflex-minicart-panel.pos-left.open {
    transform: translateX(0);
}

/* Fade Animation Fallback */
.dflex-minicart-panel.anim-fade {
    transition: opacity 0.3s ease-in-out !important;
    opacity: 0;
}

.dflex-minicart-panel.anim-fade.pos-right {
    right: 0 !important;
    pointer-events: none;
    /* prevent invisible clicks */
}

.dflex-minicart-panel.anim-fade.pos-left {
    left: 0 !important;
    pointer-events: none;
}

.dflex-minicart-panel.anim-fade.open {
    opacity: 1;
    pointer-events: auto;
}

.dflex-minicart-header {
    padding: 24px 30px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dflex-minicart-header-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.dflex-minicart-close {
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    color: #1a1a1a;
    transition: color 0.2s;
}

.dflex-minicart-close:hover {
    color: var(--dflex-color-primary);
}

.dflex-minicart-content {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Empty State */
.dflex-minicart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.dflex-minicart-empty .dflex-minicart-empty-icon {
    font-size: 60px;
    color: #eee;
    margin-bottom: 20px;
}

.dflex-minicart-empty-img {
    max-width: 150px;
}

.dflex-minicart-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.dflex-minicart-empty p {
    font-size: 14px;
    color: #888;
    margin: 0 0 30px;
    line-height: 1.5;
}

.dflex-btn-shop {
    background: var(--dflex-btn-bg, var(--dflex-color-primary));
    color: var(--dflex-btn-text, #fff) !important;
    text-decoration: none;
    padding: var(--dflex-btn-padding, 12px 30px);
    border: var(--dflex-btn-border, none);
    border-radius: var(--dflex-btn-radius, 20px);
    font-weight: var(--dflex-btn-font-weight, 700);
    font-size: var(--dflex-btn-font-size, 14px);
    transition: all 0.3s ease;
    display: inline-block;
}

.dflex-btn-shop:hover {
    background: var(--dflex-btn-hover-bg, var(--dflex-color-primary-hover));
    color: var(--dflex-btn-hover-text, #fff) !important;
    border: var(--dflex-btn-border-hover, none);
}

/* Rewards & Progress Bars */
.dflex-minicart-rewards {
    padding: 10px 30px;
    background: #fdfdfd;
    border-bottom: 1px solid #f5f5f5;
}

.dflex-minicart-custom-info {
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-align: left;
}

.dflex-store-closed-minicart-msg {
    color: var(--dflex-color-error, #E53935);
    font-weight: 700;
}

.dflex-minicart-progress-wrap {
    margin-bottom: 10px;
}

.dflex-minicart-progress-wrap:last-child {
    margin-bottom: 0;
}

.dflex-minicart-progress-msg {
    margin: 0 0 5px;
    font-size: 13px;
    color: #555;
    text-align: center;
}

.dflex-minicart-progress-msg strong {
    color: #1a1a1a;
}

.dflex-minicart-progress-msg.success {
    color: var(--dflex-color-success, #4CAF50);
    font-weight: 700;
}

.dflex-minicart-min-order-progress {
    background: var(--dflex-color-primary, #E53935);
}

.dflex-minicart-free-shipping-progress {
    background: var(--dflex-color-success, #4CAF50);
}

/* Successfully reached states */
.dflex-minicart-min-order .dflex-minicart-progress-msg.success+.dflex-progress-bar .dflex-minicart-min-order-progress,
.dflex-minicart-free-shipping .dflex-minicart-progress-msg.success+.dflex-progress-bar .dflex-minicart-free-shipping-progress {
    background: var(--dflex-color-success, #4CAF50);
}

.dflex-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
}

.dflex-progress {
    height: 100%;
    border-radius: 10px;
    width: var(--dflex-progress-w, 0%);
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.dflex-minicart-clear-btn {
    background: none !important;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    color: #888 !important;
    text-decoration: underline;
    display: block;
    margin-bottom: 10px;
}

.dflex-minicart-clear-btn:hover {
    color: var(--dflex-color-primary, #E53935) !important;
}

.dflex-minicart-items-list {
    padding: 20px 30px;
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.dflex-minicart-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    transition: opacity 0.3s;
}

.dflex-minicart-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

.dflex-minicart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 16px;
}

.dflex-minicart-item-img a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.dflex-minicart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dflex-minicart-item-info {
    flex-grow: 1;
    padding-right: 20px;
    /* Space for absolute close button */
}

.dflex-minicart-item-title {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: var(--dflex-card-title-weight, 600);
    line-height: 1.3;
}

.dflex-minicart-item-title a {
    color: #111827;
    text-decoration: none;
}

.dflex-minicart-item-title .mcl-addons-inline {
    display: block;
    font-weight: normal;
}

.dflex-minicart-item-addons {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

/* Variation output fixes from Woo */
.dflex-minicart-item-info dl.variation {
    font-size: 12px;
    color: #888;
    margin: 0 0 10px;
}

.dflex-minicart-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dflex-minicart-qty-control {
    display: flex;
    align-items: center;
    background: #f3f3f7;
    border-radius: 6px;
    overflow: hidden;
}

.dflex-minicart-qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 8px;
    padding: 0;
    border: none;
}

/* Hover handled globally or specific to text color if needed */

.dflex-minicart-qty-val {
    width: 30px;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.dflex-minicart-qty-val::-webkit-outer-spin-button,
.dflex-minicart-qty-val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dflex-minicart-item-price {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.dflex-minicart-item-price .fa-times::before {
    font-size: 10px;
}

.dflex-minicart-remove-item {
    position: absolute;
    top: 14px;
    right: 0;
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    background: none !important;
    color: var(--dflex-color-error, #ff3b30) !important;
    transition: opacity 0.2s;
}

.dflex-minicart-remove-item:hover {
    opacity: 0.8;
}

/* Footer */
.dflex-minicart-footer {
    background: #fdfdfd;
    padding: 24px 30px;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.02);
}

.dflex-minicart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dflex-minicart-total strong {
    font-size: 16px;
    color: #1a1a1a;
}

.dflex-minicart-total .amount {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.dflex-btn-checkout {
    display: flex;
    width: 100%;
}

.dflex-btn-checkout.disabled {
    opacity: 0.6;
    filter: grayscale(1);
    pointer-events: none;
    cursor: not-allowed;
    background: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
}

/* Hover handled globally */