/*
Theme Name: Agricoma Child - Swapped Behavior
Theme URI: https://ninetheme.com/
Description: Child theme for Agricoma with swapped product click behaviors. Product images now trigger Quick View, and Quick View buttons navigate to product pages.
Author: Ninetheme (Modified)
Author URI: https://ninetheme.com/about
Template: agricoma
Version: 3.0.0
License: GNU General Public License version 3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags: child-theme, woocommerce, product-behavior-swap
Text Domain: agricoma-child
*/

/* Import parent theme styles */
@import url("../agricoma/style.css");

/* ==========================================================================
   Product Behavior Swap Styles
   ========================================================================== */

/* Base styles for swapped behavior products */
.product-inner.behavior-swapped {
    position: relative;
}

/* Product image link modifications */
.product-inner.behavior-swapped .product-link {
    cursor: zoom-in;
    position: relative;
    transition: transform 0.2s ease;
}

.product-inner.behavior-swapped .product-link:hover {
    transform: scale(1.02);
}

/* Quick view button modifications */
.product-inner.behavior-swapped .ninetheme-quickview-btn {
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.product-inner.behavior-swapped .ninetheme-quickview-btn:hover {
    transform: scale(1.1);
}

/* Visual indicators for swapped behavior */
.product-inner.behavior-swapped .product-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.product-inner.behavior-swapped .product-link:hover::before {
    opacity: 1;
}

/* Subtle hint text on hover */
.product-inner.behavior-swapped .product-link::after {
    content: "Quick View";
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.product-inner.behavior-swapped .product-link:hover::after {
    opacity: 1;
}

/* Quick view button hover effect */
.product-inner.behavior-swapped .ninetheme-quickview-btn .ninetheme-hint {
    content: "View Product";
}

/* Enhanced hover states */
.product-inner.behavior-swapped .ninetheme-quickview-btn:hover {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.product-inner.behavior-swapped .ninetheme-quickview-btn:hover svg {
    fill: #22c55e;
}

/* Loading state */
.product-inner.behavior-swapped.loading {
    pointer-events: none;
}

.product-inner.behavior-swapped.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 100;
    pointer-events: none;
}

.product-inner.behavior-swapped.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 101;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success state */
.product-inner.behavior-swapped.success .product-link {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

/* Error state */
.product-inner.behavior-swapped.error .product-link {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

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

/* Mobile adjustments */
@media (max-width: 768px) {
    .product-inner.behavior-swapped .product-link::after {
        font-size: 10px;
        padding: 4px 8px;
        top: 8px;
        left: 8px;
    }

    .product-inner.behavior-swapped .product-link:hover {
        transform: none; /* Remove zoom effect on mobile */
    }

    .product-inner.behavior-swapped .ninetheme-quickview-btn {
        min-width: 44px; /* Larger touch target */
        min-height: 44px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-inner.behavior-swapped .product-link::after {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* Large desktop adjustments */
@media (min-width: 1200px) {
    .product-inner.behavior-swapped .product-link:hover {
        transform: scale(1.03);
    }
}

/* ==========================================================================
   Animation Enhancements
   ========================================================================== */

/* Smooth transitions for all interactive elements */
.product-inner.behavior-swapped .product-link,
.product-inner.behavior-swapped .ninetheme-quickview-btn,
.product-inner.behavior-swapped .ninetheme-quickview-btn svg {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Micro-interactions */
.product-inner.behavior-swapped .product-link:active {
    transform: scale(0.98);
}

.product-inner.behavior-swapped .ninetheme-quickview-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus states for keyboard navigation */
.product-inner.behavior-swapped .product-link:focus,
.product-inner.behavior-swapped .ninetheme-quickview-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-inner.behavior-swapped .product-link::after {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .product-inner.behavior-swapped .product-link,
    .product-inner.behavior-swapped .ninetheme-quickview-btn,
    .product-inner.behavior-swapped .product-link::after {
        transition: none;
    }

    .product-inner.behavior-swapped .product-link:hover {
        transform: none;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(0deg); }
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .product-inner.behavior-swapped .product-link::after {
        background: rgba(255, 255, 255, 0.9);
        color: #000;
    }

    .product-inner.behavior-swapped .ninetheme-quickview-btn:hover {
        background-color: rgba(34, 197, 94, 0.2);
    }
}

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

@media print {
    .product-inner.behavior-swapped .product-link::after,
    .product-inner.behavior-swapped .ninetheme-quickview-btn {
        display: none;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Hidden but accessible for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Temporary visual feedback */
.visual-feedback {
    position: relative;
    overflow: hidden;
}

.visual-feedback::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 1;
}

.visual-feedback.active::before {
    width: 200%;
    height: 200%;
}

/* ==========================================================================
   Custom Quick View Modal Styles
   ========================================================================== */

.custom-quick-view-overlay {
    animation: fadeIn 0.3s ease-out;
}

.custom-quick-view-modal {
    animation: slideUp 0.3s ease-out;
}

.custom-quick-view-content {
    text-align: center;
}

.custom-quick-view-content .product-image {
    max-width: 100%;
    height: auto;
    margin: 0 auto 20px;
    border-radius: 8px;
}

.custom-quick-view-content h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 24px;
    line-height: 1.3;
}

.custom-quick-view-content .product-price {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: #22c55e;
}

.custom-quick-view-content .product-description {
    margin-bottom: 20px;
    text-align: left;
    color: #666;
    line-height: 1.6;
}

.custom-quick-view-content .product-meta {
    margin-bottom: 25px;
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.custom-quick-view-content .product-meta p {
    margin: 5px 0;
    font-size: 14px;
}

.custom-quick-view-content .product-meta strong {
    color: #333;
}

.custom-quick-view-content .add-to-cart-wrapper {
    margin-top: 25px;
}

.custom-quick-view-content .button {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.custom-quick-view-content .button:hover {
    background: #2563eb;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Debug mode styles */
.product-swap-debug {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    z-index: 100000;
    max-width: 300px;
    word-wrap: break-word;
}

/* Event prevention indicator */
.event-prevented {
    position: relative;
}

.event-prevented::after {
    content: "🚫 Event Blocked";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    z-index: 1000;
    pointer-events: none;
}

/* ==========================================================================
   Navigation Blocking (CRITICAL for preventing redirects)
   ========================================================================== */

.navigation-blocked {
    pointer-events: none !important;
    position: relative;
}

.navigation-blocked::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    z-index: 1000;
    pointer-events: none;
}

.navigation-blocked .product-link {
    cursor: wait !important;
}

/* Enhanced behavior swapped styles v2.0 */
.behavior-swapped-v2 .product-link {
    cursor: zoom-in;
    position: relative;
    transition: all 0.3s ease;
}

.behavior-swapped-v2 .product-link:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.behavior-swapped-v2 .ninetheme-quickview-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.behavior-swapped-v2 .ninetheme-quickview-btn:hover {
    transform: scale(1.05);
    background-color: rgba(34, 197, 94, 0.1);
}

/* Enhanced visual feedback */
.behavior-swapped-v2 .product-link::after {
    content: "Quick View";
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.behavior-swapped-v2 .product-link:hover::after {
    opacity: 1;
}

.behavior-swapped-v2 .ninetheme-quickview-btn .ninetheme-hint {
    content: "View Product" !important;
}

/* Click feedback animation */
.click-feedback {
    pointer-events: none;
    z-index: 10001;
}

/* Error message styling */
.product-swap-error {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
}

/* Custom quick view modal enhancements */
.custom-quick-view-overlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.custom-quick-view-modal {
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .behavior-swapped-v2 .product-link::after {
        font-size: 10px;
        padding: 6px 10px;
        top: 8px;
        left: 8px;
    }

    .behavior-swapped-v2 .product-link:hover {
        transform: none; /* Remove zoom effect on mobile for better UX */
    }

    .custom-quick-view-modal {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .behavior-swapped-v2 .product-link::after {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .behavior-swapped-v2 .product-link,
    .behavior-swapped-v2 .ninetheme-quickview-btn,
    .behavior-swapped-v2 .product-link::after,
    .click-feedback {
        transition: none;
    }

    .behavior-swapped-v2 .product-link:hover {
        transform: none;
    }

    .custom-quick-view-overlay,
    .custom-quick-view-modal {
        animation: none;
    }
}