/**
 * Athena AI Agent - WooCommerce Integration Frontend Styles
 */

/* Base rule - force single column always */
.athena-wc-products {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 4px;
    margin: 12px 0;
    padding: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    grid-template-columns: none !important;
    column-count: 1 !important;
    columns: 1 !important;
}

/* Desktop: Ensure single column layout */
@media (min-width: 641px) {
    /* Force single column on desktop - override any parent styles */
    .athena-wc-products,
    * > .athena-wc-products,
    .aa-chat-log .athena-wc-products,
    .aa-messages .athena-wc-products,
    [class*="chat"] .athena-wc-products {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        grid-template-columns: none !important;
        column-count: 1 !important;
        columns: 1 !important;
    }
    
    .athena-wc-product-card {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
}

.athena-wc-product-card {
    display: flex !important;
    gap: 16px;
    padding: 16px 16px 8px 16px;
    margin-bottom: 0 !important;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.athena-wc-product-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.athena-wc-product-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.athena-wc-product-card .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.athena-wc-product-card .product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    margin: 0;
}

.athena-wc-product-card .product-name:hover {
    text-decoration: underline;
    color: #3b82f6;
}

.athena-wc-product-card .product-description {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.athena-wc-product-card .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
    margin-top: auto;
}

.athena-wc-product-card .product-price .regular-price {
    text-decoration: line-through;
    color: #94a3b8;
    margin-right: 8px;
    font-size: 14px;
}

.athena-wc-product-card .product-stock {
    font-size: 12px;
    color: #ef4444;
    font-weight: 600;
}

.athena-wc-product-card .product-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.athena-wc-product-card .button {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.athena-wc-product-card .button.view-product {
    background: #3b82f6;
    color: #fff;
}

.athena-wc-product-card .button.view-product:hover {
    background: #2563eb;
}

.athena-wc-product-card .button.add-to-cart {
    background: #10b981;
    color: #fff;
}

.athena-wc-product-card .button.add-to-cart:hover {
    background: #059669;
}

.athena-wc-product-card .button.add-to-cart:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 640px) {
    /* Force single column on mobile - override any parent styles */
    .athena-wc-products,
    * > .athena-wc-products,
    .aa-chat-log .athena-wc-products,
    .aa-messages .athena-wc-products,
    [class*="chat"] .athena-wc-products {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        grid-template-columns: none !important;
        column-count: 1 !important;
        columns: 1 !important;
    }
    
    .athena-wc-product-card {
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        display: flex !important;
    }
    
    .athena-wc-product-card img {
        width: 100% !important;
        height: 200px !important;
        max-width: 100% !important;
        flex-shrink: 0 !important;
    }
    
    .athena-wc-product-card .product-info {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    .athena-wc-product-card .product-actions {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .athena-wc-product-card .button {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
}

/* Additional mobile rules for very small screens */
@media (max-width: 480px) {
    .athena-wc-products {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .athena-wc-product-card {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Toast Notification Styles */
@keyframes athena-wc-toast-slide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes athena-wc-toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Quick View Modal Styles */
.athena-wc-quick-view-modal {
    animation: fadeIn 0.2s ease-out;
}

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

.athena-wc-quick-view-content {
    animation: slideUp 0.3s ease-out;
}

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

/* Product Specs Toggle Styles */
.athena-wc-specs-toggle {
    transition: all 0.2s ease;
}

.athena-wc-specs-toggle:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

.athena-wc-specs-content {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Quantity Input Styles */
.athena-wc-quantity {
    transition: border-color 0.2s ease;
}

.athena-wc-quantity:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* View Cart Button Styles */
.athena-wc-view-cart {
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease-out;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.athena-wc-view-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Cart Container - Keep buttons on one line */
.athena-wc-cart-container {
    flex-wrap: nowrap !important;
    align-items: center;
}

.athena-wc-cart-container .athena-wc-add-to-cart,
.athena-wc-cart-container .athena-wc-view-cart {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mobile adjustments for quick view */
@media (max-width: 640px) {
    .athena-wc-quick-view-content {
        max-width: 95% !important;
        margin: 10px;
    }
    
    .athena-wc-quick-view-content > div {
        padding: 20px !important;
    }
}



