/* ========================================
   PRODUCT CARDS MASTER CSS
   File: product-cards-master.css
   Location: /src/product-cards-master.css
   
   Consolidated product card styling for:
   - Product archive pages
   - Product category pages  
   - Product search results
   ======================================== */

/* ========================================
   BASE PRODUCT CARD STRUCTURE
   ======================================== */

/* CRITICAL: Base product card structure */
.product-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    /*height: auto !important;*/
    min-height: 540px !important;
    overflow: visible !important;
    background: white !important;
    border-radius: 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Product card content wrapper */
.product-card > div:not(.absolute) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ========================================
   IMAGE CONTAINER
   ======================================== */

/* Image container - square aspect ratio */
.product-card .aspect-square {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    background: linear-gradient(to bottom right, #f9fafb, #e5e7eb);
    overflow: hidden;
}

.product-card .aspect-square img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.5s ease;
}

.product-card:hover .aspect-square img {
    transform: scale(1.05);
}

/* ========================================
   CONTENT AREA
   ======================================== */

/* Content area - flexible growth */
.product-card .p-6 {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem !important;
}

/* Title */
.product-card h3 {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
    color: #111827 !important;
}

/* Price section */
.product-card .price-section {
    margin-top: auto !important;
    padding-top: 1rem !important;
}

/* ========================================
   BUTTONS - CRITICAL FIX
   ======================================== */

