/**
 * GI Product Actions Styles
 * 
 * Unified styles for product action buttons and modals
 * 
 * @package Grabit
 * @version 1.0
 */

/* ==========================================================================
   Product Actions Base
   ========================================================================== */

.gi-pro-actions {
    pointer-events: auto;
}

.gi-pro-btn {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.gi-pro-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gi-pro-btn.loading {
    pointer-events: none;
}

.gi-pro-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: gi-spin 0.6s linear infinite;
}

@keyframes gi-spin {
    to { transform: rotate(360deg); }
}

/* Active states */
.gi-pro-btn.in-wishlist i,
.gi-pro-btn[aria-pressed="true"] i {
    color: #ff7070 !important;
}

.gi-pro-btn.in-compare i {
    color: #5caf90 !important;
}

/* Hover group effects */
.gi-product-inner:hover .gi-pro-actions,
.gi-product-content:hover .gi-pro-actions {
    opacity: 1 !important;
    bottom: 10px !important;
}

/* Mobile always visible */
@media (max-width: 991px) {
    .gi-pro-actions {
        opacity: 1 !important;
        bottom: 10px !important;
    }
}

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

.gi-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.gi-toast {
    min-width: 250px;
    padding: 12px 20px;
    background: #fff;
    border-left: 4px solid #5caf90;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    color: #4b5966;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.gi-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.gi-toast-success {
    border-left-color: #5caf90;
}

.gi-toast-error {
    border-left-color: #ff7070;
}

.gi-toast-info {
    border-left-color: #4b9ce2;
}

/* Mobile toast position */
@media (max-width: 767px) {
    .gi-toast-container {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
    }
    
    .gi-toast {
        min-width: auto;
        width: 100%;
    }
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.gi-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.gi-modal.active {
    opacity: 1;
    visibility: visible;
}

.gi-modal-content {
    position: relative;
    max-width: 900px;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.gi-modal.active .gi-modal-content {
    transform: scale(1);
}

.gi-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #777;
    transition: all 0.3s ease;
    z-index: 1;
}

.gi-modal-close:hover {
    background: #5caf90;
    color: #fff;
}

/* Mobile modal */
@media (max-width: 767px) {
    .gi-modal {
        padding: 10px;
    }
    
    .gi-modal-content {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ==========================================================================
   Focus Styles (Accessibility)
   ========================================================================== */

.gi-pro-btn:focus-visible {
    outline: 2px solid #5caf90;
    outline-offset: 2px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.gi-pro-btn.loading i {
    opacity: 0;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .gi-pro-actions,
    .gi-toast-container,
    .gi-modal {
        display: none !important;
    }
}

/* ==========================================================================
   Animation Utilities
   ========================================================================== */

@keyframes gi-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.gi-pro-btn.pulse {
    animation: gi-pulse 0.3s ease;
}

/* ==========================================================================
   Dark Mode Support (if needed)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .gi-toast {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .gi-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .gi-modal-close {
        background: #4a5568;
        color: #e2e8f0;
    }
}


