/* ========================================
   Weiyong Ceramics - Premium Website Styles
   Version: 2025.04.10
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #6b9080;
    --primary-dark: #5a7d6e;
    --primary-light: #7da38f;
    --secondary-color: #c9a227;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --border-radius-lg: 20px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark-color);
}

.display-3, .display-4, .display-5 {
    font-family: var(--font-display);
}

/* Skip Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

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

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2d2d44 100%);
    font-size: 13px;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* Navigation */
.main-header {
    transition: var(--transition);
}

.navbar-brand img {
    max-height: 50px;
    width: auto;
}

.nav-link {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-color) !important;
    transition: var(--transition);
    position: relative;
    border-radius: 8px;
    margin: 0 2px;
}

.nav-link:hover {
    background: rgba(107, 144, 128, 0.08);
    color: var(--primary-color) !important;
}

.nav-link.active {
    background: rgba(107, 144, 128, 0.12);
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Dropdown Toggle - Desktop only */
@media (min-width: 992px) {
    .navbar .dropdown-toggle {
        display: inline-flex !important;
        align-items: center;
        white-space: nowrap !important;
    }

    /* Hide Bootstrap default arrow */
    .navbar .dropdown-toggle::after {
        display: none !important;
    }

    /* Custom inline icon */
    .navbar .dropdown-toggle .dropdown-icon-wrapper {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        margin-left: 4px;
        background: var(--primary-color);
        border-radius: 3px;
        transition: var(--transition);
    }

    .navbar .dropdown-toggle .dropdown-icon-wrapper i {
        font-size: 10px;
        color: white;
        line-height: 1;
    }

    .navbar .dropdown-toggle.show .dropdown-icon-wrapper {
        transform: rotate(180deg);
    }
}

/* Mobile Navigation Styles */
@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lg);
        margin-top: 0.5rem;
    }

    .nav-item {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 8px;
        margin: 2px 0;
    }

    .nav-link:hover {
        background: rgba(107, 144, 128, 0.08);
    }

    .nav-link.active {
        background: rgba(107, 144, 128, 0.15);
        color: var(--primary-color) !important;
    }

    .nav-link::after {
        display: none;
    }

    /* Mobile dropdown styles */
    .dropdown-menu.mega-menu {
        min-width: auto !important;
        width: 100%;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent;
        margin-top: 0;
        margin-bottom: 0.5rem;
    }

    .dropdown-menu.mega-menu .list-group-item {
        background: transparent;
        padding-left: 1rem !important;
        color: var(--text-color);
        font-size: 13px;
    }

    .dropdown-menu.mega-menu .list-group-item:hover {
        color: var(--primary-color);
        background: rgba(107, 144, 128, 0.05);
    }

    .dropdown-menu.mega-menu .list-group-item.border-bottom {
        border-color: rgba(0,0,0,0.05) !important;
    }

    /* Mobile dropdown toggle button */
    .dropdown .btn-link {
        color: var(--primary-color) !important;
        text-decoration: none;
        transition: var(--transition);
        border: none;
        background: transparent;
    }

    .dropdown .btn-link:hover,
    .dropdown .btn-link:focus {
        color: var(--primary-dark) !important;
        background: rgba(107, 144, 128, 0.1);
        border-radius: 4px;
    }

    .dropdown .btn-link[aria-expanded="true"] i {
        transform: rotate(180deg);
    }

    .dropdown .btn-link i {
        transition: transform 0.3s ease;
        font-size: 16px;
        display: inline-block;
    }

    /* Get Quote button on mobile */
    .nav-item .btn-primary {
        margin-top: 0.5rem;
        width: 100%;
    }
}

/* Desktop dropdown styles */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        display: block;
        animation: fadeInDown 0.2s ease;
    }

    .dropdown-menu.mega-menu {
        min-width: 700px;
        padding: 1.5rem;
    }
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    height: calc(100vh - 120px);
    min-height: 500px;
}

