/* Floating Cart - visible on plugin pages */
.aiq-floating-cart-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9990;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.aiq-cart-bubble {
    height: 60px;
    width: 60px;
    background: var(--aiq-floating-cart-bg-color, #667eea) !important;
    color: var(--aiq-floating-cart-icon-color, #ffffff) !important;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    font-size: 24px;
}

.aiq-sr-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.aiq-cart-bubble:hover {
    background: var(--aiq-floating-cart-hover-color, #15803d) !important;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.aiq-cart-bubble:focus-visible,
.aiq-cart-mini-close:focus-visible,
.aiq-cart-mini-checkout-btn:focus-visible,
.aiq-cart-mini-view-cart-btn:focus-visible,
.aiq-sidebar-close:focus-visible,
.aiq-sidebar-checkout-btn:focus-visible,
.aiq-sidebar-remove-btn:focus-visible,
.aiq-sidebar-qty-btn:focus-visible,
.aiq-checkout-modal-close:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

.aiq-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d32f2f;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.aiq-cart-mini-panel {
    display: none;
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.aiq-cart-mini-panel.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aiq-cart-mini-header {
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.aiq-cart-mini-close {
    width: 36px;
    height: 36px;
    padding: 15px;
    border: none;
    border-radius: 999px;
    background: var(--aiq-close-btn-bg-color, #2c5d3f) !important;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(44, 93, 63, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.aiq-cart-mini-close:hover {
    background: var(--aiq-close-btn-hover-color, #1e4129) !important;
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 10px 24px rgba(30, 65, 41, 0.35);
}

.aiq-cart-mini-items {
    flex: 1;
    background: #fff;
    overflow-y: auto;
    padding: 12px;
}

.aiq-cart-mini-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.aiq-cart-mini-item:last-child {
    border-bottom: none;
}

.aiq-cart-mini-item-image {
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.aiq-cart-mini-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aiq-cart-mini-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.aiq-cart-mini-item-name {
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.3;
}

.aiq-cart-mini-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.aiq-cart-mini-item-price-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.aiq-cart-mini-item-price-original {
    text-decoration: line-through;
    color: #9ca3af;
}

.aiq-cart-mini-item-discount {
    font-size: 11px;
    color: #16a34a;
    margin-top: 4px;
}

.aiq-cart-mini-footer {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aiq-cart-mini-total {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.aiq-cart-mini-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
}

.aiq-cart-mini-summary-discount-row {
    color: #16a34a;
}

.aiq-cart-mini-summary-total-row {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-top: 2px;
}

.aiq-cart-mini-summary-subtotal {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 12px;
    margin-right: 8px;
}

.aiq-cart-mini-summary-total {
    color: #111827;
}

.aiq-cart-mini-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.aiq-cart-mini-checkout-btn {
    width: 100%;
    padding: 12px;
    background: var(--aiq-floating-cta-bg-color, #16a34a);
    color: var(--aiq-floating-cta-text-color, #ffffff);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.aiq-cart-mini-checkout-btn:hover {
    background: var(--aiq-floating-cta-hover-color, #15803d);
}

.aiq-cart-mini-view-cart-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: var(--aiq-floating-cta-bg-color, #16a34a);
    border: 1px solid var(--aiq-floating-cta-bg-color, #16a34a);
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.aiq-cart-mini-view-cart-btn:hover {
    background: var(--aiq-floating-cta-hover-color, #15803d);
    color: var(--aiq-floating-cta-text-color, #ffffff);
    border-color: var(--aiq-floating-cta-hover-color, #15803d);
}

/* Sidebar */
.aiq-sidebar-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    animation: fadeIn 0.3s ease;
}

.aiq-sidebar-overlay.active {
    display: block;
}

.aiq-sidebar-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    z-index: 10001;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.aiq-sidebar-panel.active {
    right: 0;
}

.aiq-sidebar-header {
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aiq-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.aiq-sidebar-close {
    width: 36px;
    height: 36px;
    padding: 15px;
    border-radius: 999px;
    border: none;
    background: var(--aiq-close-btn-bg-color, #2c5d3f) !important;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(44, 93, 63, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.aiq-sidebar-close:hover {
    background: var(--aiq-close-btn-hover-color, #1e4129) !important;
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 10px 24px rgba(30, 65, 41, 0.35);
}

.aiq-sidebar-content {
    flex: 1;
    background: #fff;
    padding: 20px;
    overflow-y: auto;
}

.aiq-sidebar-section {
    margin-bottom: 24px;
}

.aiq-sidebar-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aiq-sidebar-cart-item-card {
    display: flex;
    gap: 16px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.aiq-sidebar-cart-item-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.aiq-sidebar-item-image-wrapper {
    flex-shrink: 0;
    width: 82px;
    height: 82px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiq-sidebar-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aiq-sidebar-item-image-placeholder {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 10px;
}

.aiq-sidebar-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.aiq-sidebar-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
    padding-right: 34px;
}

.aiq-sidebar-item-quantity {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aiq-sidebar-item-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.aiq-sidebar-item-quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px;
}

.aiq-sidebar-qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.aiq-sidebar-qty-btn:hover {
    border-color: #d1d5db;
    background: #ffffff;
    transform: none;
}

.aiq-sidebar-qty-btn:active {
    transform: none;
}

.aiq-sidebar-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #dc2626;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.aiq-sidebar-remove-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    transform: scale(1.05);
}

.qty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: #0ea5e9;
    color: #ffffff;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
}

.aiq-sidebar-item-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
    margin-top: auto;
}

.item-unit-price {
    font-size: 12px;
    color: #6b7280;
}

.item-total-price {
    font-size: 15px;
    font-weight: 600;
    color: #0284c7;
}

.item-total-price-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.item-total-price-original {
    font-size: 12px;
    text-decoration: line-through;
    color: #9ca3af;
}

.aiq-sidebar-item-discount {
    font-size: 12px;
    color: #16a34a;
    margin-top: 0;
}

.aiq-sidebar-cart-summary-item {
    display: none;
}

.aiq-sidebar-cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #4b5563;
}

.aiq-sidebar-cart-summary-discount {
    color: #16a34a;
}

.aiq-sidebar-cart-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-weight: 600;
    font-size: 16px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 2px solid #e0e0e0;
    margin-bottom: 16px;
}

.aiq-sidebar-checkout-btn {
    width: 100%;
    padding: 12px;
    background: var(--aiq-floating-cta-bg-color, #16a34a);
    color: var(--aiq-floating-cta-text-color, #ffffff);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.aiq-sidebar-checkout-btn:hover:not(:disabled) {
    background: var(--aiq-floating-cta-hover-color, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.aiq-sidebar-checkout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.aiq-sidebar-checkout-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Checkout Modal */
.aiq-checkout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.aiq-checkout-modal-overlay.active {
    display: flex;
}

.aiq-checkout-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.aiq-checkout-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.aiq-checkout-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.aiq-checkout-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiq-checkout-modal-close:hover {
    color: #333;
}

.aiq-checkout-modal-content {
    flex: 1;
    overflow: auto;
}

.aiq-checkout-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .aiq-floating-cart-widget {
        bottom: 20px;
        right: 20px;
    }

    .aiq-cart-mini-panel {
        width: calc(100vw - 40px);
        max-width: 350px;
        bottom: 80px;
        right: -20px;
    }

    .aiq-sidebar-panel {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }

    .aiq-sidebar-panel.active {
        right: 0;
    }

    .aiq-sidebar-cart-item-card {
        flex-direction: column;
        gap: 12px;
    }

    .aiq-sidebar-item-image-wrapper {
        width: 100%;
        height: 150px;
    }

    .aiq-checkout-modal {
        width: 95%;
        max-width: 95%;
        height: 95vh;
        max-height: 95vh;
    }
}
