/* ==========================================================================
   Homepage Specific Styles (High-Density Sany Style)
   ========================================================================== */

/* Typography & General Resets */
.section-title {
    font-size: clamp(2rem, 4vw + 1rem, 2.8rem);
    font-weight: 800;
    color: var(--dm-black);
    margin-bottom: var(--spacing-6);
}
.section-title.left-align {
    text-align: left;
}
.section-light {
    background-color: var(--dm-gray-50);
}
.sany-btn {
    border-radius: 2px;
    padding: 12px 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.sany-btn-outline {
    border: 2px solid var(--dm-primary);
    color: var(--dm-primary);
    background: transparent;
    border-radius: 2px;
    padding: 12px 24px;
    font-weight: bold;
    text-transform: uppercase;
}
.sany-btn-outline:hover {
    background: var(--dm-primary);
    color: var(--dm-white);
}
.round-pill {
    border-radius: 50px;
}
.sany-btn-solid-red {
    background-color: #E60012; /* Sany Red */
    border-color: #E60012;
    color: white;
    padding: 16px 40px;
    font-size: 18px;
}
.sany-btn-solid-red:hover {
    background-color: #cc0010;
}

/* ── 1. Hero Slider ── */
.sany-hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.sany-slide {
    position: relative;
    width: 100%;
    /* Desktop height */
    height: 75vh;
    min-height: 500px;
    max-height: 800px;
    display: none; /* Hide non-active by default */
    align-items: center;
}
.sany-slide.active {
    display: flex;
    animation: fadeInSlide 0.8s ease forwards;
}
@keyframes fadeInSlide {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}
.slide-bg::after {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
}
.slide-content-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
}
.slide-content {
    max-width: 600px;
    color: var(--dm-white);
}
.slide-tag {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--spacing-2);
}
.slide-title {
    font-size: clamp(2.5rem, 5vw + 1rem, 4rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--spacing-6);
    color: var(--dm-white);
}

/* Slider Controls */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.4);
    color: white;
    font-size: 40px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    user-select: none;
}
.slider-arrow:hover {
    background: #E60012;
}
.prev-arrow { left: 0; }
.next-arrow { right: 0; }

.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    justify-content: center;
}
.slider-dots {
    display: flex;
    gap: 12px;
}
.dot {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}
.dot.active, .dot:hover {
    background: #E60012;
    width: 60px;
}

@media (min-width: 768px) {
    .hidden-desktop { display: none !important; }
}
@media (max-width: 767px) {
    .hidden-mobile { display: none !important; }
    .sany-slide {
        /* Mobile height - reduced for better framing of the image */
        height: 65vh; 
        min-height: 450px;
        align-items: center; /* Center vertically on mobile */
        padding-bottom: 0; 
    }
    .slide-bg::after {
        /* Even dimming to make centered text readable */
        background: rgba(0,0,0,0.5);
    }
    .slide-content-wrapper {
        margin-top: -250px;
    }
    .slide-content {
        max-width: 100%;
        text-align: center;
        padding: 0 15px;
    }
    .slide-title {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: var(--spacing-5);
    }
    .slider-arrow {
        width: 40px; height: 40px; font-size: 24px;
    }
    .slider-controls {
        bottom: 20px;
    }
}

/* ── 2. Global Stats ── */
.sany-stats-section {
    padding: var(--spacing-6) 0 0 0;
}
.stats-map-container {
    /* Use an online SVG world map as a reliable background */
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/8/80/World_map_-_low_resolution.svg');
    background-size: 100% 1500%;
    background-repeat: no-repeat;
    background-position: center center;
    padding: var(--spacing-6) 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
    position: relative;
}
/* Subdue the map to make it a subtle background behind the text */
.stats-map-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.75); /* Light overlay to fade the map */
    z-index: 1;
}
.sany-stats-row {
    position: relative;
    z-index: 2; /* Keep text above the overlay */
    display: flex;
    justify-content: center;
    gap: var(--spacing-6);
    flex-wrap: wrap;
}
.top-row {
    justify-content: space-around;
    padding: 0 10%;
}
.bottom-row {
    justify-content: space-around;
    padding: 0 20%;
}
@media (max-width: 767px) {
    .stats-map-container { background-size: cover; padding: var(--spacing-2) 0; gap: var(--spacing-4); }
    .top-row, .bottom-row { padding: 0; justify-content: space-around; gap: var(--spacing-4); }
}
.sany-stat-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
}
.stat-num {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 900;
    color: #E60012; /* Sany Red */
    line-height: 1;
    margin-bottom: 8px;
}
.stat-num .plus {
    font-size: 2rem;
    vertical-align: top;
}
.stat-text {
    font-size: 14px;
    color: var(--dm-gray-600);
    font-weight: 600;
    text-transform: uppercase;
}

