/* =========================================
   In-Store Layout (Used Guns + New Guns)
   Used Guns  : page-id-2015
   New Guns   : page-id-2145
   ========================================= */

 /* Convenience note:
    Whenever you see a selector starting with body.page-id-2015,
    it also targets body.page-id-2145 so both pages share styles.
 */

/* -----------------------------------------
   OUTER WRAPPER
------------------------------------------ */

body.page-id-2015 .erg-instore,
body.page-id-2145 .erg-instore{
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) clamp(14px, 3vw, 28px);
}

/* -----------------------------------------
   HERO
------------------------------------------ */

body.page-id-2015 .erg-instore-hero,
body.page-id-2145 .erg-instore-hero{
  background: var(--erg-panel);
  border-radius: var(--erg-radius);
  border: 1px solid var(--erg-border);
  padding: clamp(18px, 3vw, 28px);
}

/* Hero CTA row */

body.page-id-2015 .erg-instore__ctaRow,
body.page-id-2145 .erg-instore__ctaRow{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 600px){
  body.page-id-2015 .erg-instore__ctaRow,
  body.page-id-2145 .erg-instore__ctaRow{
    justify-content: flex-start;
  }
}

/* Hero CTA buttons */

body.page-id-2015 .erg-instore-hero .elementor-button,
body.page-id-2145 .erg-instore-hero .elementor-button{
  background-color: var(--erg-cta) !important;
  color: var(--erg-cta-contrast) !important;
  border-color: var(--erg-cta-2) !important;
  border-radius: var(--erg-radius-sm);
  box-shadow: 0 10px 24px rgba(0,0,0,.6);
}

body.page-id-2015 .erg-instore-hero .elementor-button:hover,
body.page-id-2145 .erg-instore-hero .elementor-button:hover{
  background-color: var(--erg-cta-2) !important;
  border-color: var(--erg-cta-3) !important;
}

body.page-id-2015 .erg-instore-hero .elementor-button:focus-visible,
body.page-id-2145 .erg-instore-hero .elementor-button:focus-visible{
  outline: 2px solid var(--erg-link);
  outline-offset: 2px;
}

/* -----------------------------------------
   JUMP BAR
------------------------------------------ */

