/* Root variables for colors and sizing */
:root {
    --color-primary: #042b51;
    --color-secondary: #0de19a;
    --color-bg: #ffffff;
    --color-text: #333333;
    --max-width: 1200px;
}

/* Global styles */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
}

/* Utility container to center content */
.container {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Header styles */
.site-header {
    position: absolute;
    top: 3rem;
    left: 0;
    width: 100%;
    height: 7rem;
    z-index: 10;
    background-color: #ffffff;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    opacity: 0.9;
}

/* Logo styles */
.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 6rem;
    width: auto;
    object-fit: contain;
    padding-right: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

/* Navigation styles */
.nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    padding: 0;
    margin: 0;
}

.nav li {
    flex: 0 0 auto;
}

.nav a {
    display: block;
    color: #111;
    font-size: clamp(1rem, 1.15vw + 0.55rem, 2rem);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0;
    line-height: 1.1;
    white-space: nowrap;
    text-shadow: none;
    transition: color 0.2s ease;
}

.nav a:hover,
.nav a.active,
.dropdown-menu a:hover,
.dropdown-menu a.active {
    color: var(--color-secondary);
}

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 14px;
}

.nav ul.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    flex-direction: column;
    gap: 0;
    padding: 0.4rem 0;
    margin-left: 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #eaecef;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10);
    min-width: 220px;
    z-index: 1000;
}

.nav-dropdown:hover > .dropdown-menu,
.nav-dropdown:focus-within > .dropdown-menu,
.nav-dropdown.is-open > .dropdown-menu {
    display: flex;
}

.dropdown-menu li {
    flex: 0 0 auto;
}

.dropdown-menu a {
    display: block;
    padding: 0.55rem 0.9rem;
    font-size: 1.1rem;
    color: #111;
    text-decoration: none;
    white-space: nowrap;
    text-shadow: none;
}

.dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dropdown-toggle::after {
    content: "▾";
    font-size: 0.9em;
    margin-left: 0.35rem;
}

/* Shared site navigation helpers */
.nav li[hidden],
.nav .nav-item-order[hidden],
.nav .nav-item-admin[hidden] {
    display: none !important;
}

/* Tablet / phone nav behavior */
@media (max-width: 1024px) {
    .site-header {
        height: auto;
        background: #fff;
    }

    .header-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
        opacity: 1;
    }

    .site-header .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .logo-img {
        height: 4.5rem;
        padding-right: 0;
    }

    .nav {
        width: 100%;
    }

    .nav ul {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: clamp(0.2rem, 0.8vw, 0.7rem);
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav ul::-webkit-scrollbar {
        display: none;
    }

    .nav a {
        color: #111;
        font-size: clamp(0.8rem, 2.35vw, 1.02rem);
        padding: 0.15rem 0;
    }

    .nav a:hover,
    .nav a.active,
    .dropdown-menu a:hover,
    .dropdown-menu a.active {
        color: var(--color-secondary);
    }

    .dropdown-toggle::after {
        margin-left: 0.2rem;
    }
}

@media (max-width: 768px) {
    .logo-img {
        height: 3.75rem;
    }

    .nav ul {
        gap: clamp(0.15rem, 0.6vw, 0.45rem);
    }

    .nav a {
        font-size: clamp(0.76rem, 2.8vw, 0.92rem);
    }

    .nav ul.dropdown-menu {
        min-width: 180px;
    }
}

/* Auth area */
.auth-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.auth-form input {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    line-height: 1.2;
}

