/* =========================================================
   UNIVERSAL CUSTOM CART
   Completely isolated from WooCommerce / Elementor
   ========================================================= */

.custom-cart-wrapper {
    --cart-black: #ff0000;
    --cart-white: #ffffff;
    --cart-text: #111111;
    --cart-muted: #777777;
    --cart-border: #eeeeee;
    --cart-green: #008f16;

    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 99990;
}

.custom-cart-trigger {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    color: var(--cart-black) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.custom-cart-icon {
    width: 33px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-cart-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.custom-cart-count {
    position: absolute;
    top: -5px;
    right: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 50%;
    background: #000000;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 17px;
    text-align: center;
    pointer-events: none;
}

/* Overlay (Appended to Body via JS for proper dimming)[cite: 8] */
.custom-cart-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.68);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    z-index: 99998;
}

.custom-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Drawer (Appended to Body via JS to escape Elementor container traps)[cite: 8] */
.custom-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(535px, 88vw);
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(.22,.61,.36,1);
    z-index: 99999;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.custom-cart-drawer.is-open {
    transform: translateX(0);
}

.custom-cart-header {
    flex: 0 0 auto;
    height: 68px;
    padding: 0 32px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--cart-border);
    background: #ffffff;
}

.custom-cart-title {
    margin: 0;
    padding: 0;
    color: var(--cart-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.2px;
}

.custom-cart-close {
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0 !important;
    margin: 0 6px 0 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-cart-close span {
    position: absolute;
    left: 2px;
    top: 11px;
    width: 20px;
    height: 1.5px;
    background: #111111;
    display: block;
}

.custom-cart-close span:first-child {
    transform: rotate(45deg);
}

.custom-cart-close span:last-child {
    transform: rotate(-45deg);
}

.custom-cart-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
}

.custom-cart-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.custom-cart-shipping {
    padding: 13px 18px 12px;
    border-bottom: 1px solid #f2f2f2;
    background: #ffffff;
}

.custom-cart-shipping-message {
    min-height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    color: #008f16;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.3;
}

.custom-cart-shipping-message strong {
    font-size: 16px;
    font-weight: 600;
}

.custom-cart-shipping-message span {
    font-size: 15px;
}

.custom-cart-shipping-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: #333333;
    font-size: 11px;
}

.custom-cart-shipping-labels .woocommerce-Price-amount {
    font-size: 11px;
}

.custom-cart-progress {
    width: 100%;
    height: 5px;
    background: #dddddd;
    overflow: hidden;
    border-radius: 10px;
}

.custom-cart-progress-bar {
    height: 100%;
    min-width: 0;
    background: #009b17;
    border-radius: inherit;
    transition: width 0.35s ease;
}

.custom-cart-items {
    flex: 1 1 auto;
    display: block;
}

.custom-cart-item {
    position: relative;
    display: flex;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid #eeeeee;
    background: #ffffff;
}

.custom-cart-item-image {
    flex: 0 0 85px !important;
    width: 85px !important;
    height: auto !important;
    aspect-ratio: 544 / 850 !important;
    overflow: hidden;
    background: #f5f5f5;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.custom-cart-item-image a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.custom-cart-item-image img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
    margin: 0 !important;
}

.custom-cart-item-details {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.custom-cart-item-name {
    display: block;
    margin: 1px 0 6px;
    color: #111111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.custom-cart-item-name:hover {
    opacity: 0.65;
}

.custom-cart-item-price {
    margin-bottom: 7px;
    color: #777777;
    font-size: 13px;
    line-height: 1.2;
}

.custom-cart-item-price .woocommerce-Price-amount {
    font-size: inherit;
}

.custom-cart-item-stock {
    margin-bottom: auto;
    font-size: 12px;
    line-height: 1.2;
}

.custom-cart-item-stock.in-stock {
    color: #00a51a;
}

.custom-cart-item-stock.out-of-stock {
    color: #d00000;
}

.custom-cart-item-bottom {
    width: 100%;
    margin-top: 10px;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

.custom-cart-quantity {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
}

.custom-cart-qty-minus,
.custom-cart-qty-plus {
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 50% !important;
    background: #000000 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.custom-cart-qty-minus:hover,
.custom-cart-qty-plus:hover {
    opacity: 0.8;
}

.custom-cart-qty-minus:active,
.custom-cart-qty-plus:active {
    transform: scale(0.9);
}

.custom-cart-qty-value {
    min-width: 14px;
    color: #111111;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
}

.custom-cart-remove {
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #111111 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: opacity 0.2s ease;
}

.custom-cart-remove:hover {
    opacity: 0.55;
}

.custom-cart-remove svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
}

.custom-cart-coupon-section {
    margin-bottom: 15px;
}

.custom-cart-coupon-form {
    display: flex;
    gap: 8px;
}

.custom-cart-coupon-input {
    flex: 1;
    height: 41px;
    padding: 0 12px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    outline: none;
    background: #ffffff;
    color: #111111;
}

.custom-cart-coupon-input:focus {
    border-color: #111111;
}

.custom-cart-coupon-btn {
    height: 41px;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #111111 !important;
    color: #ffffff !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    white-space: nowrap;
}

.custom-cart-coupon-btn:hover {
    background: #333333 !important;
}

.custom-cart-coupon-error {
    margin-top: 6px;
    color: #d00000;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    display: none;
}

.custom-cart-coupon-success {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #008f16;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.custom-cart-coupon-remove {
    background: transparent !important;
    border: 0 !important;
    color: #777777 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    text-decoration: underline;
    padding: 0 !important;
    box-shadow: none !important;
}

.custom-cart-coupon-remove:hover {
    color: #d00000 !important;
}

.custom-cart-footer {
    position: sticky;
    bottom: 0;
    flex: 0 0 auto;
    padding: 19px 20px 28px;
    background: #ffffff;
    border-top: 1px solid #eeeeee;
    z-index: 10;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.03);
}

.custom-cart-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #111111;
    font-size: 16px;
    font-weight: 400;
}

