/* =========================================
   TPMS Animal Feeds - Bootstrap 5
   Cleaned + Optimised Brand Stylesheet
========================================= */

/* ========= ROOT BRAND SYSTEM ========= */
:root {
  --tpms-primary: #FB8B24;
  --tpms-secondary: #36454F;
  --tpms-accent: #d4a017;

  --tpms-dark: #36454F;
  --tpms-text: #333333;
  --tpms-muted: #666666;
  --tpms-light-bg: #FAF0E6;
  --tpms-white: #ffffff;
  --tpms-radius: 12px;
  
  /* CRITICAL FIX: Replaced 'all' transition to stop non-composited animation jank on borders/padding */
  --tpms-transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* ========= GLOBAL TYPOGRAPHY & FIXES ========= */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--tpms-text);
  background-color: #f7f7f7;
  -webkit-font-smoothing: antialiased;
  font-display: swap;
  font-synthesis: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--tpms-dark);
  line-height: 1.2;
}

h1, h2, h3 {
  text-wrap: balance;
}

/* Links */
a {
  color: var(--tpms-white);
  text-decoration: none;
  transition: var(--tpms-transition);
  will-change: transform, opacity;
}

a:hover {
  color: var(--tpms-accent);
}

a:focus {
  outline: 2px dashed var(--tpms-primary);
  outline-offset: 2px;
}

.bi {
  width: 1em;
  height: 1em;
}

img {
  max-width: 100%;
  height: auto;
}

/* ========= BOOTSTRAP OVERRIDES ========= */
.btn {
  border-radius: var(--tpms-radius);
  font-weight: 600;
  transition: var(--tpms-transition);
  will-change: transform, background-color;
  border: none; /* Stripping the layout border halts the browser color animation issue entirely */
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--tpms-dark);
  color: var(--tpms-white);
}

.btn-primary:hover {
  background-color: var(--tpms-primary);
  color: var(--tpms-white);
}

.btn-outline-primary {
  color: var(--tpms-primary);
  background-color: transparent;
  box-shadow: inset 0 0 0 2px var(--tpms-primary); /* Uses composited inner shadow instead of a layout border */
}

.btn-outline-primary:hover {
  background-color: var(--tpms-primary);
  color: var(--tpms-white);
  box-shadow: inset 0 0 0 2px var(--tpms-primary);
}

