/**
 * AO Search App - Pure WoodMart Theme CSS
 * 
 * Absolute minimal CSS - only overlay positioning.
 * Everything else inherits 100% from WoodMart theme.
 * 
 * @package Appearance_Overrides
 * @version 5.0.0
 */

/* ========================================
   Overlay - Full Screen Only
======================================== */
.ao-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aoFadeIn 0.15s ease-out;
}

.ao-search-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #fff;
    overflow: hidden;
}

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

body.ao-search-open {
    overflow: hidden !important;
}

/* ========================================
   Basic Layout Structure Only
======================================== */
.ao-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.ao-search-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ao-search-input {
    flex: 1;
    height: 44px;
    padding: 0;
    font-size: 16px;
    font-family: inherit;
    border: none;
    background: transparent;
    outline: none;
    color: inherit;
}

.ao-close-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ao-search-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
}

.ao-search-body > * {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   Grid - Responsive with reasonable defaults
======================================== */
.ao-instant-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

@media (min-width: 768px) {
    .ao-instant-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    .ao-instant-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1400px) {
    .ao-instant-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* ========================================
   Override ALL WoodMart Styles for Clean Cards
======================================== */

/* Hide all WoodMart-specific elements when using simple cards */
.ao-instant-grid .ao-simple-card .wd-hover-img,
.ao-instant-grid .ao-simple-card .product-labels,
.ao-instant-grid .ao-simple-card .wd-buttons,
.ao-instant-grid .ao-simple-card .wd-compare-btn,
.ao-instant-grid .ao-simple-card .wd-wishlist-btn,
.ao-instant-grid .ao-simple-card .wd-quick-view,
.ao-instant-grid .ao-simple-card .product-element-top,
.ao-instant-grid .ao-simple-card .product-wrapper {
    all: unset !important;
}

/* Remove hover image swaps - only show main image */
.ao-instant-grid .wd-hover-img,
.ao-instant-grid .hover-img {
    display: none !important;
}

/* Always show Add to Cart button - don't hide on hover */
.ao-instant-grid .wd-add-btn,
.ao-instant-grid .add-to-cart-button,
.ao-instant-grid .product .button,
.ao-instant-grid .wd-buttons {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Remove hover animations on product cards */
.ao-instant-grid .product:hover,
.ao-instant-grid .wd-product:hover {
    transform: none !important;
}

/* Disable quick view/compare/wishlist hovers that appear on hover */
.ao-instant-grid .wd-product .wd-compare-btn,
.ao-instant-grid .wd-product .wd-wishlist-btn,
.ao-instant-grid .wd-product .wd-quick-view {
    display: none !important;
}

/* Keep images simple - no zoom or transform effects */
.ao-instant-grid .product-element-top:hover img {
    transform: none !important;
}

/* Ensure buttons are always visible in button wrapper */
.ao-instant-grid .wd-bottom-actions,
.ao-instant-grid .wd-bottom-actions .wd-action-btn {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Clean card appearance - simple borders */
.ao-instant-grid .product-wrapper {
    border: 1px solid #e5e5e5;
    transition: border-color 0.2s ease;
}

.ao-instant-grid .product-wrapper:hover {
    border-color: #999;
}

/* ========================================
   Simple Card Styling - Meilisearch Demo Style
======================================== */
.ao-simple-card {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease !important;
    height: 100% !important;
}

.ao-simple-card * {
    box-sizing: border-box !important;
}

.ao-simple-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    border-color: #ccc !important;
}

.ao-simple-card-image {
    position: relative !important;
    display: block !important;
    padding-top: 100% !important;
    background: #f9f9f9 !important;
    overflow: hidden !important;
}

.ao-simple-card-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.ao-badge-sale {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: #ef4444 !important;
    color: #fff !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    z-index: 1 !important;
    letter-spacing: 0.5px !important;
}

.ao-simple-card-body {
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    flex: 1 !important;
    background: #fff !important;
}

.ao-simple-card-category {
    font-size: 11px !important;
    color: #888 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

.ao-simple-card-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    min-height: 40px !important;
}

.ao-simple-card-title a {
    color: #333 !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.ao-simple-card-title a:hover {
    color: #000 !important;
}

.ao-simple-card-price {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #333 !important;
    margin: 4px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ao-simple-card-price .price {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ao-simple-card-price del,
.ao-simple-card-price del .amount {
    color: #999 !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    text-decoration: line-through !important;
}

.ao-simple-card-price ins,
.ao-simple-card-price ins .amount {
    text-decoration: none !important;
    color: #ef4444 !important;
    font-weight: 700 !important;
}

.ao-simple-add-to-cart {
    width: 100% !important;
    padding: 12px 16px !important;
    background: #333 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
    margin-top: auto !important;
}

.ao-simple-add-to-cart:hover {
    background: #000 !important;
    transform: translateY(-1px) !important;
}

.ao-simple-add-to-cart.loading {
    opacity: 0.6 !important;
    cursor: wait !important;
}

.ao-simple-add-to-cart.added {
    background: #10b981 !important;
}

.ao-no-image {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #999 !important;
    font-size: 12px !important;
    background: #f9f9f9 !important;
}

.ao-price-skeleton {
    display: inline-block !important;
    width: 80px !important;
    height: 24px !important;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.5s infinite !important;
    border-radius: 4px !important;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   Basic Utility Classes Only
======================================== */
.ao-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.ao-no-results {
    text-align: center;
    padding: 40px 20px;
}

.ao-empty-state {
    text-align: center;
    padding: 60px 20px;
}

/* Toast notifications */
.ao-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000000;
}

.ao-toast {
    padding: 12px 16px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    margin-top: 8px;
    animation: aoSlideIn 0.3s ease-out;
}

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