/*
Theme Name:   Wiyi Sanitary Ware Child
Theme URI:    https://wzwiyi.com
Description:  Astra Child Theme for Hangzhou Wiyi Sanitary Ware Co., Ltd. — B2B Foreign Trade Website (Dark Dyson-Inspired)
Author:       Wiyi Team
Author URI:   https://wzwiyi.com
Template:     astra
Version:      1.1.0
License:      GPL v2 or later
Text Domain:  wzwiyi
*/

/* ============================================
   1. CSS Variables — Dark Theme + Sky Blue Accent
   ============================================ */
:root {
    /* Background */
    --wiyi-bg-primary: #0D0D0D;
    --wiyi-bg-surface: #1E1E1E;
    --wiyi-bg-elevated: #2A2A2A;

    /* Text */
    --wiyi-text-primary: #F5F5F5;
    --wiyi-text-secondary: #A0A0A0;
    --wiyi-text-tertiary: #666666;

    /* Borders */
    --wiyi-border: #2E2E2E;
    --wiyi-border-light: #3A3A3A;

    /* Accent — Sky Blue */
    --wiyi-accent: #38BDF8;
    --wiyi-accent-light: #7DD3FC;
    --wiyi-accent-dark: #0284C7;
    --wiyi-accent-deep: #0EA5E9;
    --wiyi-accent-glow: rgba(56, 189, 248, 0.15);
    --wiyi-accent-gradient: linear-gradient(135deg, var(--wiyi-accent) 0%, var(--wiyi-accent-deep) 100%);
    --wiyi-shadow-accent: 0 4px 20px rgba(56, 189, 248, 0.2);

    /* Status */
    --wiyi-success: #10B981;
    --wiyi-warning: #F59E0B;

    /* Typography */
    --wiyi-font-heading: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    --wiyi-font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

    /* Spacing */
    --wiyi-section-padding: 80px;
    --wiyi-container-max: 1200px;

    /* Radius */
    --wiyi-radius-sm: 8px;
    --wiyi-radius: 12px;
    --wiyi-radius-lg: 16px;

    /* Transitions */
    --wiyi-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   2. Global Typography & Body
   ============================================ */
body {
    font-family: var(--wiyi-font-body);
    color: var(--wiyi-text-primary);
    background: var(--wiyi-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--wiyi-font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--wiyi-text-primary);
    margin-bottom: 1rem;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
    line-height: 1.75;
    color: var(--wiyi-text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--wiyi-accent);
    text-decoration: none;
    transition: var(--wiyi-transition);
}
a:hover {
    color: var(--wiyi-accent-light);
}

/* Container */
.wiyi-container {
    max-width: var(--wiyi-container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   3. Header & Navigation (Astra Override)
   ============================================ */
.site-header,
.main-header-bar {
    background: rgba(13, 13, 13, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--wiyi-border) !important;
}

.main-navigation ul.menu > li > a {
    font-family: var(--wiyi-font-body);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--wiyi-text-secondary) !important;
    text-transform: none;
    padding: 0 1.25rem;
    transition: var(--wiyi-transition);
}
.main-navigation ul.menu > li > a:hover,
.main-navigation ul.menu > li.current-menu-item > a {
    color: var(--wiyi-accent) !important;
}

/* CTA Button */
.wiyi-nav-cta {
    background: var(--wiyi-accent-gradient) !important;
    color: #0D0D0D !important;
    border-radius: 50px !important;
    padding: 9px 24px !important;
    font-weight: 600 !important;
    box-shadow: var(--wiyi-shadow-accent) !important;
}
.wiyi-nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(56, 189, 248, 0.3) !important;
}

/* ============================================
   4. Hero & Banner
   ============================================ */
.wiyi-hero {
    position: relative;
    background: var(--wiyi-bg-primary);
    padding: 100px 0 80px;
}
.wiyi-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wiyi-accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--wiyi-accent-light);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.wiyi-hero h1 { margin-bottom: 1.25rem; line-height: 1.2; }
.wiyi-hero p {
    font-size: 1.1rem;
    color: var(--wiyi-text-secondary);
    max-width: 520px;
}

