/* Global Styles & Variables */
:root {
    --light-green: #e8f5e9;
    --light-yellow: #fffde7;
    --accent-red: #d32f2f;
    --accent-blue: #1976d2;
    --text-color: #333;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

html {
    overflow-x: clip;
}

body {
    background: linear-gradient(135deg, var(--light-green) 0%, var(--light-yellow) 100%);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: clip;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    width: 100%;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-red);
}

.logo img {
    display: block;
    width: 68px;
    height: 44px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--accent-red);
    background-color: rgba(211, 47, 47, 0.08);
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.2);
}

/* Hero Section */
.hero-section {
    padding: 64px 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    text-align: left;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #1a237e;
}

.hero-headline {
    display: grid;
    width: 100%;
    min-width: 0;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.typewriter-reserve,
.typewriter-output {
    grid-area: 1 / 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.typewriter-reserve {
    visibility: hidden;
}

.typewriter-character {
    visibility: hidden;
}

.typewriter-character.is-visible {
    visibility: visible;
}

.typewriter-caret {
    display: inline-block;
    height: 0.95em;
    margin-left: 0.08em;
    border-right: 2px solid var(--accent-red);
    vertical-align: -0.08em;
    animation: typewriter-caret-blink 0.75s steps(2, start) infinite;
}

@keyframes typewriter-caret-blink {
    to {
        visibility: hidden;
    }
}

.hero-content .highlight {
    color: var(--accent-red);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-visual img {
    display: block;
    width: 100%;
    max-width: 540px;
    height: auto;
    object-fit: contain;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.btn-primary {
    background-color: var(--accent-red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: var(--accent-blue);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--accent-red);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Sections Configuration */
section {
    padding: 60px 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: #1a237e;
}

/* Grid Layouts & Cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Card Hover Zoom & Lift Effect */
.card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.card-keunggulan {
    border-top: 5px solid var(--accent-blue);
}

.card-produk {
    text-align: center;
    border-top: 5px solid var(--accent-red);
}

.product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.product-card {
    padding: 22px;
}

.product-image-wrap {
    height: 190px;
    margin-bottom: 18px;
}

.product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.product-card:hover .product-image,
.product-card:focus-within .product-image {
    transform: scale(1.12);
}

.product-card h3 {
    margin-bottom: 10px;
}

.product-card p {
    margin-bottom: 18px;
}

.product-card .btn {
    min-height: 44px;
}

.img-placeholder {
    background-color: #eee;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
}

.price {
    font-size: 1.5rem;
    color: var(--accent-red);
    font-weight: bold;
    margin: 15px 0;
}

/* Contact Section Layout */
.kontak-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.kontak-form, .kontak-info {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.kontak-form h3, .kontak-info h3 {
    margin-bottom: 20px;
    color: #1a237e;
}

.kontak-info h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.3;
}

.location-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.location-list li {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    column-gap: 4px;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.location-icon {
    line-height: 1.4;
}

.location-list address {
    font-style: normal;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

.form-status {
    margin-top: 15px;
}

.form-status:empty {
    display: none;
}

.form-status a {
    color: #1a237e;
    font-weight: 600;
}

.map-container {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #1a237e;
    color: white;
    margin-top: 40px;
}

/* Back to Top Floating Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent-red);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.3s, transform 0.3s;
    z-index: 1001;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-blue);
    transform: scale(1.1);
}

/* CSS Scroll Animations (Slide Left / Right) */
.slide-in-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.active, .slide-in-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Responsive Optimization for Animations */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
    }
    .hero-section {
        padding: 48px 6%;
    }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .hero-content {
        text-align: center;
    }
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-visual img {
        max-width: 460px;
    }
    .nav-links li {
        margin: 0 10px;
    }
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .slide-in-left, .slide-in-right {
        transform: translateY(20px); /* Safely bypass horizontal layout breaks on mobile */
    }
    .slide-in-left.active, .slide-in-right.active {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 8px;
    }
    .nav-links li {
        margin: 0 8px;
    }
    .hero-content h1 {
        font-size: 1.9rem;
    }
    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .product-image-wrap {
        height: 210px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-image {
        transition: none;
    }

    .typewriter-caret {
        animation: none;
    }
}
