/* ==========================================================================
   SIMATA Slide-Out Cart Drawer
   Professional, clean design — UI/UX optimised
   ========================================================================== */

/* ── Overlay ── */
.simata-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.simata-cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Cart Drawer ── */
.simata-cart-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    font-family: 'Merriweather Sans', sans-serif;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.simata-cart-drawer.open {
    right: 0;
}

/* ── Reset: prevent theme/Elementor button styles from bleeding in ── */
.simata-cart-drawer button,
.simata-cart-drawer a {
    font-family: 'Merriweather Sans', sans-serif !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ── Header ── */
.simata-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #ebebeb;
    flex-shrink: 0;
}

.simata-cart-title {
    font-size: 15px;
    font-weight: 400;
    color: #1a1a1a;
    margin: 0;
    text-transform: none;
    letter-spacing: 0.3px;
}

.simata-cart-count {
    font-weight: 400;
    color: #1a1a1a;
}

/* Close button */
.simata-cart-close {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: #999 !important;
    padding: 6px !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 0 !important;
    min-height: auto !important;
    width: auto !important;
    height: auto !important;
}

.simata-cart-close svg {
    width: 12px;
    height: 12px;
}

.simata-cart-close:hover {
    color: #1a1a1a !important;
    background: none !important;
}

/* ── Cart Items Container ── */
.simata-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.simata-cart-items::-webkit-scrollbar {
    width: 3px;
}

.simata-cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.simata-cart-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* ── Empty Cart ── */
.simata-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 30px;
    text-align: center;
}

.simata-cart-empty-icon {
    font-size: 44px;
    margin-bottom: 16px;
    opacity: 0.25;
}

.simata-cart-empty p {
    font-size: 14px;
    margin: 0 0 28px;
    color: #888;
    font-weight: 400;
}

/* ── Single Cart Item ── */
.simata-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 26px 30px;
    border-bottom: 1px solid #f2f2f2;
    position: relative;
    transition: opacity 0.2s;
}

/* Remove button — overlaid on top-left of image */
.simata-cart-item-remove {
    position: absolute;
    top: 18px;
    left: 22px;
    z-index: 2;
    flex-shrink: 0;
}

button.simata-cart-item-remove {
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 50% !important;
    color: #bbb !important;
    cursor: pointer;
    padding: 0 !important;
    line-height: 1 !important;
    transition: color 0.2s, border-color 0.2s;
    width: 18px !important;
    height: 18px !important;
    min-height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

button.simata-cart-item-remove svg {
    width: 7px;
    height: 7px;
}

button.simata-cart-item-remove:hover {
    color: #666 !important;
    border-color: #aaa !important;
    background: #fff !important;
}

/* Product image */
.simata-cart-item-image {
    width: 82px;
    height: 82px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    border-radius: 2px;
}

.simata-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Details column */
.simata-cart-item-details {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

/* Top row: Name left, Price right */
.simata-cart-item-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 2px;
}

/* Product name */
.simata-cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.45;
    flex: 1;
    min-width: 0;
}

.simata-cart-item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.simata-cart-item-name a:hover {
    color: #555;
}

/* Middle row: Attributes left, Savings right */
.simata-cart-item-row-mid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 14px;
}

/* Attributes */
.simata-cart-item-meta {
    font-size: 11.5px;
    color: #999;
    margin: 0;
    line-height: 1.55;
    flex: 1;
}

.simata-cart-item-meta span {
    display: block;
}

/* Pricing */
.simata-cart-item-price {
    font-size: 13px;
    color: #1a1a1a;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.45;
}

.simata-cart-item-price .regular-price {
    text-decoration: line-through;
    color: #bbb;
    margin-right: 5px;
    font-size: 12px;
    font-weight: 400;
}

.simata-cart-item-price .sale-price {
    color: #1a1a1a;
    font-weight: 600;
}

