/* ===== CRITICAL LAYOUT - LOAD FIRST ===== */
.baro-filter-layout {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100% !important;
    box-sizing: border-box;
    position: relative; /* Ensures proper positioning context */
}

/* Force width calculation on first load */
.baro-filter-layout:not(.initialized) {
    width: 100% !important;
    max-width: 100% !important;
}

/* Filter sidebar - spans 1 column */
#baro-filter-form {
    grid-column: span 1;
    min-width: 0; /* Prevents overflow */
}

/* Product content - spans 3 columns */
.baro-filter-layout > div:last-child {
    grid-column: span 3;
    min-width: 0; /* Prevents overflow */
}
.baro-products {
    display: grid;
    gap: 20px;
}
.baro-col-3 { grid-template-columns: repeat(3, 1fr); }
.baro-col-4 { grid-template-columns: repeat(4, 1fr); }
.baro-col-5 { grid-template-columns: repeat(5, 1fr); }

.baro-product {
    padding: 10px;
    text-align: center;
}
.baro-pagination {
    text-align: center;
    margin-top: 20px;
}
.baro-pagination a {
    margin: 0 5px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
}
.baro-pagination a.active {
    background: green;
    color: #fff;
    border-color: green;
}
.baro-filter-group{
    margin-bottom: 20px;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    background: #fafafa;
}
.baro-heading-filter{
    font-size: 1.5rem;
    font-weight: bold;
	margin-bottom: 0px;
    text-transform: uppercase;
    color: var(--e-global-color-primary);
    padding-bottom: 5px;
}

.baro-product-heading {
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--e-global-color-primary);
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.checkbox-wrapper-1{
	display:flex;
	padding-bottom: 10px;
}

/* ===== SKELETON LOADING ANIMATION ===== */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    animation-timing-function: linear;
    will-change: background-position;
    border-radius: 8px;
}

.skeleton-title {
    height: 20px;
    margin-bottom: 10px;
    width: 80%;
}

/* Desktop skeleton grid - 4 columns, 3 rows */
.skeleton-grid-desktop {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Mobile skeleton grid - 2 columns, 1 row */
.skeleton-grid-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

#baro-filter-results.loading {
    opacity: 1;
    position: relative;
}

#baro-filter-results.loading .skeleton-container {
    display: block;
}

#baro-filter-results:not(.loading) .skeleton-container {
    display: none;
}

/* ===== RESPONSIVE FOR SKELETON LOADING ===== */

/* Tablet skeleton adjustments */
@media (max-width: 1023px) and (min-width: 768px) {
    .skeleton-grid-desktop {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile skeleton - show mobile grid */
@media (max-width: 767px) {
    .skeleton-grid-desktop {
        display: none;
    }
    .skeleton-grid-mobile {
        display: grid;
    }
}

/* Desktop - show desktop grid */
@media (min-width: 768px) {
    .skeleton-grid-mobile {
        display: none;
    }
    .skeleton-grid-desktop {
        display: grid;
    }
}
/* Layout chính: sidebar + sản phẩm - REMOVED CONFLICTING GRID LAYOUT */

/* Grid sản phẩm */
.baro-products {
    display: grid;
    gap: 20px;
}
.baro-col-2 { grid-template-columns: repeat(2, 1fr); }
.baro-col-3 { grid-template-columns: repeat(3, 1fr); }
.baro-col-4 { grid-template-columns: repeat(4, 1fr); }
.baro-col-5 { grid-template-columns: repeat(5, 1fr); }
.baro-col-6 { grid-template-columns: repeat(6, 1fr); }

/* Sản phẩm */
.baro-product {
    padding: 10px;
    text-align: center;
}

/* ===== PAGINATION STYLES ===== */
.baro-pagination {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.baro-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #fff;
}

.baro-pagination a:hover {
    background: #f5f5f5;
    border-color: #bbb;
    transform: translateY(-1px);
}

.baro-pagination a.active {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
    font-weight: 600;
}

.baro-pagination a.active:hover {
    background: #16a34a;
    border-color: #16a34a;
    transform: none;
}

.baro-pagination .baro-pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #666;
    font-weight: 500;
    user-select: none;
    font-size: 16px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .baro-filter-layout {
        gap: 30px;
        grid-template-columns: repeat(4, 1fr);
    }
    #baro-filter-form {
        grid-column: span 1;
    }
    .baro-filter-layout > div:last-child {
        grid-column: span 3;
    }
    .baro-products {
        gap: 0px;
    }
    .baro-product {
        padding: 15px;
    }
}

