/* ===================================================
   ROBIN ROSE TRADING — WEB APP & MOBILE LAYER
   Loaded after style.css + main.css. Layout only — no content changes.
=================================================== */


/* ---------- Easy-to-change colors ---------- */

:root {
    --nav-active-color: #e63946;
    /* text + underline of the current page  */
    --nav-active-bg: rgba(230, 57, 70, .10);
    /* soft highlight behind the current page */
}


/* ---------- Base ergonomics ---------- */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-padding-top: calc(84px + env(safe-area-inset-top, 0px));
}

html,
body {
    overflow-x: hidden;
}

@supports (overflow-x: clip) {
    html,
    body {
        overflow-x: clip;
    }
}

a,
button,
input,
select,
textarea,
label,
.cat-card,
.filter-btn {
    touch-action: manipulation;
}

:focus-visible {
    outline: 3px solid rgba(230, 57, 70, .45);
    outline-offset: 2px;
}


/* Smooth page-to-page transitions (Chrome/Edge; ignored elsewhere) */

@view-transition {
    navigation: auto;
}


/* ---------- Safe areas & fixed-navbar clearance ---------- */

.navbar {
    padding-top: env(safe-area-inset-top, 0px);
}

.hero {
    padding-top: calc(72px + env(safe-area-inset-top, 0px));
}

.footer-bottom {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}


/* Promo bar sits right under the navbar (was hidden behind it) */

main>.promo-bar:first-child {
    margin-top: calc(72px + env(safe-area-inset-top, 0px));
}

main>.promo-bar:first-child+.hero {
    padding-top: 0;
}


/* Inner-page banner clears the navbar */

main>.page-hero:first-child {
    padding-top: calc(72px + 2.5rem + env(safe-area-inset-top, 0px));
}


/* ---------- Navbar: current page highlight ---------- */

.nav-link.active:not(.nav-cta) {
    color: var(--nav-active-color);
    background: transparent;
    font-weight: 600;
}

.nav-link.active:not(.nav-cta)::after {
    left: 18%;
    right: 18%;
    background: var(--nav-active-color);
}

.nav-cta.active {
    background: var(--blue);
    box-shadow: 0 0 0 3px rgba(29, 53, 87, .15);
}

.nav-cta.active:hover {
    background: var(--blue-mid);
}


/* Desktop dropdown: invisible bridge so the menu doesn't close in the gap */

@media (min-width: 769px) {
    .dropdown-menu::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -14px;
        height: 14px;
    }
}


/* ---------- Faster rendering of off-screen sections ---------- */

.section,
.contact-strip,
.cta-banner,
.footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}


/* ---------- Mobile navigation ---------- */

html.nav-open,
html.nav-open body {
    overflow: hidden;
}

@media (max-width: 768px) {
    .navbar {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #ffffff;
    }
    .nav-container {
        padding: 0 1rem;
    }
    .nav-logo {
        height: 38px;
    }
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-right: -6px;
        border-radius: 10px;
    }
    .nav-toggle:active {
        background: var(--cream);
    }
    .nav-links.open {
        top: calc(72px + env(safe-area-inset-top, 0px));
        bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        align-items: stretch;
        gap: .15rem;
        padding: .75rem 1.1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(168, 218, 220, .45);
        animation: pwaSheetIn .22s ease;
    }
    .nav-links.open>li {
        width: 100%;
    }
    .nav-links.open .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 50px;
        padding: .8rem .9rem;
        font-size: 1rem;
        border-radius: 10px;
    }
    .nav-links.open .nav-link::after {
        display: none;
    }
    .nav-links.open .nav-link:not(.active):active {
        background: var(--cream);
    }
    .nav-links.open .nav-link.active:not(.nav-cta) {
        background: var(--nav-active-bg);
        color: var(--nav-active-color);
        box-shadow: inset 4px 0 0 var(--nav-active-color);
    }
    .nav-links.open .nav-cta {
        justify-content: center;
        margin-top: .8rem;
    }
    /* Tap-to-open Products dropdown */
    .dropdown:hover .dropdown-menu {
        display: none;
    }
    .dropdown.open .dropdown-menu {
        display: block;
        animation: none;
    }
    .dropdown .fa-chevron-down {
        transition: transform .25s ease;
        font-size: .8rem;
    }
    .dropdown.open .fa-chevron-down {
        transform: rotate(180deg);
    }
    .nav-links .dropdown-menu {
        min-width: 0;
        margin: .2rem 0 .4rem .9rem;
        padding: .2rem 0 .2rem .6rem;
        border-top: none;
        border-left: 2px solid var(--blue-light);
        border-radius: 0;
    }
    .nav-links .dropdown-menu a,
    .nav-links .dropdown-menu a:hover {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: .6rem .8rem;
        font-size: .93rem;
        border-radius: 8px;
    }
    /* Prevent iOS zoom when tapping a form field */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