/* ── 3. Explore Product (Grid) ── */
.featured-product-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--dm-white);
    padding: var(--spacing-6);
    gap: var(--spacing-8);
    position: relative;
    border: 1px solid var(--dm-gray-200);
    margin-bottom: var(--spacing-4);
}
.fp-badge {
    position: absolute;
    top: 0; left: 0;
    background: #E60012;
    color: white;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 14px;
}
.fp-image {
    display: flex;
    align-items: center;
    justify-content: center;
}
.fp-image img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
}
.fp-info h3 {
    font-size: 28px;
    margin-bottom: 8px;
}
.fp-subtitle {
    font-size: 16px;
    color: var(--dm-gray-500);
    margin-bottom: var(--spacing-4);
    font-weight: 600;
}
.fp-specs {
    list-style: none;
    padding: 0; margin: 0 0 var(--spacing-6) 0;
}
.fp-specs li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--dm-gray-200);
    font-size: 15px;
}
.fp-specs .spec-label {
    color: var(--dm-gray-500);
}
.fp-specs .spec-value {
    font-weight: bold;
    color: var(--dm-black);
}
.fp-actions {
    display: flex;
    gap: var(--spacing-3);
}

.sany-category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px; /* To create thin borders */
    background: var(--dm-gray-200);
    border: 1px solid var(--dm-gray-200);
}
.category-icon-card {
    background: var(--dm-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-5) var(--spacing-2);
    text-align: center;
    text-decoration: none;
    color: var(--dm-black);
    transition: all 0.3s ease;
}
.category-icon-card:hover {
    box-shadow: inset 0 0 0 2px #E60012;
    color: #E60012;
}
.category-icon-card img {
    width: 60px; height: 60px;
    object-fit: contain;
    margin-bottom: 12px;
}
.category-icon-card span {
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 1023px) {
    .featured-product-box { grid-template-columns: 1fr; }
    .sany-category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .sany-category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 4. Solutions 2x2 ── */
.solutions-2x2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-5);
}
.solution-2x2-card {
    display: block;
    text-decoration: none;
    color: var(--dm-black);
}
.solution-2x2-card .img-wrapper {
    overflow: hidden;
    margin-bottom: 16px;
}
.solution-2x2-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.solution-2x2-card:hover img {
    transform: scale(1.05);
}
.solution-2x2-card h3 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid transparent;
    padding-bottom: 8px;
    transition: all 0.3s ease;
}
.solution-2x2-card:hover h3 {
    color: #E60012;
    border-bottom-color: #E60012;
}

@media (max-width: 767px) {
    .solutions-2x2-grid { grid-template-columns: 1fr; }
}

/* ── 5. Cases (Tabs + Accordion) ── */
.sany-case-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: var(--spacing-6);
    overflow-x: auto;
}
.case-tab {
    padding: 16px 24px;
    font-weight: 700;
    color: var(--dm-gray-500);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}
.case-tab.active {
    color: #E60012;
    border-bottom-color: #E60012;
}

.sany-case-content {
    display: none;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-4);
}
.sany-case-content.active {
    display: grid;
    animation: fadeInSlide 0.5s ease forwards;
}

.case-featured-visual {
    position: relative;
    overflow: hidden;
}
.case-featured-visual img {
    width: 100%; height: 100%;
    min-height: 400px;
    object-fit: cover;
}
.case-visual-title {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    display: flex; justify-content: space-between;
}
.case-visual-title:hover { color: #E60012; }

.case-related-product-card {
    background: var(--dm-white);
    padding: var(--spacing-4);
    border: 1px solid var(--dm-gray-200);
    display: flex;
    flex-direction: column;
}
.cr-title {
    font-size: 14px;
    color: var(--dm-gray-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: bold;
}
.cr-model {
    font-size: 24px;
    font-weight: 800;
    color: var(--dm-black);
    margin-bottom: 12px;
}
.cr-image {
    text-align: center;
    margin-bottom: 12px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cr-image img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
}
.cr-specs {
    margin-bottom: 16px;
}
.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--dm-gray-200);
}
.spec-row span {
    color: var(--dm-gray-500);
}
.spec-row strong {
    color: var(--dm-black);
}

@media (max-width: 1023px) {
    .sany-case-content { grid-template-columns: 1fr; }
}

/* ── 6. The DUOMI Commitment ── */
.sany-commitment-section {
    padding: 80px 0;
    background-color: var(--dm-white);
}

