:root {
    --primary: #232f3e;
    --accent: #FF9900;
    --grahas-blue: #007bff;
    --light-gray: #f3f3f3;
    --text: #333;
}

body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 0; background-color: white; color: var(--text); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Top Bar */
.top-bar { background: #ffe8b6; text-align: center; padding: 8px; font-size: 0.9rem; }

/* Header - Logo Prominence */
header { background: var(--primary); padding: 15px 0; color: white; }
.header-content { display: flex; align-items: center; justify-content: space-between; }
.logo { height: 70px; width: auto; display: block; } /* Increased Size */
.search-bar-fake { display: flex; background: white; border-radius: 4px; overflow: hidden; width: 50%; }
.search-bar-fake input { border: none; padding: 10px; width: 100%; outline: none; }
.search-bar-fake button { background: var(--accent); border: none; padding: 0 15px; cursor: default; }

/* Nav */
.category-nav { background: var(--primary); padding-bottom: 10px; overflow-x: auto; white-space: nowrap; }
.cat-btn { background: transparent; color: white; border: none; padding: 10px 20px; font-size: 1rem; cursor: pointer; border-radius: 20px; transition: 0.3s; }
.cat-btn.active, .cat-btn:hover { background: rgba(255,255,255,0.2); font-weight: bold; }

/* Hero & Features */
.hero { text-align: center; padding: 40px 20px; background: #fdfdfd; border-bottom: 1px solid #ddd; }
.hero h1 { margin: 0 0 10px 0; }
.features { padding: 60px 15px; background-color: #fff; border-bottom: 1px solid #eee; }
.feature-header { text-align: center; margin-bottom: 40px; max-width: 800px; margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; text-align: center; }
.feature-card { padding: 30px; background: #f9f9f9; border-radius: 8px; transition: 0.3s; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.feature-card .icon { font-size: 3rem; margin-bottom: 15px; }

/* Grid */
.products { padding: 40px 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 30px; }
.card { border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: 0.3s; background: white; cursor: pointer; }
.card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); transform: translateY(-5px); }
.card-img { width: 100%; height: 250px; object-fit: contain; padding: 20px; background: #fff; }
.card-info { padding: 15px; }
.tag { font-size: 0.8rem; color: #666; text-transform: uppercase; letter-spacing: 1px; }
.price { color: #B12704; font-weight: bold; font-size: 1.1rem; margin: 5px 0; }

/* Form */
.form-group { margin-bottom: 15px; }
.form-row { display: flex; gap: 10px; margin-bottom: 15px; }
.form-row input { flex: 1; }
.form-group input, .form-group textarea, .form-row input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.95rem; box-sizing: border-box; font-family: inherit; }
.text-center { text-align: center; }

/* FAQ */
.faq { padding: 40px 15px; max-width: 800px; }
.faq-item { margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 20px; }

/* Footer (Updated) */
footer { background: var(--primary); color: white; padding: 50px 0 20px; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; text-align: left; }
.footer-col h4 { border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 20px; display: inline-block; }
.footer-col a { color: #ddd; text-decoration: none; display: block; margin-bottom: 10px; }
.footer-col p { color: #ddd; margin-bottom: 10px; line-height: 1.6; }
.copyright { text-align: center; margin-top: 40px; border-top: 1px solid #444; padding-top: 20px; font-size: 0.8rem; color: #888; }

/* Modal & AR Viewer Fixes */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); overflow: auto; }
.modal-content { background: white; margin: 5% auto; padding: 20px; width: 90%; max-width: 900px; border-radius: 8px; position: relative; }
.small-modal { max-width: 500px; margin: 10% auto; }
.close-btn, .close-btn-lead { position: absolute; top: 10px; right: 20px; font-size: 30px; cursor: pointer; z-index: 10; }
.modal-body { display: flex; flex-wrap: wrap; gap: 30px; }

/* The AR Container needs a color so it's not invisible while loading */
.ar-viewer-container { flex: 1; min-width: 300px; background: #f4f4f4; border-radius: 8px; height: 400px; position: relative; display: flex; align-items: center; justify-content: center; }
.product-details { flex: 1; min-width: 300px; display: flex; flex-direction: column; justify-content: center; }

/* Ensure Model Viewer takes full space */
#model-container { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
model-viewer { width: 100%; height: 100%; --poster-color: transparent; }

#ar-loader { font-weight: bold; color: #666; }
.ar-instructions { position: absolute; bottom: 10px; width: 100%; text-align: center; font-size: 0.8rem; color: #555; pointer-events: none; z-index: 5; }
.meta-note { background: #e7f3ff; padding: 15px; border-radius: 5px; margin: 20px 0; font-size: 0.9rem; border-left: 4px solid var(--grahas-blue); }

.ar-btn { background: var(--grahas-blue); color: white; border: none; padding: 15px; font-size: 1rem; border-radius: 5px; cursor: pointer; width: 100%; margin-bottom: 10px; font-weight: bold; }
.cart-btn { background: var(--accent); color: black; border: none; padding: 15px; font-size: 1rem; border-radius: 5px; cursor: pointer; width: 100%; font-weight: bold; }
.calendly-btn { display: inline-block; background: var(--grahas-blue); color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px; font-weight: bold; margin-top: 20px; }

/* Mobile Optimization Fixes */
@media (max-width: 768px) {
    /* 1. Maximize Modal Width & Enable Scroll */
    .modal-content {
        width: 90%; /* Slightly wider */
        margin: 5% auto;
        padding: 15px;
        max-height: 85vh; /* Ensures modal fits on screen */
        overflow-y: auto; /* Enables scrolling if content is too tall */
        display: flex;
        flex-direction: column;
    }

    /* 2. Stack the Layout vertically */
    .modal-body {
        flex-direction: column;
        gap: 15px;
        display: block; /* Ensures stacking works */
    }

    /* 3. Force 3D Viewer Height & Background */
    .ar-viewer-container {
        width: 100%;
        height: 40vh; /* Takes 40% of the screen height */
        min-height: 250px; /* Minimum safety height */
        margin-bottom: 20px;
        background: #f0f0f0; /* Visible gray background for loading state */
        border-radius: 8px;
    }

    /* 4. Fix Close Button Position so it's clickable */
    .close-btn {
        top: 10px;
        right: 10px;
        font-size: 1.5rem;
        z-index: 100;
        color: #333;
        background: rgba(255,255,255,0.9);
        border-radius: 50%;
        width: 35px;
        height: 35px;
        line-height: 35px;
        text-align: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    /* 5. Adjust Logo and Typography */
    .logo { height: 45px; } 
    .hero h1 { font-size: 1.8rem; }
    .feature-grid { grid-template-columns: 1fr; }
    
    /* 6. Button Sizing */
    .ar-btn, .cart-btn { padding: 15px; font-size: 1rem; margin-bottom: 10px; }
}