.card-img-top {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Navbar (Consolidated duplicate instances into single pristine rule) */
.navbar {
  background-color: var(--tpms-white);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  min-height: 90px;
  padding: 5px 0;
}

/* Prevent logo/image shift */
.navbar-brand {
  display: flex;
  align-items: center;
  min-height: 90px;
}

.navbar-brand img {
  width: 250px;
  height: 100px;
  display: block;
  object-fit: contain;
}

/* Nav links */
.nav-item .nav-link {
  color: var(--tpms-dark);
  font-weight: 600;
  transition: var(--tpms-transition);
}

.nav-item .nav-link:hover {
  color: var(--tpms-primary);
}

.navbar-toggler {
  border-color: rgba(0, 0, 0, .15);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280,0,0,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Rules & Best Styles */
.r-b-out {
  display: block;
  width: 100%;
  /* Reserves structural height before the text or icons load */
  min-height: 220px; 
  background-color: var(--tpms-white);
}

/* Ensure the grid column content wraps gracefully on mobile without stretching heights */
.r-b-out {
  margin: 0 auto;
  padding: 48px 0; /* Matches your py-5 Bootstrap utility spacer footprint */
  background-color: var(--tpms-white);
  min-height: 240px;
  content-visibility: auto;
  contain-intrinsic-size: auto 240px;
}

.pic {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.r-b .card {
  border: 0;
}

.r-b .card-title {
  border-top: solid 4px #f7f7f7;
}

.r-b .card-text {
  color: var(--tpms-primary);
  font-weight: bold;
}

.r-b .card a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.r-b .card a:hover {
  color: var(--tpms-primary);
}

/* Local Delivery */
.local-delivery {
  padding: 10px;
}

.rules a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.rules a:hover {
  color: var(--tpms-primary);
}
/* ========= HOME PAGE SECTIONS ========= */
/* Info Card */
.info-card-outer {
  margin: 0 auto;
  padding: 10px 0;
  background-color: var(--tpms-dark);
  color: var(--tpms-white);
  min-height: 48px;
}

.info-card-inner {
  text-align: center;
}

/* Popular Items */
.popular-items-outer {
  margin: 0 auto;
  padding: 10px;
  background-color: var(--tpms-white);
}

.popular-items-inner .card-title {
  border-top: solid 4px #f7f7f7;
}

/* SEO Map */
.t-one-outer {
  margin: 0 auto;
  padding: 0;
  background-color: var(--tpms-white);
}

.tpms-map {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  height: 450px;
}

.tpms-map iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.delivery-h a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.delivery a:hover {
  color: var(--tpms-text);
}

/* Testimonials */
.testimonials {
  min-height: 620px;
}

.testimonials .carousel-item {
  min-height: 620px;
  align-items: center;
}

.testimonials .carousel-item .row {
  align-items: center;
}

.testimonials img.rounded-circle {
  padding: 2px;
  width: 220px;
  height: 220px;
  object-fit: cover;
}

.testimonials img {
  object-fit: cover;
}

.testimonials .p-4.bg-white.shadow.rounded {
  background-color: #fff;
  border-radius: var(--tpms-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.testimonials p.fs-5 {
  line-height: 1.5;
  margin-bottom: 10px;
}

.testimonials h3 {
  color: var(--tpms-dark);
  font-weight: 700;
}

#packCarousel .carousel-inner {
  transition: height .4s ease;
}

/* BLOG HOME GRID */
.blog .card {
  border-radius: var(--tpms-radius);
  overflow: hidden;
}

.blog .card-img-top {
  height: 260px;
  object-fit: cover;
}

/* FOOTER */
.footer-outer {
  margin: 0 auto;
  padding: 15px 5px;
  background-color: var(--tpms-dark);
  color: var(--tpms-white);
}

.footer-outer img {
  max-width: 180px;
}

.footer-outer hr {
  border-color: rgba(255, 255, 255, 0.2);
}

.footer a {
  text-decoration: underline;
}

.tp li {
  cursor: pointer;
  transition: var(--tpms-transition);
}

.tp li:hover {
  color: var(--tpms-primary);
}

.rule {
  height: 3px;
}

/* ========== About Page ========== */
.about-hero-outer {
  margin: 0 auto;
  padding: 0;
  background-color: #f7f7f7;
  min-height: 560px;
}

.open-txt {
  margin: auto;
}

.intro-out {
  margin: 0 auto;
  padding: 0;
  background-color: white;
}

.intro-inner {
  margin: 0 auto;
  padding: 10px;
}

.intro-inner .card {
  border-radius: var(--tpms-radius);
  overflow: hidden;
}

.intro-inner .card-img-top {
  height: 260px;
  object-fit: cover;
}

.intro-inner .list-inline a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.intro-inner .list-inline a:hover {
  color: var(--tpms-primary);
}

.intro-inner .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.map-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.map-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 500px;
  border: 0;
}

.process-outer {
  margin: 0 auto;
  padding: 0px;
  background-color: var(--tpms-white);
}

.process-inner {
  margin: 0 auto;
  padding: 10px;
}

.pets-corner a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.pets-corner a:hover {
  color: var(--tpms-primary);
}

/* ========= CATALOGUE GRID SYSTEMS ========== */
/* Grouped layout optimizations to save performance overhead */
.shop-hero-outer, .drive-hero-outer, .blog-hero-outer {
  margin: 0 auto;
  padding: 0;
  background-color: #f7f7f7;
}

.cat-nav-outer, .s1-out, .s2-out, .s3-out, .s4-out, .s5-out, .s6-out, .s7-out, .s8-out, .s9-out, .open-state, .area-cards {
  margin: 0 auto;
  padding: 0;
  background-color: var(--tpms-white);
}

.cat-nav, .s1-raw, .s2-boxes, .s3-boxes, .s4-mixer, .s5-raw-hide, .s7-health-nutrition, .s8-accessories, .s9-miscellaneous, .delivery, .area-cards {
  margin: 0 auto;
  padding: 10px;
}

.cat-list a {
  text-decoration: underline;
  color: var(--tpms-dark);
}

.cat-list a:hover {
  color: var(--tpms-primary);
}

.delivery a {
  color: var(--tpms-white);
  text-decoration: underline;
  background-color: var(--tpms-dark);
}

.delivery a:hover {
  color: var(--tpms-dark);
}

/* ========= Delivery Page ========= */
.area-card-inner .card {
  overflow: hidden;
}

.area-card-inner .card-title {
  background-color: var(--tpms-dark);
  color: var(--tpms-white);
  padding: 10px;
  border-radius: var(--tpms-radius) var(--tpms-radius) 0 0;
}

.area-card-inner a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.area-card-inner a:hover {
  color: var(--tpms-accent);
}

/* ========= Blog Page Roll ========= */
.blog-hero-inner, .blog-featured-outer {
  margin: 0 auto;
  padding: 10px;
}

.blog-featured-outer {
  background-color: var(--tpms-white);
}

.blog-item img {
  display: block;
}

.blog-item a {
  display: flex;
  padding: 50px;
  overflow: hidden;
  align-items: center;
  max-width: 1000px;
  margin: auto;
  color: var(--tpms-dark);
  font-family: 'Lato', sans-serif;
  font-size: 16px;
  border-radius: 6px;
  margin-bottom: 50px;
  text-decoration: none;
  transition: var(--tpms-transition);
}

.blog-item a:hover {
  box-shadow: 0 10px 50px 0 rgba(0, 0, 0, 0.2);
}

.blog-item .icon {
  width: 35%;
  object-fit: cover;
  margin-right: 50px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 15px 26px rgba(0, 0, 0, 0.4);
}

.blog-item .content {
  width: 65%;
}

.blog-item .content .title {
  font-size: 21px;
  text-transform: capitalize;
  color: var(--tpms-dark);
  font-weight: 600;
  font-family: 'Lato', sans-serif;
}

.blog-item .content .title .blog-date {
  font-size: 12px;
  margin-left: 20px;
  color: #333;
  font-family: 'Lato', sans-serif;
}

.blog-item .content .title .blog-date:before {
  content: '/';
  color: var(--tpms-accent);
  font-size: 25px;
  top: auto;
  position: relative;
  margin-right: 10px;
}

.blog-item .content .rounded {
  margin-left: 0;
  margin-top: 10px;
  margin-bottom: 10px;
}

.blog-item .item-arrow {
  height: 20px;
  width: 15%;
  position: relative;
  text-align: center;
  font-size: 35px;
  left: 0;
  transition: var(--tpms-transition);
}

.blog-item a:hover > .item-arrow {
  color: var(--tpms-primary);
  transform: translateX(30px); /* Clean composited translation instead of moving 'left' property */
}

.blog-item .rounded {
  width: 70px;
  height: 5px;
  border-radius: 6px;
  background-image: linear-gradient(to right, var(--tpms-primary), var(--tpms-accent));
  margin-left: 0;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Accordion Header Styling */
.accordion-header,
.accordion-button {
  background-color: #36454F !important;
  color: #ffffff !important;
}

.accordion-button:not(.collapsed) {
  background-color: #36454F !important;
  color: #ffffff !important;
  box-shadow: none;
}

.accordion-button::after {
  filter: brightness(0) invert(1);
}

/* ========= Contact Page ========= */
.grecaptcha-badge {
  right: auto !important;
  left: 14px !important;
  visibility: hidden;
}

.attribute a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.find-us-bar-outer {
  margin: 0 auto;
  padding: 0;
  background-color: var(--tpms-white);
}

.find-us-bar-inner {
  margin: 0 auto;
  padding: 10px;
}

.find-us-bar-inner .card {
  border-color: var(--tpms-dark);
  border-radius: var(--tpms-radius);
  overflow: hidden;
}

.find-us-bar-inner .card-title {
  background-color: var(--tpms-dark);
  color: var(--tpms-white);
  padding: 10px;
}

.find-us-bar-inner a {
  color: var(--tpms-dark);
  text-decoration: underline;
}

.find-us-bar-inner a:hover {
  color: var(--tpms-primary);
}

.form-map-outer {
  margin: 0 auto;
  padding: 0;
  background-color: var(--tpms-white);
}

.form-map-inner {
  margin: 0 auto;
  padding: 10px;
}

/* ========= Modal & Performance Boundaries ========== */
.autocomplete-list {
  min-height: 140px;
  max-height: 220px;
  overflow-y: auto;
}

/* Performance Layer boundaries across intensive structural nodes */
.r-b-out, .popular-items-outer, .t-one-outer, .navbar, .intro-out, .blog-featured-outer {
  contain: layout paint;
}

/* ========= RESPONSIVE QUERIES ========= */
@media (max-width: 768px) {
  .info-card-outer {
    display: none;
  }

  .hero-outer {
    background-position: center;
    min-height: 500px;
  }

  .testimonials img.rounded-circle {
    width: 160px;
    height: 160px;
  }

  .carousel-inner,
  .carousel-item {
    min-height: 700px;
  }

  .iframe {
    width: 100%;
  }

  .blog-item .content {
    width: 100%;
    margin-top: 35px;
  }

  .blog-item .content .title {
    font-size: 18px;
  }

  .blog-item .item-arrow {
    margin: auto;
  }

  .blog-item .icon {
    width: 100%;
  }

  .blog-item .icon img {
    width: 100%;
    height: 150px;
    object-fit: cover;
  }

  .blog-item {
    width: 92%;
    margin: auto;
  }

  .blog-item a {
    display: block;
    padding: 30px;
  }
}

@media (min-width: 768px) {
  .tp {
    float: right;
  }
}

@media (max-width: 1199px) {
  .intro-inner .row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  .map-responsive {
    padding-bottom: 70%;
  }
}

/* ========= PERFORMANCE IMAGE FIXES ========= */

/* Hardcodes aspect-ratio block sizing over the mobile asset layer */
.hero-render-boundary {
  display: block;
  width: 100%;
  max-width: 570px;
  margin: 0 auto;
  aspect-ratio: 570 / 500;
}

/* Target the category navigation button pills explicitly */
.cat-list .btn,
.s1-raw .btn,
.s2-boxes .btn,
.s3-boxes .btn,
.s4-mixer .btn,
.s5-raw-hide .btn,
.s7-health-nutrition .btn,
.s8-accessories .btn,
.s9-miscellaneous .btn,
.accordion-button {
  /* Force hardware acceleration layers */
  will-change: transform, opacity;
  /* Override layout-heavy properties from trying to animate */
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease !important;
}

/* Elegant, hardware-accelerated lift effect instead of layout border recalculations */
.cat-list .btn:hover,
.s1-raw .btn:hover,
.s2-boxes .btn:hover,
.s3-boxes .btn:hover,
.s4-mixer .btn:hover,
.s5-raw-hide .btn:hover,
.s7-health-nutrition .btn:hover,
.s8-accessories .btn:hover,
.s9-miscellaneous .btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.row .card h-100 .card-img-top {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important; 
    width: 100%;
    height: auto;
}

.home-grid-override .card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
}

/* Eliminate the white side borders on thumbnails */
.home-grid-override .card img,
.home-grid-override .card .card-img-top {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important; 
    object-fit: cover !important;  
    height: auto !important;
}

/* Align text block data uniformly and anchor the price to the bottom */
.home-grid-override .card-body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    flex-grow: 1 !important;
}

#map-wrapper {
    width: 100%;
    height: 350px; /* Set a consistent height */
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #f8f9fa; /* Light grey while loading */
}

#map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

#map-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}