.auth-form button {
    padding: 0.35rem 0.6rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.auth-hello {
    opacity: 0.8;
    font-size: 0.9rem;
}

.auth-name {
    font-weight: 600;
    text-decoration: none;
    color: var(--color-primary);
}

.auth-name:hover {
    color: var(--color-secondary);
}

.auth-help {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Floating auth above header, on hero background */
.auth-float {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-form--float input {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #cfd8e3;
    color: #111;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 0.3rem;
}

.auth-form--float button {
    padding: 0.38rem 0.65rem;
    font-size: 0.9rem;
    border-radius: 0.3rem;
    background: var(--color-secondary);
    color: #fff;
    border: none;
    cursor: pointer;
}

.auth-form--float button:hover {
    filter: brightness(0.95);
}

.invert {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.auth-float .auth-name,
.auth-float .auth-help,
.auth-float .invert {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.auth-float .auth-name:hover {
    color: #e6f2ff;
}

.auth-float .auth-help {
    opacity: 0.9;
}

@media (max-width: 800px) {
    .auth-float {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.35rem;
        max-width: calc(100% - 1rem);
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .auth-form--float input {
        font-size: 0.85rem;
    }

    .auth-form--float button {
        font-size: 0.85rem;
    }
}

/* Hero section */
.hero {
    background-image: url("hero.png");
    background-size: cover;
    background-position: center;
    color: #ffffff;
    text-align: center;
    padding-top: calc(6rem + 7rem);
    padding-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.75rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Generic section styles */
.section {
    padding: 3rem 1rem;
}

.section h2 {
    margin-top: 0;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--color-primary);
    font-size: 2rem;
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: #ffffff;
    border: 1px solid #eaecef;
    border-radius: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.Integral-img {
    height: auto;
    width: 100%;
    object-fit: contain;
    padding: 0 2px 2px 2px;
}

img.Integral-img {
    border-block: 2px solid darkblue;
    border-left: 2px solid darkblue;
    border-right: 2px solid darkblue;
}

.Semblance-img {
    height: auto;
    width: 100%;
    object-fit: contain;
    padding: 0 2px 2px 2px;
}

img.Semblance-img {
    border-block: 2px solid darkblue;
    border-left: 2px solid darkblue;
    border-right: 2px solid darkblue;
}

.product-card h3 {
    margin-top: 0;
    color: var(--color-primary);
}

.product-card p {
    margin: 0.5rem 0;
}

/* Footer */
.site-footer {
    background-color: var(--color-primary);
    color: #ffffff;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.875rem;
}

/* Readonly input styles */
input[readonly],
textarea[readonly] {
    background: #f6f7f9;
    color: #555;
    cursor: not-allowed;
}

input.readonly,
textarea.readonly {
    background: #f6f7f9;
}

/* Responsive typography / layout */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.25rem;
    }

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

    .logo-text {
        font-size: 1.25rem;
    }

    .auth-slot {
        order: 3;
        width: 100%;
        justify-content: flex-end;
    }
}

/* Make Billing/Shipping fieldsets use a 2-column grid */
#companyForm fieldset {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border: 1px solid #eaecef;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

#companyForm fieldset legend {
    padding: 0 0.25rem;
}

#companyForm fieldset > label {
    grid-column: 1 / -1;
}

/* Products list page tweaks */
.product-card--wide {
    padding: 1.25rem 1.5rem;
}

.product-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.product-hero-link {
    display: block;
}

.product-hero-img {
    display: block;
    width: clamp(260px, 60vw, 860px);
    max-width: 100%;
    height: auto;
    margin: 0.25rem auto 0.85rem auto;
    border-radius: 1rem;
}

/* Product detail page */
.product-detail-grid {
    display: grid;
    grid-template-columns: clamp(260px, 33vw, 520px) 1fr;
    gap: 1.75rem;
    align-items: start;
}

.product-viewer {
    position: relative;
    border: 1px solid #eaecef;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    aspect-ratio: 4 / 3;
}

.viewer-main {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: contain;
    padding: 0.5rem;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(4, 43, 81, 0.72);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    cursor: pointer;
    display: grid;
    place-items: center;
    user-select: none;
}

.viewer-prev {
    left: 0.5rem;
}

.viewer-next {
    right: 0.5rem;
}

.viewer-nav:hover {
    background: rgba(4, 43, 81, 0.85);
}

.viewer-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.thumb {
    border: 1px solid #eaecef;
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.15rem;
    cursor: pointer;
    flex: 0 0 auto;
}

.thumb img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 0.6rem;
}

.thumb.active {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(13, 225, 154, 0.25);
}

.viewer-hint {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.75;
}

.product-card--flat {
    border-radius: 1rem;
}

.product-bullets {
    margin: 1rem 0 0 1.25rem;
}

.muted {
    opacity: 0.8;
}

.small {
    font-size: 0.9rem;
}

.product-docs {
    margin-top: 2.25rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid #eaecef;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.docs-list {
    margin: 0.75rem 0 0 1.25rem;
}

.docs-list a {
    color: var(--color-primary);
    text-decoration: underline;
}

.docs-list a:hover {
    color: var(--color-secondary);
}

.ref-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.ref-input {
    flex: 1 1 auto;
    padding: 0.6rem 0.7rem;
    font-size: 1rem;
    border: 1px solid #cfd8e3;
    border-radius: 0.6rem;
}

.ref-btn {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border-radius: 0.6rem;
    border: 1px solid #cfd8e3;
    background: #fff;
    cursor: pointer;
}

.ref-btn:hover {
    border-color: var(--color-secondary);
}

.cta-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.7rem 1rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
}

.btn-primary {
    background: var(--color-secondary);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(0.95);
}

.btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border: 1px solid #cfd8e3;
}

.btn-secondary:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn-primary.disabled {
    opacity: 0.55;
    pointer-events: none;
}

@media (max-width: 900px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .product-media {
        max-width: 560px;
        margin: 0 auto;
    }
}

/* Home page rolling media strip */
.media-strip {
    background: #ffffff;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.media-strip-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.media-strip-link {
    font-weight: 700;
    text-decoration: none;
    color: var(--color-secondary);
}

.media-strip-link:hover {
    text-decoration: underline;
}

.media-carousel {
    position: relative;
    border: 1px solid #eaecef;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 1rem 3.25rem;
}

.media-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.25rem;
}

.media-track::-webkit-scrollbar {
    height: 10px;
}

.media-track::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
}

.media-item {
    flex: 0 0 auto;
    width: clamp(220px, 28vw, 420px);
    scroll-snap-align: start;
}

.media-item-link {
    display: block;
    border-radius: 0.9rem;
    overflow: hidden;
    border: 1px solid #eaecef;
    background: #f7f9fc;
}

.media-item img,
.media-item video {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.media-caption {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.85;
}

.media-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(4, 43, 81, 0.78);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    cursor: pointer;
    display: grid;
    place-items: center;
    user-select: none;
}

.media-nav-btn:hover {
    background: rgba(4, 43, 81, 0.90);
}

.media-prev {
    left: 0.75rem;
}

.media-next {
    right: 0.75rem;
}

.media-strip-hint {
    margin: 0.6rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .media-carousel {
        padding: 1rem;
    }

    .media-nav-btn {
        display: none;
    }

    .media-item img,
    .media-item video {
        height: 200px;
    }
}

/* Home page media grid */
.media .container {
    max-width: 1200px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 2rem auto 1.25rem;
    align-items: stretch;
}

.video-grid > :nth-child(n + 5) {
    display: none;
}

.video-card {
    width: 100%;
}

.video-card iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 1rem;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.media-copy {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 1.25rem;
}

.media-more {
    text-align: center;
}

.media-more-link {
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 999px;
    padding: 0.7rem 1.2rem;
    transition: 0.2s ease;
}

.media-more-link:hover {
    color: #fff;
    background: var(--color-primary);
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Fallback for older iframe wrapper usage */
.video-wrap {
    width: 100%;
}

.video-wrap iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    display: block;
}