@keyframes pwaSheetIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ---------- Hero medkit image (smaller, all screens) ---------- */

.hero-img-box {
    min-height: 320px;
    padding: 2rem;
}

.hero-img-box .medkit-img {
    width: 240px !important;
    height: 240px !important;
    max-width: 100%;
    object-fit: contain;
}

.hero-img-box .medkit-svg {
    width: 240px !important;
    height: 240px !important;
}

@media (max-width: 1024px) {
    .hero-img-box {
        min-height: 0;
        max-width: 420px;
        width: 100%;
        margin: 0 auto;
        padding: 1.75rem;
    }
    .hero-img-box .medkit-img,
    .hero-img-box .medkit-svg {
        width: 200px !important;
        height: 200px !important;
    }
}

@media (max-width: 768px) {
    .hero-img-box {
        max-width: 300px;
        padding: 1.25rem;
        border-radius: 20px;
    }
    .hero-img-box::before {
        font-size: 3.5rem;
        top: .6rem;
        right: .9rem;
    }
    .hero-img-box .medkit-img,
    .hero-img-box .medkit-svg {
        width: 160px !important;
        height: 160px !important;
        filter: drop-shadow(0 10px 20px rgba(230, 57, 70, .16));
    }
}

@media (max-width: 380px) {
    .hero-img-box {
        max-width: 240px;
        padding: 1rem;
    }
    .hero-img-box .medkit-img,
    .hero-img-box .medkit-svg {
        width: 130px !important;
        height: 130px !important;
    }
}


/* ---------- Mobile layout (all pages) ---------- */