/* Desktop (1024px - 1199px) */
@media (max-width: 1199px) and (min-width: 1024px) {
    .baro-filter-layout {
        gap: 20px;
        grid-template-columns: repeat(4, 1fr);
    }
    #baro-filter-form {
        grid-column: span 1;
    }
    .baro-filter-layout > div:last-child {
        grid-column: span 3;
    }
    .baro-products {
        gap: 20px;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .baro-filter-layout {
        gap: 15px;
        grid-template-columns: repeat(4, 1fr);
    }
    #baro-filter-form {
        grid-column: span 1;
    }
    .baro-filter-layout > div:last-child {
        grid-column: span 3;
    }
    .baro-products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px;
    }
    .baro-product {
        padding: 8px;
    }
    .baro-heading-filter {
        font-size: 1.3rem;
    }
    .baro-product-heading {
        font-size: 20px;
    }
}

/* Mobile - All sizes (768px and below) */
@media (max-width: 768px) {
    .baro-filter-layout {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    #baro-filter-form {
        grid-column: span 1 !important;
    }
    .baro-filter-layout > div:last-child {
        grid-column: span 1 !important;
    }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .baro-filter-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    #baro-filter-form {
        grid-column: span 1;
    }
    .baro-filter-layout > div:last-child {
        grid-column: span 1;
    }
    .baro-products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    .baro-product {
        padding: 8px;
    }
    .baro-heading-filter {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    .baro-product-heading {
        font-size: 18px;
        margin-bottom: 15px;
    }
    .baro-filter-group {
        padding: 12px;
        margin-bottom: 15px;
    }
    .baro-product h3 a {
        font-size: 14px;
    }
}

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    .baro-filter-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    #baro-filter-form {
        display: none;
    }
    .baro-filter-layout > div:last-child {
        grid-column: span 1;
    }
    .baro-products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .baro-product {
        padding: 6px;
    }
    .baro-heading-filter {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    .baro-product-heading {
        font-size: 16px;
        margin-bottom: 12px;
    }
    .baro-filter-group {
        padding: 10px;
        margin-bottom: 12px;
    }
    .baro-product h3 a {
        font-size: 13px;
    }
    .baro-pagination a {
        padding: 4px 8px;
        margin: 0 3px;
        font-size: 14px;
    }
}


