/* --- Global Reset & Base --- */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Outfit", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    min-height: 100dvh;
    position: relative; /* For positioning fixed elements relative to body */
    overflow-x: hidden; /* Prevent horizontal scroll from hidden panels */
    padding-bottom: 70px; /* Space for bottom nav bar */
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Layout --- */
.main-content {
    padding: 20px;
    padding-bottom: 80px; /* Ensure content doesn't hide behind nav */
    transition: filter 0.3s ease-in-out; /* For potential blur/dim effect */
}

body.panel-active .main-content {
   /* filter: blur(2px) brightness(0.8); Optional effect */
}


/* --- Bottom Navigation Bar --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid #eee;
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 12px;
    padding: 5px 10px;
    flex-grow: 1;
    text-align: center;
    transition: color 0.2s ease;
}

.nav-button:hover,
.nav-button.active /* Add active class via JS if needed */ {
    color: #007aff; /* Example active color */
}

.nav-button i { /* Placeholder for icons */
    font-size: 20px;
    margin-bottom: 3px;
}

/* --- Slide-Out Panels --- */
.slide-panel {
    position: fixed;
    top: 0;
    bottom: 0; /* Ensures full height */
    height: 100vh;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    z-index: 1002; /* Above overlay */
    overflow-y: auto;
    padding: 20px;
    padding-top: 50px; /* Space for close button */
    transition: transform 0.35s ease-in-out;
}

.panel-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
}

/* Right Panel (Menu/Categories) */
.panel-right {
    right: 0;
    width: 25%;
    transform: translateX(100%); /* Start off-screen */
    border-left: 1px solid #eee;
}

.panel-right.active {
    transform: translateX(30%);
}

/* Left Panel (Product List) */
.panel-left {
    left: 0;
    width: 20%;
    transform: translateX(-100%); /* Start off-screen */
    border-right: 1px solid #eee;
}

.panel-left.active {
    transform: translateX(-50%);
}

.panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.panel-list li {
    margin-bottom: 10px;
}

.panel-list a {
    display: block;
    padding: 10px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    
    
}

#left-panel a {
    text-align: right;
}

#left-panel a i{
    position: absolute;
    right: 30%;
    font-weight: 500;
    font-size: 20px;

    
}

.panel-list a:hover {
    background-color: #f8f8f8;
    color: #007aff;
}

/* --- Left Panel Trigger Button --- */
.left-panel-trigger {
    position: fixed;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 122, 255, 0.8); /* Semi-transparent blue */
    color: white;
    border: none;
    padding: 15px 8px;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    cursor: pointer;
    z-index: 999; /* Below panels */
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    font-size: 18px; /* Adjust if using an icon */
    writing-mode: vertical-rl; /* Rotate text/icon if needed */
    text-orientation: mixed;
    transition: background-color 0.2s ease;
}
.left-panel-trigger:hover {
    background-color: rgba(0, 122, 255, 1);
}


/* --- Overlay for Panels --- */
.overlay {
    position: fixed;
    inset: 0; /* top, right, bottom, left = 0 */
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001; /* Between content and panels */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease-in-out, visibility 0.35s ease-in-out;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Index Page Specific --- */
.welcome-heading {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.category-slider {
    margin-bottom: 30px;
    overflow-x: auto;
    white-space: nowrap; /* Keep items in one line */
    padding: 10px 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #ccc #f0f0f0; /* Firefox */
}
/* Webkit scrollbar styling */
.category-slider::-webkit-scrollbar {
  height: 6px;
}
.category-slider::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}
.category-slider::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}


.category-item {
    display: inline-block; /* Align items horizontally */
    background-color: #fff;
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 14px;
    color: #555;
}
.category-item:last-child {
    margin-right: 0;
}
.category-item:hover {
    background-color: #eef;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pdf-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pdf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.pdf-card h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #444;
}

.pdf-card a {
    display: inline-block;
    background-color: #007aff;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.pdf-card a:hover {
    background-color: #005bb5;
}

/* --- Product Page Specific --- */
.product-page-title {
    text-align: center;
    margin-bottom: 30px;
}

.product-grid {
    display: grid;
    /* Adjust minmax for desired minimum item width */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; /* Increased gap for better separation */
}

.product-item {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    padding: 15px;
    position: relative; /* For positioning overlay */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Contain elements */
}

model-viewer {
    width: 100%;
    height: 250px; /* Adjust height as needed */
    border-radius: 5px;
    background-color: #eee; /* Placeholder background */
    margin-bottom: 15px;
    flex-shrink: 0; /* Prevent shrinking */
}

