* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--white);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Products Section */
.products {
    padding: 5rem 0;
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

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

.placeholder-image {
    font-size: 5rem;
    opacity: 0.9;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.product-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.product-price {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}


/* Colors Section */
.colors-section {
    padding: 6rem 0;
    background-color: #f9fafb;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    justify-items: center;
}

.filament-spool {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
}

.filament-spool:hover {
    transform: translateY(-5px);
}

/* Filament Visual Representation */
.spool-visual {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 8px solid #333;
    /* Spool sides */
    background-color: #eee;
    margin-bottom: 1rem;
    overflow: hidden;
}

.filament-color {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #fff;
    /* Gap between spool and filament */
    box-sizing: border-box;
    position: relative;
}

/* Highlight reflection for plastic look */
.filament-color::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%);
}

/* Inner spool hole */
.spool-visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    background-color: #222;
    /* Dark hole */
    border-radius: 50%;
    z-index: 2;
    border: 2px solid #555;
}

.filament-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.filament-type {
    font-size: 0.85rem;
    color: #6b7280;
    background-color: #e5e7eb;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Contact Section */
.contact {
    padding: 5rem 0;
    background: var(--white);
}

.contact-wrapper {
    max-width: 700px;
    margin: 3rem auto 0;
}

.contact-info {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 15px;
    height: fit-content;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.contact-info ul {
    list-style: none;
}

.contact-info li {
    padding: 0.75rem 0;
    color: var(--text-color);
    font-size: 1rem;
}

.contact-form {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 15px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.form-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid var(--success-color);
}

.form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid var(--error-color);
}

/* Footer */
footer {
    background: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0;
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

    .products,
    .contact {
        padding: 3rem 0;
    }
}

/* Modal Styles */
.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.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
}

.modal-close:hover {
    color: var(--text-color);
    background: var(--white);
    transform: rotate(90deg);
}

/* Fix "Order" button visibility in modal */
.modal-cta .btn-primary {
    background: var(--primary-color);
    color: var(--white);
    width: 100%;
    text-align: center;
    border: 1px solid var(--primary-color);
    margin-top: 1rem;
}

.modal-cta .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.modal-images {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-main-image {
    width: 100%;
    height: 400px;
    background: #f3f3f3;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.placeholder-image-large {
    font-size: 6rem;
    opacity: 0.9;
}

.modal-thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    overflow: hidden;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.modal-description {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.modal-features {
    margin-bottom: 2rem;
}

.modal-features h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.modal-features ul {
    list-style: none;
    padding: 0;
}

.modal-features li {
    padding: 0.5rem 0;
    color: var(--text-color);
    padding-left: 1.5rem;
    position: relative;
}

.modal-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.modal-cta {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .modal-main-image {
        height: 300px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }
}

/* Color Selection UI */
#color-selection-container {
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid #eee;
}

#color-selection-container h3 {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: flex-start;
}

.swatch-item {
    cursor: pointer;
    transition: transform 0.2s;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: 50%;
}

.swatch-item:hover {
    transform: scale(1.1);
}

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

.swatch-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* 3D Viewer Loader */
.viewer-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(243, 243, 243, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.viewer-loader p {
    color: var(--text-color);
    font-weight: 500;
}