/**
 * Annapoorna WooCommerce Complete - Mini Cart Widget Styles
 *
 * @package Annapoorna_WooCommerce_Complete
 * @version 2.0.0
 */

/* ============================================
   Mini Cart Wrapper
   ============================================ */
.annapoorna-mini-cart-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

/* ============================================
   Cart Trigger Button
   ============================================ */
.annapoorna-mini-cart-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.annapoorna-mini-cart-trigger:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.annapoorna-mini-cart-trigger:active {
    transform: scale(0.95);
}

/* ============================================
   Cart Icon (SVG)
   ============================================ */
.annapoorna-cart-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
    transition: fill 0.3s ease;
}

.annapoorna-mini-cart-trigger:hover .annapoorna-cart-icon {
    fill: #4CAF50;
}

/* Icon Color Variants */
.annapoorna-mini-cart-wrapper.light .annapoorna-cart-icon {
    fill: #ffffff;
}

.annapoorna-mini-cart-wrapper.dark .annapoorna-cart-icon {
    fill: #333333;
}

.annapoorna-mini-cart-wrapper.green .annapoorna-cart-icon {
    fill: #4CAF50;
}

/* ============================================
   Cart Badge (Count)
   ============================================ */
.annapoorna-cart-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    background: #ff5722;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.annapoorna-cart-badge.empty {
    display: none;
}

.annapoorna-mini-cart-trigger:hover .annapoorna-cart-badge {
    transform: scale(1.1);
}

/* Badge update animation */
@keyframes badge-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.annapoorna-cart-badge.updated {
    animation: badge-pulse 0.4s ease;
}

/* Badge Color Variants */
.annapoorna-mini-cart-wrapper.green .annapoorna-cart-badge {
    background: #4CAF50;
}

.annapoorna-mini-cart-wrapper.orange .annapoorna-cart-badge {
    background: #ff9800;
}

.annapoorna-mini-cart-wrapper.red .annapoorna-cart-badge {
    background: #f44336;
}

/* ============================================
   Loading State
   ============================================ */
.annapoorna-mini-cart-wrapper.loading .annapoorna-cart-icon {
    opacity: 0.5;
    animation: cart-pulse 1s ease-in-out infinite;
}

@keyframes cart-pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================
   Size Variants
   ============================================ */
/* Small */
.annapoorna-mini-cart-wrapper.size-small .annapoorna-cart-icon {
    width: 20px;
    height: 20px;
}

.annapoorna-mini-cart-wrapper.size-small .annapoorna-cart-badge {
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    top: 3px;
    right: 3px;
}

/* Medium (default) */
.annapoorna-mini-cart-wrapper.size-medium .annapoorna-cart-icon {
    width: 28px;
    height: 28px;
}

.annapoorna-mini-cart-wrapper.size-medium .annapoorna-cart-badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
}

/* Large */
.annapoorna-mini-cart-wrapper.size-large .annapoorna-cart-icon {
    width: 36px;
    height: 36px;
}

.annapoorna-mini-cart-wrapper.size-large .annapoorna-cart-badge {
    min-width: 24px;
    height: 24px;
    font-size: 12px;
    top: 8px;
    right: 8px;
}

/* ============================================
   Style Variants
   ============================================ */
/* Outlined Style */
.annapoorna-mini-cart-wrapper.style-outlined .annapoorna-mini-cart-trigger {
    border: 2px solid currentColor;
    border-radius: 50%;
    padding: 12px;
}

.annapoorna-mini-cart-wrapper.style-outlined .annapoorna-mini-cart-trigger:hover {
    background: rgba(76, 175, 80, 0.1);
}

/* Filled Style */
.annapoorna-mini-cart-wrapper.style-filled .annapoorna-mini-cart-trigger {
    background: #4CAF50;
    border-radius: 50%;
    padding: 12px;
}

.annapoorna-mini-cart-wrapper.style-filled .annapoorna-cart-icon {
    fill: #ffffff;
}

.annapoorna-mini-cart-wrapper.style-filled .annapoorna-mini-cart-trigger:hover {
    background: #45a049;
}

/* Rounded Style */
.annapoorna-mini-cart-wrapper.style-rounded .annapoorna-mini-cart-trigger {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 12px 16px;
}

.annapoorna-mini-cart-wrapper.style-rounded .annapoorna-mini-cart-trigger:hover {
    background: #e0e0e0;
}

/* ============================================
   Cart Label (Optional)
   ============================================ */
.annapoorna-cart-label {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 600;
    color: currentColor;
    white-space: nowrap;
}

.annapoorna-mini-cart-wrapper.hide-label .annapoorna-cart-label {
    display: none;
}

/* ============================================
   Elementor Integration
   ============================================ */
.elementor-widget-annapoorna-mini-cart .annapoorna-mini-cart-wrapper {
    display: flex;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .annapoorna-mini-cart-trigger {
        padding: 8px;
    }

    .annapoorna-cart-icon {
        width: 24px;
        height: 24px;
    }

    .annapoorna-cart-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        top: 3px;
        right: 3px;
    }

    /* Hide label on mobile by default */
    .annapoorna-cart-label {
        display: none;
    }

    .annapoorna-mini-cart-wrapper.show-label-mobile .annapoorna-cart-label {
        display: inline-block;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .annapoorna-cart-icon {
        width: 22px;
        height: 22px;
    }

    .annapoorna-cart-badge {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.annapoorna-mini-cart-trigger:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.annapoorna-mini-cart-trigger:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only text */
.annapoorna-cart-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   Animation when item is added
   ============================================ */
@keyframes cart-shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

.annapoorna-mini-cart-wrapper.item-added .annapoorna-cart-icon {
    animation: cart-shake 0.5s ease;
}

/* ============================================
   Dark Mode Support
   ============================================ */
@media (prefers-color-scheme: dark) {
    .annapoorna-mini-cart-wrapper:not(.light):not(.dark) .annapoorna-cart-icon {
        fill: #ffffff;
    }

    .annapoorna-mini-cart-wrapper.style-filled .annapoorna-mini-cart-trigger {
        background: #45a049;
    }

    .annapoorna-mini-cart-wrapper.style-rounded .annapoorna-mini-cart-trigger {
        background: #2c2c2c;
    }

    .annapoorna-mini-cart-wrapper.style-rounded .annapoorna-mini-cart-trigger:hover {
        background: #3c3c3c;
    }
}

/* ============================================
   RTL Support
   ============================================ */
[dir="rtl"] .annapoorna-cart-badge {
    right: auto;
    left: 5px;
}

[dir="rtl"] .annapoorna-cart-label {
    margin-left: 0;
    margin-right: 8px;
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
    .annapoorna-mini-cart-trigger {
        border: 2px solid currentColor;
    }

    .annapoorna-cart-badge {
        border: 2px solid #000;
    }
}