@media (max-width: 768px) {
    .section {
        padding: 3.25rem 1.1rem;
    }
    .sec-head,
    .section-header {
        margin-bottom: 2rem;
    }
    .hero {
        min-height: auto;
    }
    .hero-container {
        padding: 1.75rem 1.1rem 3rem;
        gap: 1.75rem;
    }
    .hero-title {
        font-size: clamp(2rem, 9vw, 2.6rem);
    }
    .hero-sub {
        font-size: .95rem;
    }
    .hero-actions .btn {
        flex: 1 1 200px;
        justify-content: center;
    }
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.1rem 1rem;
    }
    .stat .num {
        font-size: 1.7rem;
    }
    /* Trust bar: swipeable row */
    .trust-bar {
        padding: .9rem 0;
    }
    .trust-inner {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 1.6rem;
        padding: 0 1.1rem;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }
    .trust-inner::-webkit-scrollbar {
        display: none;
    }
    .trust-item {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    .promo-bar {
        font-size: .78rem;
        gap: .5rem;
        padding: .55rem .9rem;
    }
    .page-hero {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
        padding-bottom: 2.25rem;
    }
    .page-hero p {
        font-size: .88rem;
    }
    .contact-strip {
        padding: 3rem 1.1rem;
    }
    .cs-left h2,
    .cta-banner h2 {
        font-size: 1.6rem;
    }
    .cs-right {
        padding: 1.4rem;
    }
    .cta-banner {
        padding: 2.75rem 1.1rem;
    }
    .footer {
        padding: 3rem 1.25rem 0;
    }
    .footer-grid {
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    .social-icon {
        width: 44px;
        height: 44px;
    }
    .btn,
    .btn-primary,
    .btn-outline {
        min-height: 48px;
    }
    .page-btn {
        width: 44px;
        height: 44px;
    }
    .filter-btn {
        min-height: 40px;
    }
}


/* ---------- Centered grids ---------- */

.section-container,
.sec-wrap {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.prod-grid,
.ann-grid,
.cats-grid,
.why-grid,
.svc-grid,
.test-grid,
.services-grid,
.team-grid {
    justify-content: center;
}

.prod-card,
.ann-card,
.service-card,
.team-card {
    min-width: 0;
}

.ann-body p,
.prod-desc,
.service-desc,
.contact-method strong,
.cs-item strong {
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    /* 2 per row */
    .cats-grid,
    .prod-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .8rem;
    }
    .cat-card {
        padding: 1.2rem .7rem;
    }
    .cat-ico {
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
    }
    .prod-img {
        height: 140px;
    }
    .prod-img img {
        max-height: 110px !important;
        max-width: 85%;
    }
    .prod-body {
        padding: .8rem;
    }
    .prod-name {
        font-size: .86rem;
    }
    .prod-desc {
        font-size: .76rem;
    }
    .prod-foot {
        flex-direction: column;
        align-items: stretch;
        gap: .55rem;
    }
    .prod-price {
        font-size: 1rem;
    }
    .btn-q {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        text-align: center;
    }
    .prod-stock,
    .prod-badge {
        font-size: .62rem;
    }
    /* Lone last card in a 2-column grid sits in the middle */
    .cats-grid> :last-child:nth-child(odd),
    .prod-grid> :last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - .4rem);
    }
    /* 1 per row, centered with a comfortable width */
    .why-grid,
    .svc-grid,
    .ann-grid,
    .test-grid {
        display: grid;
        grid-template-columns: minmax(0, 480px);
        justify-content: center;
        gap: 1rem;
    }
    .why-card {
        padding: 1.5rem;
    }
    .svc-card {
        padding: 1.6rem;
    }
    .services-grid>.service-card {
        flex: 1 1 100% !important;
        max-width: 480px;
        padding: 1.6rem;
    }
    .cta-banner .btns .btn {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (max-width: 340px) {
    .prod-grid {
        grid-template-columns: 1fr;
    }
    .prod-grid> :last-child:nth-child(odd) {
        width: 100%;
    }
}


/* ---------- Touch devices: no "stuck" hover lifts ---------- */

@media (hover: none) {
    .cat-card:hover,
    .prod-card:hover,
    .why-card:hover,
    .svc-card:hover,
    .ann-card:hover,
    .test-card:hover,
    .product-card:hover,
    .service-card:hover,
    .announcement-card:hover,
    .team-card:hover,
    .testimonial-card:hover,
    .btn-red:hover,
    .btn-blue:hover,
    .btn-primary:hover,
    .btn-outline:hover,
    .nav-cta:hover,
    .social-icon:hover {
        transform: none;
    }
    .cat-card:active,
    .prod-card:active,
    .btn:active,
    .btn-q:active,
    .btn-primary:active,
    .filter-btn:active {
        transform: scale(.97);
        transition-duration: .1s;
    }
}


/* ===================================================
   INNER PAGES — Products, Services, Announcements, Contact
=================================================== */


/* Announcements: keep tag + title above the background image */

.ann-top {
    position: relative;
}

.ann-top .ann-tag,
.ann-top .ann-title-text {
    position: relative;
    z-index: 1;
}


/* Product search */

.catalog-search {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.catalog-search form {
    width: 100%;
    max-width: 400px;
}

.catalog-search input {
    width: 100%;
    padding: .75rem 1.25rem;
    border-radius: 30px;
    border: 1px solid #ddd;
    font-family: var(--font-body);
    font-size: .95rem;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.catalog-search input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, .1);
}


/* Pagination */

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-top: 3rem;
}

.pager .btn {
    padding: .5rem 1rem;
    min-width: 44px;
    justify-content: center;
}


/* Tables inside .table-scroll */

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #fff;
}

.table-scroll::-webkit-scrollbar {
    height: 6px;
}

.table-scroll .data-table {
    box-shadow: none;
}


/* Contact page */

.flash-wrap {
    max-width: 1300px;
    margin: 1.5rem auto 0;
    padding: 0 2rem;
}

.contact-grid>* {
    min-width: 0;
}