/* Savings badge */
.simata-cart-item-savings {
    font-size: 11px;
    color: #2e9e2e;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

/* ── Quantity Controls ──
   High specificity + !important to override WooCommerce/Elementor
   global button styles that add dark backgrounds */
.simata-cart-drawer .simata-cart-item-qty {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    border: 1px solid #d5d5d5 !important;
    border-radius: 0 !important;
    overflow: hidden;
    background: #fff !important;
}

.simata-cart-drawer .simata-cart-item-qty button,
.simata-cart-drawer .simata-cart-item-qty button.simata-qty-minus,
.simata-cart-drawer .simata-cart-item-qty button.simata-qty-plus {
    width: 30px !important;
    height: 30px !important;
    min-height: auto !important;
    background: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    font-weight: 300 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #555 !important;
    transition: background 0.15s, color 0.15s;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.simata-cart-drawer .simata-cart-item-qty button:hover {
    background: #fafafa !important;
    color: #1a1a1a !important;
}

.simata-cart-drawer .simata-cart-item-qty .qty-value {
    width: 34px !important;
    height: 30px !important;
    text-align: center;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    background: #fff !important;
    border-left: 1px solid #d5d5d5 !important;
    border-right: 1px solid #d5d5d5 !important;
    line-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ── Footer ── */
.simata-cart-footer {
    border-top: 1px solid #ebebeb;
    padding: 22px 30px 30px;
    flex-shrink: 0;
    background: #fff;
}

.simata-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
}

.simata-cart-subtotal-label {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.simata-cart-subtotal-value {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

/* Shipping note */
.simata-cart-shipping-note {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 20px;
    letter-spacing: 0.1px;
}

/* Checkout button */
.simata-cart-drawer .simata-cart-checkout-btn,
a.simata-cart-checkout-btn {
    display: block !important;
    width: 100% !important;
    padding: 14px 20px !important;
    background: #1a1a1a !important;
    color: #fff !important;
    border: 1px solid #1a1a1a !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    cursor: pointer;
    text-align: center !important;
    text-decoration: none !important;
    transition: background 0.25s, color 0.25s;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
    min-height: auto !important;
}

.simata-cart-drawer .simata-cart-checkout-btn:hover,
a.simata-cart-checkout-btn:hover {
    background: #333 !important;
    border-color: #333 !important;
    color: #fff !important;
}

a.simata-cart-checkout-btn:visited {
    color: #fff !important;
}

/* Continue Shopping — outlined button */
.simata-cart-drawer button.simata-cart-continue,
button.simata-cart-continue {
    display: block !important;
    width: 100% !important;
    padding: 14px 20px !important;
    margin-top: 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    cursor: pointer;
    background: #fff !important;
    border: 1px solid #1a1a1a !important;
    transition: background 0.25s;
    text-align: center !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    line-height: 1.4 !important;
    min-height: auto !important;
    box-shadow: none !important;
}

.simata-cart-drawer button.simata-cart-continue:hover,
button.simata-cart-continue:hover {
    background: #f8f8f8 !important;
    color: #1a1a1a !important;
    border-color: #1a1a1a !important;
}

/* ── Cart Toggle Button ──
   High specificity to override Elementor shortcode widget styles */
.simata-cart-toggle,
.elementor-shortcode .simata-cart-toggle,
.elementor-widget-shortcode .simata-cart-toggle,
button.simata-cart-toggle {
    cursor: pointer !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    min-height: auto !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.simata-cart-toggle:hover,
.elementor-shortcode .simata-cart-toggle:hover {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.simata-cart-toggle-icon,
.elementor-shortcode .simata-cart-toggle-icon {
    font-size: 20px !important;
    line-height: 1 !important;
    color: #000 !important;
}

.simata-cart-toggle-count,
.elementor-shortcode .simata-cart-toggle-count {
    position: absolute !important;
    top: -6px !important;
    right: -10px !important;
    background: #997c60 !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.simata-cart-toggle-count:empty,
.simata-cart-toggle-count[data-count="0"] {
    display: none !important;
}

/* Override any FunnelKit Cart styles that may still load */
.fkcart-panel,
.fkcart-side-cart-wrap,
.fkcart-main-wrapper {
    display: none !important;
}

/* ── Loading States ── */
.simata-cart-loading {
    pointer-events: none;
    opacity: 0.5;
}

.simata-cart-item.updating {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s;
}

.simata-adding-to-cart {
    pointer-events: none;
    opacity: 0.55;
}

/* Body scroll lock */
body.simata-cart-open {
    overflow: hidden;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 600px) {
    .simata-cart-drawer {
        width: 100%;
        right: -100%;
    }

    .simata-cart-header {
        padding: 20px 22px;
    }

    .simata-cart-item {
        padding: 22px 22px;
        gap: 14px;
    }

    .simata-cart-item-image {
        width: 70px;
        height: 70px;
    }

    .simata-cart-item-remove {
        left: 14px;
        top: 14px;
    }

    .simata-cart-footer {
        padding: 20px 22px 26px;
    }
}

@media screen and (min-width: 601px) and (max-width: 768px) {
    .simata-cart-drawer {
        width: 400px;
        right: -400px;
    }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.simata-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    z-index: 1000000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 0;
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 90vw;
}

.simata-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.simata-toast-error {
    background: #fef2f2;
    border: 1px solid #e8c4c4;
    color: #7f2d2d;
}

.simata-toast-success {
    background: #f0fdf4;
    border: 1px solid #bbdfc8;
    color: #1a5c2e;
}

.simata-toast-msg {
    flex: 1;
}

.simata-toast-close {
    background: none !important;
    border: none !important;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    padding: 0 !important;
    line-height: 1;
    opacity: 0.5;
    min-height: auto !important;
}

.simata-toast-close:hover {
    opacity: 1;
}