/* Button container - pushes to bottom */
.product-card .button-container,
.product-card .flex.gap-2,
.product-card .flex.gap-3,
.product-card .grid.gap-2 {
    margin-top: auto !important;
    padding-top: 1rem !important;
    display: flex !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

/* Individual buttons - base styling */
.product-card .affiliate-link,
.product-card .pc-compare-btn,
.product-card .view-details-btn,
.product-card a[href*="amzn.to"],
.product-card a[href*="amazon.com/"],
.product-card button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    text-align: center !important;
    flex: 1 !important;
    min-height: 44px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Buy Now button (blue) */
.product-card .affiliate-link,
.product-card a[href*="amzn.to"],
.product-card a[href*="amazon.com/"] {
    background: #2563eb !important;
    color: white !important;
    border: 2px solid #2563eb !important;
}

/* Deals page CTA - red/orange gradient */
.deals-grid .product-card .cta-btn,
.deals-grid .product-card a[href*="amzn.to"],
.deals-grid .product-card a[href*="amazon.com/"] {
    background: linear-gradient(135deg, #dc2626, #f97316) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3) !important;
}

.product-card .affiliate-link:hover,
.product-card a[href*="amzn.to"]:hover,
.product-card a[href*="amazon.com/"]:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

/* Deals page CTA hover */
.deals-grid .product-card .cta-btn:hover,
.deals-grid .product-card a[href*="amzn.to"]:hover,
.deals-grid .product-card a[href*="amazon.com/"]:hover {
    background: linear-gradient(135deg, #b91c1c, #ea580c) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(220,38,38,0.5) !important;
}

/* View Details button (gray) */
.product-card .view-details-btn,
.product-card a[href^="#"] {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 2px solid #e5e7eb !important;
}

.product-card .view-details-btn:hover,
.product-card a[href^="#"]:hover {
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
    transform: translateY(-2px) !important;
}

/* Compare button (purple outline) */
.product-card .pc-compare-btn,
.product-card button[data-product-id] {
    background: white !important;
    color: #7c3aed !important;
    border: 2px solid #7c3aed !important;
}

.product-card .pc-compare-btn:hover,
.product-card button[data-product-id]:hover {
    background: #7c3aed !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4) !important;
}

/* ========================================
   HOVER EFFECTS
   ======================================== */

/* Hover effects on entire card */
.product-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

/* ========================================
   BADGES
   ======================================== */

/* Badge positioning */
.product-card .trust-score,
.product-card .savings-badge {
    position: absolute;
    top: 1rem;
    z-index: 10;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-card .trust-score {
    left: 1rem;
}

.product-card .savings-badge {
    right: 1rem;
}

/* ========================================
   RATING STARS
   ======================================== */

/* Rating stars */
.product-card .flex.text-yellow-400 {
    font-size: 1rem;
    letter-spacing: 0.05em;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 640px) {
    .product-card {
        min-height: 480px !important;
    }
    
    .product-card h3 {
        font-size: 1rem !important;
    }
    
    .product-card .affiliate-link,
    .product-card .pc-compare-btn,
    .product-card .view-details-btn {
        padding: 0.625rem 0.875rem !important;
        font-size: 0.8125rem !important;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .product-card {
        min-height: 520px !important;
    }
}

@media (min-width: 1024px) {
    .product-card {
        min-height: 540px !important;
    }
}

/* ========================================
   FORCE ALL BUTTONS VISIBLE
   ======================================== */

/* CRITICAL: Force all buttons to be visible */
.product-card .affiliate-link,
.product-card .pc-compare-btn,
.product-card .view-details-btn,
.product-card button[data-product-id],
.product-card a[class*="btn"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ========================================
   SPECIAL PRODUCT STYLING
   ======================================== */

.product-card.special-product {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, #667eea, #764ba2) border-box;
}

/* ========================================
   END OF PRODUCT CARDS MASTER CSS
   ======================================== */

/* ========================================
   CATEGORY & SEARCH ARCHIVE GRIDS
   ======================================== */

.category-grid,
.search-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
}

@media (min-width: 640px) {
    .category-grid,
    .search-grid { 
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (min-width: 1024px) {
    .category-grid,
    .search-grid { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 1.25rem; 
    }
}

@media (min-width: 1280px) {
    .category-grid,
    .search-grid { 
        grid-template-columns: repeat(5, 1fr); 
    }
}

@media (min-width: 1536px) {
    .category-grid,
    .search-grid { 
        grid-template-columns: repeat(6, 1fr); 
    }
}

@media (min-width: 1800px) {
    .category-grid,
    .search-grid { 
        grid-template-columns: repeat(7, 1fr); 
    }
}

@media (min-width: 2100px) {
    .search-grid { 
        grid-template-columns: repeat(8, 1fr); 
    }
}

/* Search grid specific */
.search-grid .product-card {
    min-height: 520px;
}

/* ========================================
   ARCHIVE CONTAINER FULL WIDTH
   ======================================== */

.category-archive-page,
.search-results-page {
    padding-top: 0;
}

.category-container,
.search-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    overflow: visible;
}

@media (min-width: 1400px) {
    .category-container,
    .search-container { 
        padding: 0 3rem; 
    }
}

@media (min-width: 1600px) {
    .category-container,
    .search-container { 
        padding: 0 4rem; 
    }
}

/* ========================================
   PRODUCT CARD CONSISTENT HEIGHTS
   For uniform card layouts in grids
   ======================================== */

/* Title - fixed height for 2 lines */
.product-card .product-title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 2.75rem !important;
    min-height: 2.75rem !important;
}

/* Rating section - fixed height */
.product-card .rating-section {
    height: 24px !important;
    min-height: 24px !important;
    margin-bottom: 12px !important;
}

/* Price section - minimum height for discount text */
.product-card .price-section {
    min-height: 70px !important;
    margin-bottom: 0.75rem !important;
}

/* CTA button - consistent height */
.product-card .cta-btn {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ========================================
   ARCHIVE PAGINATION
   ======================================== */

.category-pagination a,
.category-pagination span,
.search-pagination a,
.search-pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.category-pagination a,
.search-pagination a {
    color: #475569;
    background: #f1f5f9;
}

.category-pagination a:hover,
.search-pagination a:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.category-pagination .current,
.search-pagination .current {
    background: #2563eb;
    color: white;
}

/* ========================================
   FRONT PAGE CARD ANIMATION
   ======================================== */

.product-card-fade {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* ========================================
   Z-INDEX FIX FOR BADGES
   ======================================== */

.product-card .trust-badge,
.product-card .discount-badge,
.product-card [class*="absolute"][class*="top-3"] {
    z-index: 10 !important;
}

/* ========================================
   HEADER FULL WIDTH
   ======================================== */

.header-content {
    max-width: 100% !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

@media (min-width: 1400px) {
    .header-content {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
}

@media (min-width: 1600px) {
    .header-content {
        padding-left: 4rem !important;
        padding-right: 4rem !important;
    }
}

@media (min-width: 1920px) {
    .header-content {
        padding-left: 5rem !important;
        padding-right: 5rem !important;
    }
}

/* ========================================
   PREVENT FLASH OF HUGE SEARCH ICON
   ======================================== */

.search-icon,
.search-form svg,
.search-container svg:not(.category-icon),
#main-search-input ~ svg {
    max-width: 24px !important;
    max-height: 24px !important;
    width: 24px !important;
    height: 24px !important;
}

/* ========================================
   MEGA MENU STYLING
   ======================================== */

/* White by default */
#mega-menu-bar,
.secondary-nav-section {
    width: 100% !important;
    display: block !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
}

/* Menu links - dark text on white */
#mega-menu-bar a,
.secondary-nav-section a,
#secondary-menu a {
    color: #374151 !important;
    transition: color 0.3s ease !important;
}

#mega-menu-bar a:hover,
.secondary-nav-section a:hover,
#secondary-menu a:hover {
    color: #2563eb !important;
}

/* Hide mega menu on mobile - hamburger has categories */
@media (max-width: 1279px) {
    #mega-menu-bar,
    .secondary-nav-section {
        display: none !important;
    }
}

/* SCROLLED state - Glass effect matching header */
#mega-menu-bar.nav-scrolled,
.secondary-nav-section.nav-scrolled {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.75) 0%, 
        rgba(30, 41, 59, 0.70) 50%, 
        rgba(51, 65, 85, 0.65) 100%) !important;
    backdrop-filter: blur(40px) saturate(180%) brightness(105%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(105%) !important;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.3), 0 1px 0 rgba(255, 255, 255, 0.15) inset !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* White text when scrolled */
#mega-menu-bar.nav-scrolled a,
.secondary-nav-section.nav-scrolled a,
#mega-menu-bar.nav-scrolled #secondary-menu a,
.secondary-nav-section.nav-scrolled #secondary-menu a {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

#mega-menu-bar.nav-scrolled a:hover,
.secondary-nav-section.nav-scrolled a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
}

/* ========================================
   ENHANCED LARGE SEARCH BAR STYLES
   ======================================== */

.search-input-large {
    width: 100% !important;
    min-width: 100% !important;
    padding: 14px 140px 14px 52px !important;
    font-size: 1rem !important;
    border-radius: 14px !important;
    border: 2px solid #e2e8f0 !important;
    background: #f8fafc !important;
    transition: all 0.3s ease !important;
}

.search-input-large::placeholder {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

.search-input-large:focus {
    border-color: #3b82f6 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
    outline: none !important;
}

.search-button-large {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 10px 20px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

.search-button-large:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
    transform: translateY(-50%) scale(1.02) !important;
}

/* Adjust icon positioning for larger input */
.search-container .search-icon {
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #94a3b8 !important;
    pointer-events: none !important;
}

/* Responsive adjustments */
@media (max-width: 1279px) {
    .search-input-large {
        min-width: 300px !important;
    }
}

@media (max-width: 1023px) {
    .search-input-large {
        min-width: 250px !important;
        padding: 12px 120px 12px 44px !important;
    }
}