.checkbox-wrapper-1 *,
.checkbox-wrapper-1 ::after,
.checkbox-wrapper-1 ::before {
  box-sizing: border-box;
}
.checkbox-wrapper-1 [type=checkbox].substituted {
  margin: 0;
  width: 0;
  height: 0;
  display: inline;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.checkbox-wrapper-1 [type=checkbox].substituted + label:before {
  content: "";
  display: inline-block;
  vertical-align: top;
  height: 1.15em;
  width: 1.15em;
  margin-right: 0.6em;
  color: rgba(0, 0, 0, 0.275);
  border: solid 0.06em;
  box-shadow: 0 0 0.04em, 0 0.06em 0.16em -0.03em inset, 0 0 0 0.07em transparent inset;
  border-radius: 0.2em;
  background: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 9 9"><rect x="0" y="4.3" transform="matrix(-0.707 -0.7072 0.7072 -0.707 0.5891 10.4702)" width="4.3" height="1.6" /><rect x="2.2" y="2.9" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 12.1877 2.9833)" width="6.1" height="1.7" /></svg>') no-repeat center, white;
  background-size: 0;
  transition: color 0.1s, border 0.1s, background 0.15s, box-shadow 0.1s;
}
.checkbox-wrapper-1 [type=checkbox].substituted:checked + label:before {
  background-color: #3B99FC;
  background-size: 0.75em;
  color: rgba(0, 0, 0, 0.075);
}
.checkbox-wrapper-1 [type=checkbox].substituted + label {
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}


.checkbox-wrapper-1 label {
  display: flex;
  justify-content: start;
  align-items: center;         
  width: 100%;                 
}

.checkbox-wrapper-1 label::before {
  flex-shrink: 0; 
}

/* ===== RESPONSIVE FOR CHECKBOXES ===== */

/* Tablet cho checkboxes */
@media (max-width: 1023px) and (min-width: 768px) {
  .checkbox-wrapper-1 [type=checkbox].substituted + label:before {
    height: 1.1em;
    width: 1.1em;
    margin-right: 0.5em;
  }
  .checkbox-wrapper-1 [type=checkbox].substituted:checked + label:before {
    background-size: 0.7em;
  }
}

/* Mobile cho checkboxes */
@media (max-width: 767px) {
  .checkbox-wrapper-1 [type=checkbox].substituted + label:before {
    height: 1.05em;
    width: 1.05em;
    margin-right: 0.4em;
  }
  .checkbox-wrapper-1 [type=checkbox].substituted:checked + label:before {
    background-size: 0.65em;
  }
  .checkbox-wrapper-1 label {
    font-size: 14px;
    padding: 4px 0;
  }
}

/* Mobile Small cho checkboxes */
@media (max-width: 480px) {
  .checkbox-wrapper-1 [type=checkbox].substituted + label:before {
    height: 1em;
    width: 1em;
    margin-right: 0.3em;
  }
  .checkbox-wrapper-1 [type=checkbox].substituted:checked + label:before {
    background-size: 0.6em;
  }
  .checkbox-wrapper-1 label {
    font-size: 13px;
    padding: 3px 0;
  }
}

.baro-product h3 a{
    margin-bottom: 10px;
    line-height: 1 !important;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    color: #000;
}

.baro-product h3{
  line-height: 1 !important;
}


/* ===== BARO CATEGORY SEARCH – clean unified style ===== */

.baro-cat-search { max-width: 780px; }
.baro-cat-search__inner{
  display:flex; align-items:center; gap:0;
  background:#fff;
  border:1px solid #d1d5db;           /* gray-300 */
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
  transition:border-color .2s, box-shadow .2s;
}
.baro-cat-search__inner:focus-within{
  border-color:#22c55e;                /* green-500 */
  box-shadow:0 0 0 3px rgba(34,197,94,.15);
}

/* Select column */
.baro-cat-search__select{
  position:relative;
  flex:0 0 170px;                      /* width of select area */
  border-right:1px solid #e5e7eb;      /* divider */
  background:#fff;
}
.baro-cat-search__select select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  width:100%;
  height:46px;
  padding:0 38px 0 14px;
  font-size:16px;
  line-height:46px;
  background:transparent;
  border:0 !important;
  box-shadow:none !important;
  color:#0f172a;                        /* slate-900 */
  cursor:pointer;
}
.baro-cat-search__select select:focus{ outline:none; }

/* custom caret */
.baro-cat-search__caret{
  position:absolute; right:12px; top:50%;
  transform:translateY(-50%);
  pointer-events:none;
  font-size:12px; color:#64748b;       /* slate-500 */
}