.hero-slide {
    height: calc(100vh - 120px);
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

/* Mobile Hero Adjustments */
@media (max-width: 991px) {
    .hero-section {
        height: auto;
        min-height: calc(100vh - 100px);
        margin-top: -100px;
        padding-top: 100px;
    }

    .hero-slide {
        height: auto;
        min-height: calc(100vh - 100px);
        display: flex;
        flex-direction: column;
    }

    .hero-bg-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .hero-content {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .hero-buttons .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
    }
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(26,31,46,0.85) 0%, rgba(26,31,46,0.5) 40%, rgba(26,31,46,0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-desc {
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-buttons .btn {
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
}

/* Carousel Customization */
.carousel-indicators {
    bottom: 30px;
}

.carousel-indicators button {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    margin: 0 4px;
    background-color: rgba(255,255,255,0.4);
    border: none;
    transition: var(--transition);
}

.carousel-indicators button.active {
    background-color: #6b9080;
    width: 60px;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: #6b9080;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition);
    border: 2px solid rgba(255,255,255,0.3);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: #5a7d6e;
    transform: translateY(-50%) scale(1.1);
}

.hero-section:hover .carousel-control-prev,
.hero-section:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

/* Trust Badges */
.trust-badges {
    background: #fff;
}

.trust-item {
    padding: 1.5rem;
}

.trust-item i {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 12px 30px;
    border-radius: 50px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(26,95,122,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,95,122,0.4);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.btn-outline-light:hover {
    background: white;
    color: var(--dark-color);
}

/* About Section */
.about-section {
    padding: 5rem 0;
}

.about-images {
    position: relative;
}

.about-img-main {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.about-img-secondary {
    position: absolute;
    bottom: -30px;
    right: -20px;
    width: 60%;
    border: 5px solid white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.experience-badge {
    position: absolute;
    top: 30px;
    left: -20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* Products Section */
.products-section {
    padding: 5rem 0;
}

.product-card {
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    height: 280px;
    overflow: hidden;
}

.product-image img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.hover-primary:hover {
    color: var(--primary-color) !important;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 4rem 0;
}

.stat-item {
    padding: 1rem;
}

/* Services Section */
.services-section {
    padding: 5rem 0;
}

.service-card {
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--primary-color) !important;
    color: white !important;
}

/* CTA Section */
.cta-section {
    padding: 5rem 0;
    position: relative;
}

.cta-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* News Section */
.news-section {
    padding: 5rem 0;
}

.news-card {
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-image {
    overflow: hidden;
}

.news-image img {
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #16213e 100%);
}

.footer-links a,
.footer-contact a {
    transition: var(--transition);
}

.footer-links a:hover,
.footer-contact a:hover {
    color: white !important;
    padding-left: 5px;
}

.social-link {
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color) !important;
    transform: translateY(-3px);
}

/* Mega Menu Dropdown */
.mega-menu {
    border-radius: var(--border-radius);
    margin-top: 0 !important;
}

.mega-menu .dropdown-item {
    padding: 0;
}

.mega-menu a:hover {
    background-color: var(--light-color);
}

.mega-menu img {
    transition: var(--transition);
}

.mega-menu a:hover img {
    transform: scale(1.05);
}

/* Dropdown hover effect - improved */
@media (min-width: 992px) {
    .dropdown {
        position: relative;
    }
    
    .dropdown::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 20px;
        background: transparent;
        z-index: 999;
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
        animation: fadeInUp 0.2s ease;
    }
    
    .dropdown-menu {
        top: 100%;
        margin-top: 0;
    }
}

/* Dropdown toggle arrow - hide default Bootstrap arrow */
.nav-link.dropdown-toggle {
    display: flex;
    align-items: center;
}

.nav-link.dropdown-toggle::after {
    display: none;
}

/* Dropdown icon with background */
.nav-link.dropdown-toggle .dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    margin-left: 8px;
    font-size: 10px;
}

.nav-link.dropdown-toggle .dropdown-icon i {
    transition: transform 0.3s ease;
}

.dropdown:hover .nav-link.dropdown-toggle .dropdown-icon i {
    transform: rotate(180deg);
}

/* Ensure dropdown stays open when hovering menu and dropdown */
.dropdown-menu {
    pointer-events: auto;
}

.dropdown:hover .dropdown-menu {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    display: block;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* Utility Classes */
.hover-shadow-lg:hover {
    box-shadow: var(--shadow-lg) !important;
}

.hover-bg-light:hover {
    background-color: var(--light-color);
}

.transition-all {
    transition: var(--transition);
}

.tracking-wider {
    letter-spacing: 0.1em;
}

.py-7 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 991.98px) {
    .hero-section,
    .hero-slide {
        height: auto;
        min-height: 500px;
        padding: 100px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .about-img-secondary {
        position: relative;
        bottom: 0;
        right: 0;
        width: 80%;
        margin: -50px auto 0;
    }
    
    .experience-badge {
        position: relative;
        top: 0;
        left: 0;
        margin: 20px auto;
        display: inline-block;
    }
    
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lg);
        margin-top: 1rem;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .stat-item .display-4 {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .top-bar,
    .main-header,
    .footer,
    #backToTop {
        display: none !important;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Focus States (Accessibility) */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Back to Top Button */
#backToTop {
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    min-height: 45px !important;
    max-width: 45px !important;
    max-height: 45px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Footer Bottom */
.footer-bottom {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.footer-bottom .row {
    min-height: 40px;
    display: flex;
    align-items: center;
}

.footer-bottom p,
.footer-bottom ul {
    line-height: 1.5;
}

/* Theme Colors */
.text-theme {
    color: var(--primary-color) !important;
}

.bg-theme {
    background-color: var(--primary-color) !important;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

.product-image {
    overflow: hidden;
}

.product-image img {
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    inset: 0;
}

.hover-opacity-100:hover {
    opacity: 1 !important;
}

.product-actions .btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-width: 2px;
    transition: all 0.3s ease;
}

.product-actions .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.product-actions .btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.product-actions .btn-outline-primary i {
    transition: transform 0.3s ease;
}

.product-actions .btn-outline-primary:hover i {
    transform: translateX(4px);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