@media (max-width: 768px) {
    .table-scroll .data-table {
        min-width: 620px;
    }
    .data-table th,
    .data-table td {
        padding: .75rem .9rem;
        font-size: .8rem;
    }
    .table-scroll .data-table th:first-child,
    .table-scroll .data-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
    }
    .table-scroll .data-table th:first-child {
        background: var(--blue);
    }
    .table-scroll .data-table td:first-child {
        background: #fff;
        box-shadow: 2px 0 6px rgba(29, 53, 87, .06);
    }
    .table-scroll .data-table tbody tr:hover td:first-child {
        background: var(--cream);
    }
    /* Any table NOT wrapped in .table-scroll (e.g. Compliance Overview): scroll instead of being cut off */
     :not(.table-scroll)>.data-table,
     :not(.table-scroll)>table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
     :not(.table-scroll)>.data-table th,
     :not(.table-scroll)>.data-table td {
        min-width: 130px;
    }
    .flash-wrap {
        padding: 0 1.1rem;
    }
    .contact-info-card,
    .contact-form-card {
        padding: 1.4rem;
    }
    .form-title {
        font-size: 1.25rem;
    }
    .contact-method {
        gap: .8rem;
    }
    .map-embed {
        height: 220px;
    }
    .svc-cta {
        padding: 3rem 1.1rem !important;
    }
    .svc-cta h2 {
        font-size: 1.6rem !important;
    }
    .svc-cta .btn-primary,
    .svc-cta .btn-outline {
        flex: 1 1 220px;
        justify-content: center;
        min-height: 48px;
    }
}


/* ===================================================
   ABOUT PAGE
=================================================== */

.about-grid>* {
    min-width: 0;
}

.about-text,
.mv-card p,
.team-name,
.team-role {
    overflow-wrap: anywhere;
}


/* Meet Our Team — smaller cards on every screen */

.team-grid {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    gap: 1.2rem;
}

.team-card {
    flex: 0 1 170px;
    padding: 1.5rem 1rem;
}

.team-ico,
.team-img {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
    margin-bottom: .8rem;
    border-width: 2px;
}

.team-name {
    font-size: .92rem;
}

.team-role {
    font-size: .78rem;
}

@media (max-width: 1024px) {
    .about-grid {
        gap: 2.5rem;
    }
    .about-img-wrap {
        max-width: 560px;
        width: 100%;
        margin: 0 auto;
    }
    .about-cert {
        right: 0;
    }
}

@media (max-width: 768px) {
    .about-title {
        font-size: 1.6rem;
    }
    .about-text {
        font-size: .92rem;
    }
    .about-cert {
        position: static;
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    .mission-vision {
        gap: .8rem;
        margin-top: 1.5rem;
    }
    .mv-card {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .team-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 360px;
        gap: .75rem;
    }
    .team-card {
        padding: 1.2rem .7rem;
    }
    .team-ico,
    .team-img {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .team-name {
        font-size: .86rem;
    }
    .team-role {
        font-size: .72rem;
    }
    .team-grid> :last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - .4rem);
    }
}


/* ===================================================
   LIVE UPDATES, OFFLINE, TOAST
=================================================== */


/* Don't replay entrance animations after a live content update */

html.pwa-live-swapped main *:not(.medkit-svg):not(.medkit-img) {
    animation: none !important;
}


/* Offline hint */

html.is-offline .navbar {
    box-shadow: inset 0 -3px 0 #ffc107;
}


/* Toast */

.pwa-toast {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: .75rem;
    width: max-content;
    max-width: min(92vw, 420px);
    padding: .7rem .8rem .7rem 1.1rem;
    background: #1d3557;
    color: #fff;
    border-radius: 14px;
    font-size: .88rem;
    line-height: 1.35;
    box-shadow: 0 10px 30px rgba(29, 53, 87, .3);
    opacity: 0;
    transform: translate(-50%, 150%);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
    pointer-events: none;
}

.pwa-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.pwa-toast i {
    color: #a8dadc;
}

.pwa-toast button {
    min-height: 36px;
    padding: .45rem 1rem;
    background: #e63946;
    color: #fff;
    border: 0;
    border-radius: 30px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}


/* ---------- Respect "reduce motion" ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
    @view-transition {
        navigation: none;
    }
}


/* ---------- Live product search ---------- */

.catalog-search form {
    position: relative;
}

.catalog-search input {
    padding-right: 2.75rem;
}

.catalog-search.is-searching form::after {
    content: "";
    position: absolute;
    right: 1.1rem;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(230, 57, 70, .25);
    border-top-color: #e63946;
    border-radius: 50%;
    animation: pwaSpin .7s linear infinite;
}

@keyframes pwaSpin {
    to {
        transform: rotate(360deg);
    }
}

#productResults {
    min-height: 200px;
    transition: opacity .2s ease;
}

#productResults.is-loading {
    opacity: .45;
    pointer-events: none;
}