/* Keyword input */
.baro-cat-search__input{
  flex:1;
  height:46px;
  padding:0 14px;
  font-size:16px;
  border:0 !important;
  box-shadow:none !important;
  background:#fff;
  color:#0f172a;
}
.baro-cat-search__input::placeholder{ color:#9ca3af; }
.baro-cat-search__input:focus{ outline:none; }

/* Fix các pseudo buttons trên Safari/Chrome cho input[type=search] */
.baro-cat-search__input::-webkit-search-decoration,
.baro-cat-search__input::-webkit-search-cancel-button,
.baro-cat-search__input::-webkit-search-results-button,
.baro-cat-search__input::-webkit-search-results-decoration { display:none; }

/* Submit button */
.baro-cat-search__btn{
  width:56px; height:46px;
  display:flex; align-items:center; justify-content:center;
  border:0; border-left:1px solid #e5e7eb;
  background:#22c55e;                  /* green-500 */
  cursor:pointer;
  transition:filter .15s, background .15s;
}
.baro-cat-search__btn:hover{ filter:brightness(.96); }
.baro-cat-search__btn:active{ filter:brightness(.9); }
.baro-cat-search__btn:focus{ outline:none; }

/* Remove ugly outlines/borders from any child on focus */
.baro-cat-search select:focus,
.baro-cat-search input:focus,
.baro-cat-search button:focus{
  outline:none !important;
  box-shadow:none !important;
}

/* ===== RESPONSIVE FOR SEARCH FORM ===== */

/* Tablet cho search form */
@media (max-width: 1023px) and (min-width: 768px) {
  .baro-cat-search { max-width: 100%; }
  .baro-cat-search__select { flex: 0 0 150px; }
  .baro-cat-search__inner { height: 44px; }
  .baro-cat-search__select select,
  .baro-cat-search__input { height: 44px; font-size: 15px; }
  .baro-cat-search__btn { width: 50px; height: 44px; }
}

/* Mobile Large cho search form */
@media (max-width: 767px) and (min-width: 481px) {
  .baro-cat-search { max-width: 100%; }
  .baro-cat-search__inner { 
    flex-wrap: wrap; 
    border-radius: 12px; 
    height: auto;
  }
  .baro-cat-search__select { 
    flex: 1 1 100%; 
    border-right: 0; 
    border-bottom: 1px solid #e5e7eb; 
  }
  .baro-cat-search__select select {
    height: 44px;
    font-size: 15px;
  }
  .baro-cat-search__input {
    height: 44px;
    font-size: 15px;
  }
  .baro-cat-search__btn { 
    width: 100%; 
    height: 44px;
    border-left: 0; 
    border-top: 1px solid #e5e7eb; 
  }
}

/* Mobile Small cho search form */
@media (max-width: 480px) {
  .baro-cat-search { max-width: 100%; }
  .baro-cat-search__inner { 
    flex-wrap: wrap; 
    border-radius: 10px; 
    height: auto;
  }
  .baro-cat-search__select { 
    flex: 1 1 100%; 
    border-right: 0; 
    border-bottom: 1px solid #e5e7eb; 
  }
  .baro-cat-search__select select {
    height: 42px;
    font-size: 14px;
    padding: 0 32px 0 12px;
  }
  .baro-cat-search__caret {
    right: 10px;
    font-size: 11px;
  }
  .baro-cat-search__input {
    height: 42px;
    font-size: 14px;
    padding: 0 12px;
  }
  .baro-cat-search__btn { 
    width: 100%; 
    height: 42px;
    border-left: 0; 
    border-top: 1px solid #e5e7eb; 
  }
  .baro-cat-search__btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Button search (override mạnh) */
.baro-cat-search__btn {
    width: 56px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border: transparent !important;
    background: #22c55e !important;   /* màu mặc định */
    cursor: pointer;
    transition: background 0.2s ease, filter 0.2s ease;
    border-radius: 0 !important;                  /* bỏ viền bo riêng */
  }
  
  /* Hover */
  .baro-cat-search__btn:hover {
    background: #16a34a !important;   /* xanh lá đậm hơn */
  }
  
  /* Active khi click */
  .baro-cat-search__btn:active {
    background: #15803d !important;   /* xanh lá đậm nhất */
  }

/* ===== ADDITIONAL RESPONSIVE IMPROVEMENTS ===== */

/* Touch-friendly improvements for mobile */
@media (max-width: 767px) {
  .baro-pagination a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
  }
  
  .baro-pagination .baro-pagination-dots {
    min-width: 44px;
    min-height: 44px;
    font-size: 14px;
  }
  
  .checkbox-wrapper-1 label {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
  }
  
  .baro-filter-group {
    border-radius: 8px;
  }
}

/* Landscape orientation for mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .baro-filter-layout {
    gap: 8px;
  }
  .baro-products {
    gap: 8px;
  }
  .baro-product {
    padding: 4px;
  }
  .baro-heading-filter {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  .baro-product-heading {
    font-size: 16px;
    margin-bottom: 10px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .baro-product img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  .baro-filter-layout {
    grid-template-columns: 1fr;
  }
  .baro-filter-group {
    break-inside: avoid;
    border: 1px solid #000;
    background: #fff !important;
  }
  .baro-product {
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 10px;
  }
  .baro-pagination {
    display: none;
  }
}
  