/**
 * Fabify Marketplace Theme - Contrast & Accessibility Fixes
 *
 * This file fixes contrast issues identified in accessibility audit.
 * Load AFTER marketplace.css
 * Version: 4.0.0 - Specific Inline Style Overrides
 */

/* ===========================================
   HERO SECTION - Improve text readability
   =========================================== */

/* Hero main text on hero images - increase opacity from 0.7 to 0.95 */
.hero-main-banner p {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Hero countdown - increase opacity from 0.6 to 0.95 */
.hero-countdown {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Hero Premium section - fix dark text on dark gradient background */
.hero-headline {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-subheading {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Price elements in hero - increase opacity from 0.7 to 0.9 */
.currency,
.price-decimal {
    opacity: 0.95 !important;
}

/* Panel tag - increase opacity from 0.8 to 0.95 */
.panel-tag {
    opacity: 0.95 !important;
}

/* ===========================================
   SPEC LABELS - Fix low contrast on dark
   =========================================== */

.spec-label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ===========================================
   DARK MODE - Fix low contrast borders & backgrounds
   =========================================== */

[data-theme="dark"] {
    --border-light: #3a3a3a !important;
    --border: #333333 !important;
}

/* Dark mode fixes for components missing dark mode styles */
[data-theme="dark"] .header-container {
    background: var(--bg-card, #1a1a1a) !important;
}

[data-theme="dark"] .search-pill {
    background: #2a2a2a !important;
}

[data-theme="dark"] .tile {
    background: #1a1a1a !important;
}

[data-theme="dark"] .bento-1 {
    background: #1a1a1a !important;
}

[data-theme="dark"] .quick-categories {
    background: #1a1a1a !important;
}

[data-theme="dark"] .mega-cat-item:hover {
    background: #2a2a2a !important;
}

[data-theme="dark"] .card-title h3 {
    color: #f0f0f0 !important;
}

/* Specific border fixes for dark mode */
[data-theme="dark"] .product-card-luxury,
[data-theme="dark"] .cat-pill,
[data-theme="dark"] .product-card-premium,
[data-theme="dark"] .newsletter-box,
[data-theme="dark"] .footer-main,
[data-theme="dark"] .header-main {
    border-color: #3a3a3a !important;
}

/* ===========================================
   PRODUCT INFO - Improve muted text contrast
   =========================================== */

.product-info h4,
.rating-count,
.footer-brand p {
    color: var(--text-main, #333) !important;
}

/* ===========================================
   NEWSLETTER INPUT - Improve border visibility
   =========================================== */

.newsletter-input {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .newsletter-input {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* ===========================================
   PRODUCT PAGE CSS FIXES
   =========================================== */

/* Breadcrumbs - improve contrast */
.fabify-breadcrumbs,
.fabify-breadcrumbs a {
    color: #374151 !important;
}

[data-theme="dark"] .fabify-breadcrumbs,
[data-theme="dark"] .fabify-breadcrumbs a {
    color: #d1d5db !important;
}

/* Product page meta text */
.fabify-meta,
.fabify-tab-btn {
    color: #6b7280 !important;
}

[data-theme="dark"] .fabify-meta,
[data-theme="dark"] .fabify-tab-btn {
    color: #9ca3af !important;
}

/* Strikethrough price */
.fabify-price del {
    color: #9ca3af !important;
}

/* Section divider - improve visibility */
hr.section-divider {
    border-top-color: #d1d5db !important;
}

[data-theme="dark"] hr.section-divider {
    border-top-color: #4b5563 !important;
}

/* ===========================================
   WOOCOMMERCE FORMS - Fix placeholder contrast
   =========================================== */

.woocommerce-Input,
.woocommerce input input,
.woocommerce form .form-row input input,
.woocommerce form .form-row textarea,
select {
    color: #333 !important;
}

::placeholder {
    color: #666 !important;
    opacity: 1 !important;
}

[data-theme="dark"] ::placeholder {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .woocommerce-Input,
[data-theme="dark"] .woocommerce input input,
[data-theme="dark"] select {
    color: #f0f0f0 !important;
    background: #1a1a1a !important;
    border-color: #3a3a3a !important;
}

/* ===========================================
   INLINE STYLE FIXES - Override problematic inline styles
   =========================================== */

/* Fix font sizes below 14px in footer */
footer p,
footer h4,
footer a,
footer li {
    font-size: 14px !important;
    min-height: 0;
}

/* Fix inline opacity issues */
[style*="opacity: 0.5"],
[style*="opacity: 0.6"],
[style*="opacity: 0.7"] {
    opacity: 0.9 !important;
}

/* Fix very small fonts */
[style*="font-size: 11px"],
[style*="font-size: 12px"] {
    font-size: 14px !important;
}

/* Fix inline color:inherit on links to ensure visibility */
a[style*="color:inherit"] {
    color: var(--text-main, #333) !important;
}

[data-theme="dark"] a[style*="color:inherit"] {
    color: var(--text-main, #f0f0f0) !important;
}

/* ===========================================
   SPECIFIC INLINE STYLE OVERRIDES
   Target elements with problematic inline styles
   =========================================== */

/* Newsletter section description - override rgba(255,255,255,0.7) */
.newsletter-section p,
.newsletter-box p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 15px !important;
}

/* Newsletter disclaimer - override rgba(255,255,255,0.5) and font-size:12px */
.newsletter-section > div > div {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 14px !important;
}

/* Quick View close button - override #999 and 11px */
#quickView a,
.quick-view-close,
a[onclick*="quickView"] {
    color: #666 !important;
    font-size: 14px !important;
}

#quickView a:hover,
.quick-view-close:hover {
    color: #333 !important;
}

/* Payment icons container - override opacity: 0.6 */
.newsletter-section + div div[style*="opacity: 0.6"],
.newsletter-section + div div[style*="opacity:0.6"],
.footer-payment-icons,
div[style*="justify-content: center"][style*="opacity: 0.6"] {
    opacity: 0.9 !important;
}

/* Footer headings - override font-size: 13px */
footer h4,
.footer-col h4 {
    font-size: 14px !important;
}

/* Override all rgba white text with low opacity in newsletter/hero */
.newsletter-section *,
.hero-premium p,
.hero-premium span {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Newsletter form elements */
.newsletter-input {
    color: white !important;
    font-size: 15px !important;
}

/* ===========================================
   SEARCH RESULTS - New styles
   =========================================== */

.search-results-wrapper {
    min-height: 60vh;
}

.search-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border, #E5E5E5);
}

[data-theme="dark"] .search-header {
    border-bottom-color: #3a3a3a;
}

.search-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main, #121212);
    margin: 0 0 10px 0;
}

[data-theme="dark"] .search-title {
    color: var(--text-main, #f0f0f0);
}

.search-count {
    color: var(--text-muted, #666666);
    font-size: 14px;
}

[data-theme="dark"] .search-count {
    color: var(--text-muted, #b0b0b0);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #666666);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

/* Product card improvements */
.product-card-luxury:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

[data-theme="dark"] .product-card-luxury:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Suggestion tags */
.suggestion-tag {
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .suggestion-tag:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ===========================================
   PAGINATION - Better visibility
   =========================================== */

.pagination-wrapper .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-main, #121212);
    transition: all 0.2s ease;
}

.pagination-wrapper .page-numbers:hover,
.pagination-wrapper .page-numbers.current {
    background: var(--accent, #00ff88);
    color: var(--dark, #121212);
    border-color: var(--accent, #00ff88);
}

[data-theme="dark"] .pagination-wrapper .page-numbers {
    border-color: #3a3a3a;
    color: var(--text-main, #f0f0f0);
}

/* ===========================================
   ACCESSIBILITY - Focus indicators
   =========================================== */

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--focus-ring, #0066cc) !important;
    outline-offset: 2px !important;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent, #00ff88);
    color: var(--dark, #121212);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ===========================================
   RESPONSIVE - Mobile improvements
   =========================================== */

@media (max-width: 768px) {
    .search-title {
        font-size: 22px;
    }

    .suggestion-tags {
        flex-direction: column;
        align-items: stretch;
    }

    .suggestion-tag {
        text-align: center;
    }
}
