:root {
    --primary-blue: #0d2a4c;
    --accent-red: #e60012;
    --dark-text: #222222;
    --light-text: #555555;
    --light-grey-bg: #f4f7f6;
    --white: #ffffff;
    --border-color: #eeeeee;
    --shadow-light: rgba(0,0,0,0.05);
    --shadow-dark: rgba(0,0,0,0.1);
    --font-main: 'Roboto', sans-serif;
    --transition-speed: 0.3s;
}

/* 1. Global Styles & Preloader */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--white);
    overflow-x: hidden;
}

/* This class is added to the body when the sidebar is open to prevent scrolling */
body.sidebar-open {
    overflow: hidden;
}


.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    border: 4px solid var(--shadow-light);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. Header & Navigation */
.header {
    background: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--shadow-light);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav__logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-blue);
    letter-spacing: 1px;
}

.nav__list {
    list-style: none;
    display: flex;
}

.nav__item {
    margin-left: 30px;
}

.nav__link {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 700;
    padding-bottom: 5px;
    position: relative;
    transition: color var(--transition-speed) ease;
}

.nav__link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -2px;
    left: 50%;
    background-color: var(--accent-red);
    transition: all var(--transition-speed) ease-in-out;
}

.nav__link:hover, .nav__link.active {
    color: var(--primary-blue);
}

.nav__link:hover::after, .nav__link.active::after {
    width: 100%;
    left: 0;
}

.nav__controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switcher {
    display: flex;
    align-items: center;
    color: #cccccc;
}

.lang-switcher__btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #888;
    padding: 0 8px;
    font-size: 0.9rem;
    transition: color var(--transition-speed) ease;
}

.lang-switcher__btn--active,
.lang-switcher__btn:hover {
    color: var(--primary-blue);
}

.nav__hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
}
.nav__hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background: var(--dark-text);
    transition: all var(--transition-speed) ease;
}

/* 3. Hero Section */
.hero {
    position: relative;
    background: url('../images/hero-background.jpg') no-repeat center center/cover;
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
    z-index: 1;
}

.hero__title {
    position: relative;
    z-index: 2;
    font-size: 4rem;
    font-weight: 900;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

/* 4. Content Sections, Tabs & Filters */
.content-section {
    padding: 4rem 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    font-weight: 900;
    color: var(--primary-blue);
}

/* --- START: TOKOPEDIA-STYLE FILTER & LAYOUT --- */

.btn-filter-toggle {
    margin-bottom: 2rem;
    display: none !important; /* <-- FIX IS HERE */
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
}

.shop-sidebar {
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--light-text);
    display: none; /* Only shown on mobile */
}

.sidebar-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.btn-reset {
    width: 100%;
    margin-bottom: 2rem;
    padding: 0.6rem;
    background: none;
    border: 1px solid var(--light-text);
    color: var(--light-text);
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.btn-reset:hover {
    background: var(--light-grey-bg);
    border-color: var(--dark-text);
    color: var(--dark-text);
}


.filter-block {
    margin-bottom: 2rem;
}

.filter-block__title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--dark-text);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.filter-options .radio-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.filter-options input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}

.filter-options label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--light-grey-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-options input[type="radio"]:checked + label {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.price-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.price-prefix {
    padding: 0.6rem;
    background-color: var(--light-grey-bg);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.price-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0 4px 4px 0;
}
/* Hide number input arrows */
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.price-input[type=number] {
  -moz-appearance: textfield;
}

.filter-select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--white);
    font-size: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}

/* --- END: TOKOPEDIA-STYLE FILTER & LAYOUT --- */

/* 5. Grids & Cards */

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 10px var(--shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px var(--shadow-dark);
}

.card__img-container {
    width: 100%;
    height: 220px;
    background-color: #fdfdfd;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.card__content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card__title {
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark-text);
}

.card__text {
    margin-bottom: 1.5rem;
    color: var(--light-text);
    font-size: 1rem;
    flex-grow: 1;
}

.btn {
    display: inline-block;
    background: var(--primary-blue);
    color: var(--white);
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease;
}

.btn:hover {
    background: var(--accent-red);
    transform: scale(1.05);
}

