/* =========================================================================
   GETALL COMMERCE — STANDARDIZED RESPONSIVE FRAMEWORK (PUBLIC SITE)
   ------------------------------------------------------------------------
   This file is the single source of truth for how every public page
   behaves on small, medium and large devices. It is linked on every
   page AFTER bootstrap.min.css, style.css and any page-specific inline
   <style> block, so its rules are the final word on shared, cross-page
   components (topbar, navbar, buttons, forms, cards, tables, footer,
   spacing and type scale). Page-specific inline styles remain for
   content that is unique to that page.

   STANDARD DEVICE TIERS (used project-wide, front-end + admin)
     Small  device (phones)   : max-width   575.98px
     Medium device (tablets)  : 576px  -  991.98px
     Large  device (desktop+) : min-width   992px

   These match Bootstrap's own sm/lg grid boundaries (the framework
   already loaded on every page), so the grid classes already in use
   (col-sm-*, col-md-*, col-lg-*, col-xl-*) line up exactly with the
   custom rules below — nothing fights the grid.
   ========================================================================= */

:root {
    --bp-small-max: 575.98px;
    --bp-medium-min: 576px;
    --bp-medium-max: 991.98px;
    --bp-large-min: 992px;

    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 48px;

    --container-pad-small: 16px;
    --container-pad-medium: 24px;
    --container-pad-large: 40px;
}

/* -------------------------------------------------------------------
   1. GLOBAL SAFETY NET — applies on every device, prevents overflow
   ------------------------------------------------------------------- */
html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
}

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

img, picture, video, iframe, embed, object, svg {
    max-width: 100%;
    height: auto;
}

/* any table dropped into content that isn't already wrapped stays
   usable on phones/tablets instead of breaking the layout */
table {
    max-width: 100%;
}

@media (max-width: 991.98px) {
    table:not(.no-responsive) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* -------------------------------------------------------------------
   2. CONTAINER + SPACING — same padding scale on every page
   ------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .container,
    .container-fluid {
        padding-left: var(--container-pad-small);
        padding-right: var(--container-pad-small);
    }
    .container-fluid.px-5 {
        padding-left: var(--container-pad-small) !important;
        padding-right: var(--container-pad-small) !important;
    }
    .py-5 { padding-top: var(--space-lg) !important; padding-bottom: var(--space-lg) !important; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .container,
    .container-fluid {
        padding-left: var(--container-pad-medium);
        padding-right: var(--container-pad-medium);
    }
    .container-fluid.px-5 {
        padding-left: var(--container-pad-medium) !important;
        padding-right: var(--container-pad-medium) !important;
    }
}

@media (min-width: 992px) {
    .container-fluid.px-5 {
        padding-left: var(--container-pad-large) !important;
        padding-right: var(--container-pad-large) !important;
    }
}

/* -------------------------------------------------------------------
   3. TYPOGRAPHY — fluid scale so headings never require a per-page
      font-size override again
   ------------------------------------------------------------------- */
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 1.05rem + 1.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 1rem + 1vw, 1.75rem); }
h4 { font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.4rem); }
p, li, label { line-height: 1.6; }

/* -------------------------------------------------------------------
   4. TOPBAR / NAVBAR — one behavior for every page
   ------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .navbar-brand img { max-height: 36px; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .navbar-brand img { max-height: 42px; }
    .nav-bar .navbar .navbar-nav .nav-link { padding: 10px 0; }
}

@media (min-width: 992px) {
    .navbar-brand img { max-height: 48px; }
}

/* -------------------------------------------------------------------
   5. CATEGORY / ICON GRID — the "category-col" pattern reused on the
      home, shop, rent and service pages resolves to the same column
      count at the same breakpoints everywhere
   ------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .category-col,
    .service-col { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .category-col,
    .service-col { flex: 0 0 33.333%; max-width: 33.333%; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .category-col,
    .service-col { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 992px) {
    .category-col,
    .service-col { flex: 0 0 16.666%; max-width: 16.666%; }
}

/* -------------------------------------------------------------------
   6. BUTTONS + FORM CONTROLS — consistent minimum touch target
   ------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .btn { min-height: 42px; }
    .btn-lg-square { width: 46px; height: 46px; }
    .form-control, .form-select { min-height: 42px; font-size: 16px; }
}

/* -------------------------------------------------------------------
   7. CARDS / PRODUCT + SERVICE TILES — equal-height, no overflow
   ------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .service-icon-box { padding: 1.25rem !important; }
}

/* -------------------------------------------------------------------
   8. FOOTER — single column on phones, two on tablets, full on desktop
   ------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .footer .footer-item { margin-bottom: var(--space-md); text-align: left; }
}

/* -------------------------------------------------------------------
   9. ACCESSIBILITY / MOTION — same for every page
   ------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    .wow { animation-duration: .01ms !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