.color-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.color-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.color-button:hover {
    transform: scale(1.1);
}
.color-button.active {
    border-color: #007aff; /* Highlight active color */
    border-width: 3px;
}
.color-button[data-color="black"] { background-color: #333; }
.color-button[data-color="blue"] { background-color: #4a90e2; }
.color-button[data-color="green"] { background-color: #50e3c2; }
.color-button[data-color="yellow"] { background-color: #f5a623; }

.active-color-label {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    text-transform: capitalize;
}

.dimensions-controls {
    text-align: center;
    margin-top: auto; /* Push to bottom if needed */
}

.toggle-dimensions {
    background-color: #eee;
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85em;
    transition: background-color 0.2s ease;
    margin-top: 5px; /* Add some space */
}
.toggle-dimensions:hover {
    background-color: #ddd;
}

.dimensions-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    font-size: 0.8em;
    z-index: 10; /* Above model-viewer */
    display: none; /* Hidden by default */
    border: 1px solid #eee;
    pointer-events: none; /* Don't block model interaction */
}
.dimensions-overlay.visible {
    display: block;
}


/* --- Catalog Page Specific --- */
.catalog-container {
    padding: 0; /* Remove padding if iframe should be edge-to-edge */
}
.pdf-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pdf-controls button {
    padding: 10px 15px;
    background-color: #eee;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 14px;
}
.pdf-controls button.active {
    background-color: #007aff;
    color: white;
}
.pdf-controls button:hover:not(.active) {
    background-color: #ddd;
}

#pdf-viewer {
    width: 100%;
    height: calc(100vh - 150px); /* Adjust height considering header/nav/controls */
    border: 1px solid #ccc;
    border-radius: 5px;
}


/* --- Responsiveness --- */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px; /* Adjust if nav bar height changes */
    }
    .main-content {
        padding: 15px;
        padding-bottom: 75px;
    }

    /* Make panels wider on mobile */
    .panel-right { width: 80%; }
    .panel-left { width: 75%; }

    .pdf-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }

    .product-grid {
         grid-template-columns: 1fr; /* Stack products on mobile */
    }

    model-viewer {
        height: 300px; /* Potentially taller on mobile */
    }

     .left-panel-trigger {
        padding: 12px 6px;
        font-size: 16px;
    }

    .nav-button span { /* Hide text labels on very small screens maybe */
       /* display: none; */
    }
    .nav-button i {
        font-size: 24px; /* Larger icons */
    }

    #pdf-viewer {
       height: calc(100vh - 180px); /* Adjust mobile PDF viewer height */
    }
}

@media (max-width: 480px) {
    .panel-right { width: 90%; }
    .panel-left { width: 85%; }

     .category-item {
        padding: 8px 15px;
        font-size: 13px;
    }
    .pdf-card h3 { font-size: 1em; }
    .pdf-card a { font-size: 0.85em; }

    .color-button { width: 28px; height: 28px; }
}


/* --- Additions to Product Page Specific Styles --- */

/* ... (keep existing model-viewer, color-switcher, etc. styles) ... */

.ar-controls {
    text-align: center;
    margin: 15px 0 10px 0; /* Add some spacing */
}

.ar-button {
    display: inline-flex; /* Align icon and text */
    align-items: center;
    justify-content: center;
    background-color: #007aff; /* iOS blue */
    color: white;
    padding: 10px 20px;
    border-radius: 25px; /* Pill shape */
    font-size: 1em; /* Slightly larger text */
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.ar-button i { /* Style for icon */
    margin-right: 8px;
    font-size: 1.1em; /* Slightly larger icon */
}

.ar-button:hover {
    background-color: #005ecb; /* Darker blue on hover */
}

.ar-button:active {
    transform: scale(0.97); /* Press down effect */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Optional: Style adjustment if AR is not available */
/* Model viewer adds 'ar-button-is-hidden' class to itself when AR isn't possible */
model-viewer.ar-button-is-hidden ~ .ar-controls .ar-button {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #aaa; /* Grey out */
    /* Or display: none; if you prefer to hide it completely */
}


/* --- Minor Adjustment to Existing Styles --- */
.dimensions-controls {
    margin-top: 5px; /* Slightly reduce top margin if AR button is present */
}

/* Ensure model-viewer doesn't overlap controls if height is tight */
model-viewer {
    /* Existing styles */
    position: relative; /* Needed for slot */
    z-index: 1; /* Ensure it's behind overlay potentially */
}

/* --- Profile Page Specific --- */
.profile-content {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 600px; /* Optional: Limit width on larger screens */
    margin: 20px auto; /* Center the content block */
}

.profile-content h1 {
    text-align: center;
    margin-bottom: 20px;
}

.profile-content ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.profile-content li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.profile-content li:last-child {
    border-bottom: none;
}

.profile-content li strong {
    display: inline-block;
    width: 120px; /* Adjust as needed */
    color: #555;
}

/* Style for the optional PDF link button */
.pdf-link-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 18px;
    background-color: #6c757d; /* Grey color */
    color: white;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.pdf-link-button:hover {
    background-color: #5a6268;
}