/* ============================================================
   HSE Consultations – Global Stylesheet
   ============================================================ */

/* ── Material Symbols ───────────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    user-select: none;
}

/* ── Typography helpers ─────────────────────────────────────── */
.text-shadow-sm {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ── Zebra tables ───────────────────────────────────────────── */
.zebra-table tr:nth-child(even),
.zebra-stripe:nth-child(even) {
    background-color: #f2f4f7;
}

/* ── Glassmorphism card ─────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #E2E8F0;
}

/* ── Map gradient overlay ───────────────────────────────────── */
.map-gradient {
    background: linear-gradient(180deg, rgba(247,249,252,0) 0%, rgba(247,249,252,1) 100%);
}

/* ── Smooth scroll + overflow ───────────────────────────────── */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* ── Policy cards (Terms page) ──────────────────────────────── */
.policy-card {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.policy-card:hover {
    box-shadow: 0 4px 20px rgba(45,46,50,0.08);
}
.industrial-grid {
    background-image: radial-gradient(#d5c4ab 0.5px, transparent 0.5px);
    background-size: 24px 24px;
}

/* ── Product card shadow (Store) ────────────────────────────── */
.custom-shadow {
    box-shadow: 0 4px 20px rgba(45,46,50,0.08);
}

/* ============================================================
   MOBILE MENU
   ============================================================ */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
}
#mobile-menu.open {
    max-height: 480px;
    opacity: 1;
}

/* Hamburger icon animation */
#hamburger-btn .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}
#hamburger-btn.open .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#hamburger-btn.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
#hamburger-btn.open .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
#search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(25,28,30,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}
#search-overlay.open {
    opacity: 1;
    pointer-events: all;
}
#search-overlay .search-box {
    width: 100%;
    max-width: 640px;
    padding: 0 1rem;
    transform: translateY(-16px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#search-overlay.open .search-box {
    transform: translateY(0);
}
#search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.25rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    border: 2px solid #ffba20;
    outline: none;
    background: #ffffff;
    color: #191c1e;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
#search-results {
    background: #ffffff;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
#search-results a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    color: #191c1e;
    text-decoration: none;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f2f4f7;
}
#search-results a:last-child { border-bottom: none; }
#search-results a:hover { background: #fff8e6; }
#search-results a .material-symbols-outlined { color: #7c5800; font-size: 20px; }

/* ============================================================
   CART PAGE
   ============================================================ */
.cart-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.cart-item.removing {
    opacity: 0;
    transform: translateX(20px);
}
.qty-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    transition: background 0.15s ease;
    cursor: pointer;
}

/* ============================================================
   FORM FOCUS UTILITY
   ============================================================ */
.form-focus {
    border: 1px solid #d5c4ab;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-focus:focus {
    border-color: #7c5800;
    box-shadow: 0 0 0 3px rgba(124,88,0,0.15);
    outline: none;
}

/* ============================================================
   SCROLL REVEAL ANIMATION
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pulse dot (footer status) */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}
.animate-pulse { animation: pulse-dot 2s ease-in-out infinite; }

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
#page-transition {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #7c5800;
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}
#page-transition.enter {
    animation: page-enter 0.35s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
#page-transition.exit {
    animation: page-exit 0.35s cubic-bezier(0.76, 0, 0.24, 1) forwards;
    transform-origin: right;
}
@keyframes page-enter {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes page-exit {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ============================================================
   RESPONSIVE – MOBILE FIRST FIXES
   ============================================================ */

/* Minimum tap target size (44px) */
button, a, [role="button"] {
    min-height: 36px;
}

/* Nav doesn't overflow on small screens */
@media (max-width: 767px) {
    #main-nav .font-headline-md {
        font-size: 18px;
    }
    .px-margin-desktop {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Cart badge hidden when 0 */
#cart-count:empty,
#cart-count[data-zero="true"] {
    display: none;
}

/* Checkout payment radio animation */
input[type="radio"]:checked + * + div .font-label-bold {
    color: #7c5800;
}

/* Form field focus ring */
.form-focus {
    border: 1px solid #d5c4ab;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-focus:focus {
    border-color: #7c5800;
    box-shadow: 0 0 0 3px rgba(124,88,0,0.15);
    outline: none;
}
.border-error { border-color: #ba1a1a !important; }

/* ============================================================
   RESPONSIVE – GRID & SECTION FIXES
   ============================================================ */
@media (max-width: 640px) {
    .font-headline-xl { font-size: 32px !important; line-height: 40px !important; }
    .font-headline-lg { font-size: 24px !important; line-height: 32px !important; }
    .py-24 { padding-top: 3rem; padding-bottom: 3rem; }
    .px-margin-desktop { padding-left: 1rem; padding-right: 1rem; }

    /* Stack hero buttons */
    .hero-buttons { flex-direction: column !important; }

    /* Cart items stack on mobile */
    .cart-item > div:last-child { flex-wrap: wrap; }
}

@media (max-width: 768px) {
    /* Footer grid stacks */
    .grid-cols-3 { grid-template-columns: 1fr 1fr; }

    /* Checkout: single column on mobile */
    .lg\\:col-span-7,
    .lg\\:col-span-5 { grid-column: span 12; }
}