/* 6. Contact Page Specifics */
.contact-section {
    text-align: center;
    padding-top: 2rem;
}
.contact-text {
    max-width: 650px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.1rem;
    line-height: 1.7;
}


/* 7. Footer */
.footer {
    text-align: center;
    padding: 2.5rem;
    background: var(--dark-text);
    color: #aaaaaa;
}

/* 8. Modal for 3D Viewer */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.5s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: black;
}

.modal-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: center;
}

.modal-details h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}
.modal-details p {
    margin-bottom: 1rem;
}
.modal-details .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 2rem;
}


/* 9. Responsive Design */
@media (max-width: 992px) {
    /* --- START: RESPONSIVE FILTER SIDEBAR --- */
    .btn-filter-toggle {
        display: inline-block !important; /* Show the button on mobile. The !important is needed to override the desktop !important */
    }

    .shop-layout {
        grid-template-columns: 1fr; /* Stack content on mobile */
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        height: 100%;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease-in-out;
        border-right: none;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    
    .shop-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay.is-open {
        display: block;
    }
     /* --- END: RESPONSIVE FILTER SIDEBAR --- */


    .nav__list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        text-align: center;
        box-shadow: 0 4px 10px var(--shadow-light);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }

    .nav__list.active {
        display: flex;
        max-height: 500px;
    }

    .nav__item {
        margin: 0;
    }
    .nav__link {
        display: block;
        padding: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    .nav__link::after {
        display: none;
    }
    .nav__hamburger {
        display: block;
    }

    .nav__hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav__hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .nav__hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .modal-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* ---- START: NEW MOBILE FONT SIZE ADJUSTMENTS ---- */
    html {
        font-size: 15px; /* Reduces base font size, affecting rem units */
    }

    .hero__title {
        font-size: 2.5rem; /* Was 2.8rem */
    }

    .section-title {
        font-size: 2rem; /* Was 2.5rem */
    }

    .card__title {
        font-size: 1.4rem; /* Was 1.6rem */
    }

    .modal-details h2 {
        font-size: 1.8rem; /* Was 2.2rem */
    }
    /* ---- END: NEW MOBILE FONT SIZE ADJUSTMENTS ---- */
}

/* 10. Model Detail Page Styles */
/* ----------------------------- */

.detail-hero {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    align-items: center;
    gap: 2rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.detail-hero__content {
    text-align: left;
}

.detail-hero__title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary-blue);
    line-height: 1.1;
}

.detail-hero__tagline {
    font-size: 1.5rem;
    color: var(--light-text);
    margin: 1rem 0 1.5rem;
}

.detail-hero__price {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.detail-hero__image-container {
    text-align: center;
}

.detail-hero__image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.key-specs {
    display: flex;
    justify-content: space-around;
    background-color: var(--light-grey-bg);
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.key-specs__item {
    text-align: center;
}

.key-specs__label {
    display: block;
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 0.25rem;
}

.key-specs__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.feature-item {
    text-align: center;
}

.feature-item__img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.feature-item__content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

.feature-item__content p {
    color: var(--light-text);
    line-height: 1.7;
}

.specs-table-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-size: 1.2rem;
}

.specs-table td {
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.specs-table tr:nth-child(even) {
    background-color: var(--light-grey-bg);
}

.specs-table td:first-child {
    font-weight: 700;
    width: 40%;
}

.model-viewer-container {
    margin-bottom: 4rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px var(--shadow-light);
}

model-viewer {
    width: 100%;
    height: 500px;
    background-color: #fdfdfd;
}

/* 11. Model Detail Responsive */
/* ----------------------------- */

@media(max-width: 992px) {
    .detail-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .detail-hero__content {
        text-align: center;
        order: 2;
    }
    .detail-hero__image-container {
        order: 1;
    }
    .detail-hero__title {
        font-size: 2.8rem;
    }
}

@media(max-width: 768px) {
    .key-specs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .features-grid,
    .specs-table-container {
        grid-template-columns: 1fr;
    }
    .detail-hero__title {
        font-size: 2.2rem;
    }
    model-viewer {
        height: 350px;
    }
}