/* ============================================
   5. Buttons
   ============================================ */
.wiyi-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--wiyi-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--wiyi-transition);
    border: none;
    text-decoration: none;
}
.wiyi-btn-primary {
    background: var(--wiyi-accent-gradient);
    color: #0D0D0D;
    box-shadow: var(--wiyi-shadow-accent);
}
.wiyi-btn-primary:hover {
    color: #0D0D0D;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.3);
}
.wiyi-btn-outline {
    background: transparent;
    color: var(--wiyi-text-secondary);
    border: 2px solid var(--wiyi-border-light);
}
.wiyi-btn-outline:hover {
    border-color: var(--wiyi-accent);
    color: var(--wiyi-accent);
}

/* ============================================
   6. Product Cards & Grids
   ============================================ */
.wiyi-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.wiyi-product-card {
    background: var(--wiyi-bg-surface);
    border: 1px solid var(--wiyi-border);
    border-radius: var(--wiyi-radius);
    overflow: hidden;
    transition: var(--wiyi-transition);
}
.wiyi-product-card:hover {
    border-color: var(--wiyi-accent);
    box-shadow: var(--wiyi-shadow-accent);
    transform: translateY(-4px);
}
.wiyi-product-card-image {
    height: 260px;
    background: var(--wiyi-bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wiyi-product-card-body { padding: 24px; }
.wiyi-product-card-body .category-tag {
    font-size: 0.8rem;
    color: var(--wiyi-accent-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}
.wiyi-product-card-body h3 { font-size: 1.1rem; }

/* Category Cards */
.wiyi-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}
.wiyi-category-card {
    background: var(--wiyi-bg-surface);
    border: 1px solid var(--wiyi-border);
    border-radius: var(--wiyi-radius);
    padding: 40px 28px;
    text-align: center;
    transition: var(--wiyi-transition);
}
.wiyi-category-card:hover {
    border-color: var(--wiyi-accent);
    transform: translateY(-3px);
}

/* ============================================
   7. Forms & Inputs
   ============================================ */
.wiyi-inquiry-form {
    background: var(--wiyi-bg-surface);
    padding: 40px;
    border-radius: var(--wiyi-radius);
    border: 1px solid var(--wiyi-border);
}
.wiyi-inquiry-form input[type="text"],
.wiyi-inquiry-form input[type="email"],
.wiyi-inquiry-form input[type="tel"],
.wiyi-inquiry-form textarea,
.wiyi-inquiry-form select {
    width: 100%;
    padding: 12px 16px;
    background: var(--wiyi-bg-primary);
    border: 1px solid var(--wiyi-border);
    border-radius: var(--wiyi-radius-sm);
    color: var(--wiyi-text-primary);
    font-family: var(--wiyi-font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.wiyi-inquiry-form input:focus,
.wiyi-inquiry-form textarea:focus,
.wiyi-inquiry-form select:focus {
    outline: none;
    border-color: var(--wiyi-accent);
    box-shadow: 0 0 0 3px var(--wiyi-accent-glow);
}
.wiyi-inquiry-form input[type="submit"],
.wiyi-inquiry-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: var(--wiyi-accent-gradient);
    color: #0D0D0D;
    border: none;
    border-radius: var(--wiyi-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--wiyi-shadow-accent);
    transition: var(--wiyi-transition);
}
.wiyi-inquiry-form input[type="submit"]:hover,
.wiyi-inquiry-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.3);
}

/* ============================================
   8. Product Attributes Table (WooCommerce)
   ============================================ */
.woocommerce-product-attributes {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}
.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--wiyi-border);
    font-size: 14px;
}
.woocommerce-product-attributes th {
    color: var(--wiyi-text-secondary);
    font-weight: 500;
    width: 160px;
    background: rgba(255, 255, 255, 0.02);
}
.woocommerce-product-attributes td {
    color: var(--wiyi-text-primary);
}