.custom-cart-subtotal strong {
    font-size: 16px;
    font-weight: 500;
}

.custom-cart-discount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #008f16;
    font-size: 15px;
    font-weight: 400;
}

.custom-cart-discount strong {
    font-size: 15px;
    font-weight: 500;
}

.custom-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-top: 10px;
    border-top: 1px solid #eeeeee;
    color: #111111;
    font-size: 16px;
    font-weight: 600;
}

.custom-cart-total strong {
    font-size: 16px;
    font-weight: 700;
}

.custom-cart-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
}

.custom-cart-button {
    min-height: 41px;
    padding: 12px 14px !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 8px !important;
    background: #111111 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 1.8px !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: background 0.2s ease, transform 0.15s ease;
}

.custom-cart-button:hover {
    background: #333333 !important;
    color: #ffffff !important;
}

.custom-cart-button:active {
    transform: scale(0.98);
}

.custom-cart-button.custom-cart-continue {
    background: #111111 !important;
    color: #ffffff !important;
}

.custom-cart-empty {
    min-height: 360px;
    padding: 50px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.custom-cart-empty-icon {
    width: 65px;
    height: 65px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dddddd;
    border-radius: 50%;
}

.custom-cart-empty-icon svg {
    width: 32px;
    height: 32px;
}

.custom-cart-empty h3 {
    margin: 0 0 8px;
    color: #111111;
    font-size: 15px;
    font-weight: 500;
}

.custom-cart-empty p {
    margin: 0;
    color: #777777;
    font-size: 13px;
}

.custom-cart-wrapper.is-loading .custom-cart-inner {
    opacity: 0.55;
    pointer-events: none;
}

.custom-cart-wrapper.is-loading .custom-cart-drawer {
    cursor: wait;
}

body.custom-cart-locked {
    overflow: hidden !important;
    touch-action: none;
}

@media (max-width: 767px) {
    .custom-cart-drawer {
        width: 88vw;
        max-width: 88vw;
    }
    .custom-cart-header {
        height: 62px;
        padding: 0 28px 0 16px;
    }
    .custom-cart-item {
        gap: 14px;
        padding: 14px 16px;
    }
    .custom-cart-item-image {
        flex-basis: 75px !important;
        width: 75px !important;
    }
    .custom-cart-item-name {
        font-size: 13px;
    }
    .custom-cart-footer {
        padding: 16px 16px 20px;
    }
}

@media (max-width: 380px) {
    .custom-cart-drawer {
        width: 85vw;
        max-width: 85vw;
    }
    .custom-cart-header {
        padding: 0 24px 0 12px;
    }
    .custom-cart-item {
        gap: 12px;
        padding: 13px 12px;
    }
    .custom-cart-item-image {
        flex-basis: 68px !important;
        width: 68px !important;
    }
    .custom-cart-item-name {
        font-size: 12px;
    }
    .custom-cart-item-price {
        font-size: 12px;
    }
    .custom-cart-item-stock {
        font-size: 11px;
    }
    .custom-cart-shipping {
        padding-left: 12px;
        padding-right: 12px;
    }
    .custom-cart-footer {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Hide default WooCommerce notices globally */
.woocommerce-notices-wrapper,
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    display: none !important;
}