body.page-id-2015 .erg-instore-jump,
body.page-id-2145 .erg-instore-jump{
  margin-top: 18px;
  padding: 8px 10px;
  border-radius: var(--erg-radius);
  border: 1px solid var(--erg-border);
  background: var(--erg-panel-2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.page-id-2015 .erg-instore-jump .elementor-button,
body.page-id-2145 .erg-instore-jump .elementor-button{
  background-color: var(--erg-cta-3) !important;
  color: var(--erg-cta-contrast) !important;
  border-color: var(--erg-cta-2) !important;
  border-radius: 999px !important;
  padding-inline: 16px !important;
  flex: 0 0 auto;
}

body.page-id-2015 .erg-instore-jump .elementor-button:hover,
body.page-id-2145 .erg-instore-jump .elementor-button:hover{
  background-color: var(--erg-cta-2) !important;
  border-color: var(--erg-cta) !important;
}

@media (max-width: 640px){
  body.page-id-2015 .erg-instore-jump,
  body.page-id-2145 .erg-instore-jump{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* -----------------------------------------
   INVENTORY SECTIONS + TABLE WRAPPER
------------------------------------------ */

body.page-id-2015 .erg-instore-section,
body.page-id-2145 .erg-instore-section{
  margin-top: clamp(24px, 4vw, 40px);
}

/* Section heading */

body.page-id-2015 .erg-instore-section h2,
body.page-id-2145 .erg-instore-section h2{
  margin: 0 0 10px;
}

/* Wrap: panel + horizontal scroll */

body.page-id-2015 .erg-table-wrap,
body.page-id-2145 .erg-table-wrap{
  margin-top: 8px;
  border-radius: var(--erg-radius);
  border: 1px solid var(--erg-border);
  background: var(--erg-panel-2);
  padding: 10px 10px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* DataTables wrapper spacing */

body.page-id-2015 .erg-table-wrap .dataTables_wrapper,
body.page-id-2145 .erg-table-wrap .dataTables_wrapper{
  padding: 4px 2px 10px;
}

/* Base table styling */

body.page-id-2015 .erg-table-wrap table.tablepress,
body.page-id-2145 .erg-table-wrap table.tablepress{
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.25;
  color: var(--erg2-text-main);
}

/* Body cells */

body.page-id-2015 .erg-table-wrap table.tablepress tbody td,
body.page-id-2145 .erg-table-wrap table.tablepress tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: top;
}

/* Zebra + row hover */

body.page-id-2015 .erg-table-wrap table.tablepress tbody tr:nth-child(odd),
body.page-id-2145 .erg-table-wrap table.tablepress tbody tr:nth-child(odd){
  background: rgba(255,255,255,.02);
}

body.page-id-2015 .erg-table-wrap table.tablepress tbody tr:hover,
body.page-id-2145 .erg-table-wrap table.tablepress tbody tr:hover{
  background: rgba(62,122,141,.12);
}

/* -----------------------------------------
   DataTables controls (layout only)
   (Colors for labels/pagination are handled
    globally by TablePress Custom CSS.)
------------------------------------------ */

/* Search input look + placeholder */

body.page-id-2015 .erg-table-wrap .dataTables_filter input,
body.page-id-2145 .erg-table-wrap .dataTables_filter input{
  background: #050607;
  border-radius: 999px;
  border: 1px solid var(--erg-border);
  padding: 4px 10px;
  color: var(--erg2-text-main);
}

body.page-id-2015 .erg-table-wrap .dataTables_filter input::placeholder,
body.page-id-2145 .erg-table-wrap .dataTables_filter input::placeholder{
  color: var(--erg2-text-muted);
}

/* -----------------------------------------
   Mobile tweaks
------------------------------------------ */

@media (max-width: 640px){
  body.page-id-2015 .erg-table-wrap table.tablepress,
  body.page-id-2145 .erg-table-wrap table.tablepress{
    font-size: 13px;
  }

  body.page-id-2015 .erg-table-wrap table.tablepress thead th,
  body.page-id-2015 .erg-table-wrap table.tablepress tbody td,
  body.page-id-2145 .erg-table-wrap table.tablepress thead th,
  body.page-id-2145 .erg-table-wrap table.tablepress tbody td{
    padding: 8px 8px;
  }
}

/* -----------------------------------------
   Hero → showroom photo formatting
   (Used Guns + New Guns)
   ------------------------------------------ */

/* Give the hero a little breathing room before the tables */
body.page-id-2015 .erg-instore-hero,
body.page-id-2145 .erg-instore-hero{
  margin-bottom: clamp(18px, 3vw, 26px);
}

/* Hero image card wrapper */
body.page-id-2015 .erg-instore-photo,
body.page-id-2145 .erg-instore-photo{
  border-radius: var(--erg-radius);
  border: 1px solid var(--erg-border);
  overflow: hidden; /* clip image into rounded corners */
  box-shadow: 0 18px 40px rgba(0,0,0,0.7);
}

/* Make sure the image fills the card cleanly */
body.page-id-2015 .erg-instore-photo img,
body.page-id-2145 .erg-instore-photo img{
  display: block;
  width: 100%;
  height: auto;
}

/* -----------------------------------------
   Hero: compact 2-column layout
   ------------------------------------------ */

/* Limit line length so the hero copy stays reasonable */
body.page-id-2015 .erg-instore-hero__content,
body.page-id-2145 .erg-instore-hero__content{
  max-width: 42rem;
}

/* Desktop / tablet: text + image side-by-side */
@media (min-width: 900px){
  body.page-id-2015 .erg-instore-hero,
  body.page-id-2145 .erg-instore-hero{
    display: flex;
    align-items: stretch;
    gap: 24px;
  }

  /* Text column */
  body.page-id-2015 .erg-instore-hero__content,
  body.page-id-2145 .erg-instore-hero__content{
    flex: 0 0 55%;
    max-width: none;
  }

  /* Image column */
  body.page-id-2015 .erg-instore-photo,
  body.page-id-2145 .erg-instore-photo{
    flex: 1 1 45%;
  }
}

/* Mobile: keep things stacked but give the image a little space */
@media (max-width: 899px){
  body.page-id-2015 .erg-instore-photo,
  body.page-id-2145 .erg-instore-photo{
    margin-top: 16px;
  }
}