/* ============================================
   9. Footer
   ============================================ */
.wiyi-footer,
.site-footer {
    background: var(--wiyi-bg-elevated) !important;
    padding: 60px 0 30px;
    border-top: 1px solid var(--wiyi-border);
}
.wiyi-footer h4 {
    color: var(--wiyi-text-primary);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}
.wiyi-footer a {
    color: var(--wiyi-text-secondary);
    font-size: 0.9rem;
}
.wiyi-footer a:hover {
    color: var(--wiyi-accent);
}
.wiyi-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

/* ============================================
   10. Floating WhatsApp / Inquiry
   ============================================ */
.wiyi-floating-cta {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wiyi-floating-cta a {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: var(--wiyi-transition);
}
.wiyi-floating-cta a:hover {
    transform: scale(1.1);
}
.wiyi-floating-whatsapp { background: #25D366; color: #fff; }
.wiyi-floating-inquiry { background: var(--wiyi-accent-gradient); color: #0D0D0D; }

/* ============================================
   11. Elementor Overrides
   ============================================ */
.elementor-section.elementor-section-boxed > .elementor-container {
    max-width: var(--wiyi-container-max);
}
.elementor-widget-heading .elementor-heading-title {
    font-family: var(--wiyi-font-heading);
}
.elementor-button {
    font-family: var(--wiyi-font-body) !important;
    font-weight: 600 !important;
    border-radius: 50px !important;
}

/* ============================================
   12. Responsive — Tablet (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) {
    /* Container */
    .wiyi-container { padding: 0 20px; }

    /* Header: hide desktop nav, show mobile toggle */
    .main-navigation { display: none; }
    .ast-mobile-menu-buttons { display: flex; }

    /* Footer */
    .wiyi-footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }

    /* Product Grids */
    .wiyi-product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .wiyi-category-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

    /* Product Card images */
    .wiyi-product-card-image { height: 220px; }

    /* Hero */
    .wiyi-hero { padding: 60px 0 50px; text-align: center; }
    .wiyi-hero h1 { font-size: 2rem; }
    .wiyi-hero p { margin: 0 auto 24px; max-width: 480px; }

    /* Floating buttons */
    .wiyi-floating-cta { bottom: 24px; right: 24px; gap: 10px; }
}

/* ============================================
   13. Responsive — Mobile (375px - 767px)
   ============================================ */
@media (max-width: 767px) {
    /* Root adjustments */
    :root {
        --wiyi-section-padding: 44px;
        --wiyi-container-max: 100%;
    }

    /* Container */
    .wiyi-container { padding: 0 16px; }

    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
    p { font-size: 0.95rem; }

    /* Hero */
    .wiyi-hero { padding: 48px 0 40px; }
    .wiyi-hero h1 { font-size: 1.65rem; }
    .wiyi-hero p { font-size: 0.95rem; max-width: 100%; }
    .wiyi-hero-tag { font-size: 0.78rem; padding: 5px 14px; }

    /* Buttons — full width + touch-friendly */
    .wiyi-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 12px 28px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    /* Footer */
    .wiyi-footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .wiyi-footer,
    .site-footer { padding: 44px 16px 24px; }

    /* Product & Category Grids — single column */
    .wiyi-product-grid,
    .wiyi-category-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .wiyi-product-card-image { height: 200px; }
    .wiyi-product-card-body { padding: 20px; }
    .wiyi-product-card-body h3 { font-size: 1.05rem; }
    .wiyi-category-card { padding: 28px 20px; }

    /* Forms */
    .wiyi-inquiry-form { padding: 24px; }
    .wiyi-inquiry-form input[type="text"],
    .wiyi-inquiry-form input[type="email"],
    .wiyi-inquiry-form input[type="tel"],
    .wiyi-inquiry-form textarea,
    .wiyi-inquiry-form select {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    .wiyi-inquiry-form input[type="submit"],
    .wiyi-inquiry-form button[type="submit"] {
        min-height: 44px;
        font-size: 0.95rem;
    }

    /* Product Attributes Table — horizontal scroll on mobile */
    .woocommerce-product-attributes {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .woocommerce-product-attributes th,
    .woocommerce-product-attributes td {
        padding: 10px 12px;
        font-size: 13px;
    }
    .woocommerce-product-attributes th {
        width: 120px;
        white-space: nowrap;
    }

    /* Floating buttons */
    .wiyi-floating-cta { bottom: 20px; right: 20px; gap: 8px; }
    .wiyi-floating-cta a { width: 46px; height: 46px; font-size: 1.1rem; }
}

/* ============================================
   14. Responsive — Small phones (< 400px)
   ============================================ */
@media (max-width: 399px) {
    .wiyi-hero h1 { font-size: 1.4rem; }
    .wiyi-hero p { font-size: 0.9rem; }
    .wiyi-btn { font-size: 0.85rem; padding: 11px 22px; max-width: 100%; }
    .wiyi-floating-cta { bottom: 16px; right: 16px; }
    .wiyi-floating-cta a { width: 42px; height: 42px; font-size: 1rem; }
    .wiyi-product-card-image { height: 180px; }
}

/* ============================================
   13. Elementor Dark Theme Overrides
   ============================================ */
/* 
   Elementor templates may contain hardcoded light backgrounds.
   These rules ensure the live site always matches the approved
   dark Dyson theme with sky-blue accents.
*/

/* Force dark body/page background */
html,
body,
#page,
#primary,
#main,
.ast-container,
.elementor-section,
.elementor-section-boxed,
.elementor-section-full_width,
.elementor-section-stretched,
.elementor-top-section {
    background-color: var(--wiyi-bg-primary) !important;
}

/* Elementor columns and inner containers */
.elementor-column,
.elementor-widget-wrap,
.elementor-element:not(.elementor-motion-effects-element-type-background) {
    background-color: transparent !important;
}

/* Force all Elementor headings to light */
.elementor-widget-heading .elementor-heading-title,
.elementor-heading-title,
h1.elementor-heading-title,
h2.elementor-heading-title,
h3.elementor-heading-title,
h4.elementor-heading-title,
h5.elementor-heading-title,
h6.elementor-heading-title {
    color: var(--wiyi-text-primary) !important;
}

/* Keep accent/sky-blue for subtitles */
.elementor-element-1124226 .elementor-heading-title,
.elementor-widget-heading .elementor-heading-title[class*="subtitle"],
.elementor-heading-title.wiyi-subtitle {
    color: var(--wiyi-accent) !important;
}

/* Elementor text editor */
.elementor-widget-text-editor,
.elementor-widget-text-editor p,
.elementor-widget-text-editor span,
.elementor-widget-text-editor div {
    color: var(--wiyi-text-secondary) !important;
}

/* Buttons — primary accent */
.elementor-button-wrapper .elementor-button,
.elementor-button {
    background: var(--wiyi-accent-gradient) !important;
    background-color: var(--wiyi-accent) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: var(--wiyi-font-heading) !important;
    font-weight: 600 !important;
    padding: 14px 28px !important;
    transition: var(--wiyi-transition) !important;
    box-shadow: var(--wiyi-shadow-accent) !important;
}
.elementor-button:hover {
    background: var(--wiyi-accent-light) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 24px rgba(56, 189, 248, 0.3) !important;
}
.elementor-button-text,
.elementor-button .elementor-button-text,
.elementor-button-content-wrapper {
    color: #FFFFFF !important;
}

/* Secondary / outline buttons */
.elementor-button-wrapper .elementor-button-outline .elementor-button,
.elementor-button-outline .elementor-button,
.elementor-element-6f241a27 .elementor-button,
.elementor-element-38520e52 .elementor-button {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--wiyi-accent) !important;
    border: 2px solid var(--wiyi-accent) !important;
    box-shadow: none !important;
}
.elementor-button-wrapper .elementor-button-outline .elementor-button:hover,
.elementor-element-6f241a27 .elementor-button:hover,
.elementor-element-38520e52 .elementor-button:hover {
    background: var(--wiyi-accent-glow) !important;
    color: var(--wiyi-accent-light) !important;
}

/* CTA banner text */
.elementor-element-e163c02 .elementor-heading-title,
.elementor-cta__title,
.elementor-cta__description {
    color: #FFFFFF !important;
}

/* Elementor images */
.elementor-widget-image img {
    border-radius: var(--wiyi-radius);
}

/* Hide PHP warning noise from Elementor columns */
.elementor-element .elementor-background-overlay {
    pointer-events: none;
}

/* Ensure footer inherits dark theme */
footer,
.site-footer,
.ast-footer,
.ast-builder-layout-element {
    background-color: var(--wiyi-bg-surface) !important;
    color: var(--wiyi-text-secondary) !important;
}

/* ============================================
   14. Animations
   ============================================ */
@keyframes wiyiFadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.wiyi-animate { animation: wiyiFadeInUp 0.6s ease forwards; opacity: 0; }
.wiyi-animate-delay-1 { animation-delay: 0.1s; }
.wiyi-animate-delay-2 { animation-delay: 0.2s; }
.wiyi-animate-delay-3 { animation-delay: 0.3s; }
.wiyi-animate-delay-4 { animation-delay: 0.4s; }

/* ============================================
   15. Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--wiyi-accent);
    outline-offset: 2px;
}
@media (prefers-contrast: high) {
    :root {
        --wiyi-accent: #00A8FF;
        --wiyi-accent-light: #40C4FF;
    }
}
/* ============================================
   Elementor 深色主题强制覆盖
   ============================================ */

/* 所有 Elementor Section 默认深色背景 */
.elementor-section,
.elementor-section-boxed,
.elementor-section-full_width {
    background-color: #0D0D0D !important;
}

/* 所有 column 背景 */
.elementor-column,
.elementor-widget-wrap,
.elementor-element {
    background-color: transparent !important;
}

/* 所有文字变白 */
.elementor *,
.elementor-widget-container,
.elementor-widget-heading .elementor-heading-title,
.elementor-widget-text-editor,
.elementor-widget-icon-list .elementor-icon-list-text,
.elementor-button-text,
.elementor-counter-number,
.elementor-counter-number-suffix,
.elementor-counter-title {
    color: #FFFFFF !important;
}

/* 副标题、描述文字用灰色 */
.elementor-widget-text-editor p,
.elementor-widget-icon-list .elementor-icon-list-text,
.elementor-counter-title {
    color: #A0A0A0 !important;
}

/* 小标题标签（蓝色） */
.elementor-widget-text-editor strong,
.elementor-widget-heading .elementor-heading-title span {
    color: #38BDF8 !important;
}

/* 按钮：主按钮天蓝 */
.elementor-button.elementor-size-md,
.elementor-button,
a.elementor-button {
    background: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%) !important;
    color: #0D0D0D !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    border: none !important;
}

/* 次按钮透明边框 */
.elementor-button-outline {
    background: transparent !important;
    color: #38BDF8 !important;
    border: 2px solid #38BDF8 !important;
}

/* 产品卡片背景 */
.elementor-widget-wrap .elementor-element-populated {
    background-color: #1E1E1E !important;
    border: 1px solid #2A2A2A !important;
    border-radius: 16px !important;
}

/* 隐藏 Astra 页脚 */
footer.ast-site-footer,
.ast-footer-copyright,
.ast-footer-social-wrap,
.ast-small-footer {
    display: none !important;
}

/* 修复 Elementor column 警告带来的空行 */
.elementor-element .elementor-column .elementor-column-wrap {
    padding: 0 !important;
}