/* Real Machines Marquee */
.commitment-real-machines {
    margin-top: 40px;
    margin-bottom: 20px;
}
.crm-subtitle {
    text-align: left;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--dm-black);
    margin-bottom: 30px;
    text-transform: uppercase;
}
.crm-marquee-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
}
.crm-marquee-track {
    display: flex;
    width: max-content;
    animation: scrollMarquee 45s linear infinite;
}
.crm-marquee-track:hover {
    animation-play-state: paused;
}
@keyframes scrollMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.crm-item {
    width: 312px;
    margin: 0 15px;
    flex-shrink: 0;
}
.crm-item-inner {
    background: #fff;
    border: 1px solid var(--dm-gray-200);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    padding-bottom: 24px;
}
.crm-item-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: #E60012;
}
.crm-factory-wrapper {
    width: 100%;
    height: 180px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    position: relative;
}
.crm-factory {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.crm-item-inner:hover .crm-factory {
    transform: scale(1.05);
}
.crm-logo {
    width: 120px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: absolute;
    top: 180px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}
.crm-industry {
    margin-top: 35px;
    font-size: 16px;
    font-weight: 700;
    color: var(--dm-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 767px) {
    .crm-item {
        width: 280px;
        margin: 0 10px;
    }
}

.commitment-subtitle {
    font-size: 18px;
    color: var(--dm-gray-500);
    margin-top: 10px;
    margin-bottom: 60px;
}

/* Timeline */
.commitment-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    width: 100%;
    margin: 0 auto 60px;
}
.timeline-track {
    position: absolute;
    top: 60px; /* Align with the dots */
    left: 8%;
    right: 8%;
    height: 1px;
    background-color: var(--dm-gray-300);
    z-index: 1;
}
.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ts-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--dm-gray-400);
}
.ts-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--dm-black);
    margin: 4px 0 10px;
    transition: color 0.3s ease;
}
.ts-connector {
    width: 1px;
    height: 16px;
    background-color: var(--dm-gray-300);
    margin-bottom: -1px;
}
.ts-dot {
    width: 9px;
    height: 9px;
    background-color: var(--dm-black);
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 0 0 4px var(--dm-white); /* Cutout effect */
}
.ts-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--dm-white);
    padding: 3px;
    border: 1px solid var(--dm-gray-200);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 3;
}
.ts-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.timeline-step:hover .ts-avatar {
    border-color: #E60012;
    box-shadow: 0 8px 20px rgba(230,0,18,0.2);
    transform: translateY(-5px);
}
.timeline-step:hover .ts-title {
    color: #E60012;
}
.ts-role {
    font-size: 14px;
    font-weight: 500;
    color: var(--dm-gray-600);
    margin-top: 15px;
    line-height: 1.4;
    position: relative;
    z-index: 3;
    background: var(--dm-white);
    padding: 0 5px;
}

/* Checklist Box */
.commitment-checklist-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 30px;
    border: 1px dashed var(--dm-gray-300);
    padding: 40px;
    width: 100%;
    margin: 0 auto 50px;
    text-align: left;
    background-color: #fcfcfc;
}
.check-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--dm-black);
    letter-spacing: 0.5px;
}
.check-item svg {
    color: #E60012;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Slogan */
.commitment-slogan {
    font-size: 18px;
    font-weight: 600;
    color: var(--dm-black);
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 1023px) {
    .commitment-checklist-box {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 767px) {
    .commitment-timeline {
        flex-direction: column;
        align-items: center;
        margin-bottom: 40px;
        gap: 30px;
    }
    .timeline-track {
        left: 50%;
        top: 0;
        bottom: 0;
        width: 1px;
        height: 100%;
        margin-left: -0.5px;
    }
    .timeline-step {
        width: 100%;
        margin-bottom: 0;
    }
    .ts-connector { display: none; }
    .ts-dot { margin-bottom: 10px; }
    
    .commitment-checklist-box {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
}

/* ── 7. News ── */
.news-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 20px;
}
.all-news-link {
    color: var(--dm-gray-500);
    font-weight: bold;
    text-decoration: none;
}
.sany-news-tabs {
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}
.sany-news-tabs span {
    display: inline-block;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
}
.sany-news-tabs span.active {
    border-bottom: 2px solid #E60012;
    color: #E60012;
}
.sany-news-panel {
    display: none;
}
.sany-news-panel.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sany-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.sany-news-card {
    background: var(--dm-white);
    display: block;
    text-decoration: none;
    color: var(--dm-black);
    transition: box-shadow 0.3s ease;
}
.sany-news-card:hover {
    box-shadow: var(--shadow-lg);
}
.news-img img {
    width: 100%; aspect-ratio: 16/9; object-fit: cover;
}
.news-content {
    padding: 20px;
}
.news-meta {
    font-size: 12px; color: var(--dm-gray-500); margin-bottom: 10px;
    display: flex; gap: 16px;
}
.news-content h4 {
    font-size: 16px; line-height: 1.4; margin: 0;
}
@media (max-width: 767px) {
    .sany-news-grid { grid-template-columns: 1fr; }
}

/* ── 8. Form / Quote ── */
.quote-help-text {
    margin-top: -20px;
    margin-bottom: 40px;
    color: var(--dm-gray-500);
}
.quote-help-text a { color: #E60012; text-decoration: none; }

.sany-complex-form .form-group {
    margin-bottom: 24px;
}
.sany-complex-form label {
    display: block; font-weight: bold; margin-bottom: 8px; font-size: 14px;
}
.sany-complex-form .req { color: #E60012; }
.form-row-3 {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.sany-complex-form input[type="text"],
.sany-complex-form input[type="email"],
.sany-complex-form input[type="tel"],
.sany-complex-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    border-radius: 2px;
    font-family: inherit;
}
.sany-complex-form input:focus, .sany-complex-form textarea:focus {
    border-color: #E60012; outline: none; background: white;
}
@media (max-width: 767px) {
    .form-row-3 { grid-template-columns: 1fr; }
}
