/* ===========================================
   Label Tapes layout — SCOPED to .labels-scope
   Focus: layout only; no control/button styling
   =========================================== */

.labels-scope {
  --brand:#e6002d;
  --ink:#111827;
  --muted:#6b7280;
  --bg:#f7f7f8;
  --card:#ffffff;
  --shadow:0 6px 20px rgba(0,0,0,.06);
  --radius:16px;
}
/* Global box-sizing + no horizontal overflow */
.labels-scope, .labels-scope * { box-sizing: border-box; }
.labels-scope { overflow-x: hidden; }

/* ===== HERO ===== */
.labels-scope .hero{
  background:linear-gradient(120deg,#fff,#fff 60%,#f0f3ff);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:28px;
  display:grid;
  grid-template-columns:160px 1fr;
  gap:20px;
  align-items:center;
}
.labels-scope .hero h1{margin:0 0 8px 0;font-size:28px}
.labels-scope .hero-img{
  width:140px;height:auto;display:block;
  border-radius:12px;border:1px solid #e5e7eb;background:#fff
}
.labels-scope .pill{
  display:inline-flex;align-items:center;gap:6px;
  background:#fff;border:1px solid #e5e7eb;border-radius:999px;
  padding:8px 12px;margin:6px 8px 0 0;font-size:13px;color:#374151
}
.labels-scope .pill i{font-style:normal;background:#eef2ff;border-radius:6px;padding:2px 6px}
.labels-scope .badge{display:inline-flex;align-items:center;gap:6px;border-radius:10px;padding:6px 10px;font-size:12px}
.labels-scope .badge.ok{background:#ecfdf5;color:#047857}

/* ===== FILTERS (scoped so it won't collide with bootstrap-select) ===== */
.labels-scope .filters{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0}
.labels-scope .filters .filter-btn{
  appearance:none;border:1px solid #e5e7eb;background:#fff;
  border-radius:10px;padding:10px 14px;font-weight:normal;cursor:pointer
}
.labels-scope .filters .filter-btn.active{background:var(--brand);border-color:var(--brand);color:#fff}

/* ===== LIST ===== */
.labels-scope .list{display:grid;gap:12px}
.labels-scope .row.item{
  background:var(--card);border:1px solid #eee;border-radius:14px;
  padding:14px 16px;box-shadow:var(--shadow);
  display:grid;grid-template-columns:120px 1fr;
  grid-template-rows:auto auto;
  grid-template-areas:'img title' 'img options';
  gap:18px;align-items:start;
  min-width:0;
  margin: 0;	
}
.labels-scope .row.item .img{
  grid-area:img;width:140px;height:140px;border:1px solid #eee;border-radius:10px;background:#fff;
  display:flex;align-items:center;justify-content:center;min-width:0;
  border: none;
    padding: 0;
}
.labels-scope .row.item .img img{
  max-width:100%;max-height:100%;object-fit:contain;border-radius:8px;display:block;
}
.labels-scope .title{font-size:16px;font-weight:700;margin:0}
.labels-scope .meta{grid-area:title;margin-bottom:20px;min-width:0}
.labels-scope .sub{font-size:13px;color:var(--muted);margin-top:6px}

/* OPTIONS — layout only (no select/button styling) */
.labels-scope .options{
  grid-area:options;display:grid;
  grid-template-columns:1.2fr 140px 90px 180px; /* Pack | Price | Qty | Button */
  gap:12px;align-items:center;grid-auto-rows:auto;min-width:0;
}
.labels-scope .deal-hint{display:none !important}

/* ===== ACCORDIONS ===== */
.labels-scope .accordion{margin-top:22px}
.labels-scope details{background:transparent;border:none}
.labels-scope details summary{
  list-style:none;cursor:pointer;background:#fff;border:1px solid #e5e7eb;
  padding:12px 14px;border-radius:12px;font-weight:800;
  display:flex;justify-content:space-between;align-items:center
}
.labels-scope details[open] summary{border-bottom-left-radius:0;border-bottom-right-radius:0}
.labels-scope details .panel{
  border:1px solid #e5e7eb;border-top:none;
  border-bottom-left-radius:12px;border-bottom-right-radius:12px;padding:12px
}

/* ===== RIGHT SIDEBAR ===== */
.labels-scope .sticky-help{position:sticky;top:16px}

/* Base container paddings inside labels block */
.labels-scope .container{ padding:24px; }

/* Keep your theme’s add-to-cart width when used in labels block */
.labels-scope .product-info-inner .btn.tocart{ width:100%; padding-top:8px; padding-bottom:8px; }

/* Form controls inside options */
.labels-scope .options select,
.labels-scope .options input[type="number"]{
  width:100%; padding:10px 12px; border:1px solid #d1d5db; border-radius:10px; background:#fff;
  font-size:14px; min-width:0; max-width:100%;
  -webkit-appearance:auto; appearance:auto; color:inherit; height:auto; font-weight:normal;
}
option, select { color:inherit; font-weight:normal; }

/* Price & savings */
.labels-scope .price{ font-weight:800; font-size:20px; color:#cc2027; }
.labels-scope .price-box .old-price{
  text-decoration:line-through; color:#595959; font-weight:600; margin-right:10px; font-size:18px;
}
.labels-scope .price-box .new-price{ font-weight:800; font-size:20px; }
.labels-scope .js-save{ font-size:12px; color:#059669; margin-top:2px; }

/* Allow internal pieces to shrink and never push width */
.labels-scope .price-wrapper,
.labels-scope .qty-box,
.labels-scope .add-to-cart-form,
.labels-scope .row.item > * { min-width:0; max-width:100%; }

/* ===== RESPONSIVE BASE ===== */
@media (max-width:1024px){
  .labels-scope .row.item{grid-template-columns:90px 1fr;}
  .labels-scope .options{grid-template-columns:1fr 120px 80px 160px}
}
@media (max-width:640px){
  .labels-scope .hero{grid-template-columns:1fr}
  .labels-scope .sticky-help{position:static;margin-top:12px}
}
@media (min-width:1025px){
  .labels-scope .deal-hint{display:none}
  .labels-scope .options{grid-template-columns:1fr 140px 90px 180px}
}

/* Pack tip (purely decorative) */
.labels-scope .pack-wrap{position:relative;display:inline-block}
.labels-scope .pack-tip{
  position:absolute;left:50%;transform:translateX(-50%);top:-34px;
  background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0;border-radius:999px;
  padding:4px 10px;font-size:12px;font-weight:600;white-space:nowrap
}
.labels-scope .pack-tip:after{
  content:'';position:absolute;left:50%;transform:translateX(-50%);top:100%;
  border-width:6px 6px 0 6px;border-style:solid;border-color:#a7f3d0 transparent transparent transparent
}
.labels-scope .pack-tip:before{
  content:'';position:absolute;left:50%;transform:translateX(-50%);top:100%;margin-top:-1px;
  border-width:5px 5px 0 5px;border-style:solid;border-color:#ecfdf5 transparent transparent transparent
}
@media (max-width:640px){
  .labels-scope .pack-wrap{display:block}
  .labels-scope .pack-tip{position:static;transform:none;display:inline-flex;margin-bottom:6px}
}

/* Collapse 2-col grid to single column on tablets/phones */
@media (max-width: 1024px){
  .labels-scope main .grid{
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .labels-scope .sticky-help{ position: static; top: auto; margin-top: 0; }
}

/* ===== PHONE LAYOUT: title/SKU full row; then image | options ===== */
@media (max-width: 640px){
  .labels-scope .filters{ margin:10px 0 6px; gap:6px; }

  .labels-scope .row.item{
    grid-template-columns:80px 1fr;
    grid-template-areas:
      'title title'
      'img   options';
    gap:12px; align-items:start; padding:12px 12px;
  }
  .labels-scope .row.item .meta{ grid-area:title; }
  .labels-scope .row.item .img{ grid-area:img; }
  .labels-scope .row.item .options{ grid-area:options; }

  .labels-scope .row.item .img img{ width:64px;height:72px;object-fit:contain;display:block; }

  .labels-scope .row.item .title{ margin:0 0 4px; font-size:16px; line-height:1.25; }
  .labels-scope .row.item .sub{ margin:0; font-size:12.5px; color:var(--muted); }

  .labels-scope .row.item .options{
    display:grid; grid-template-columns:1fr; gap:10px; min-width:0;
  }
  .labels-scope .row.item .price-wrapper{ margin-top:2px; }
}

/* Ultra narrow phones */
@media (max-width: 360px){
  .labels-scope .row.item{ grid-template-columns:70px 1fr; }
  .labels-scope .row.item .title{ font-size:15px; }
  .labels-scope summary .badge{ display:none; }
}

/* ===== MOBILE: Qty + Add to Cart side-by-side and icon-only button ===== */
@media (max-width:640px){
  .labels-scope .row.item .add-to-cart-form{
    display:grid;
    grid-template-columns:88px minmax(140px,1fr); /* qty | button */
    gap:10px; align-items:center; width:100%;
  }
  .labels-scope .row.item .add-to-cart-form select.qty,
  .labels-scope .row.item .add-to-cart-form .qty-field{ height:42px; width:100%; }
  .labels-scope .row.item .add-to-cart-form .btn{
    height:40px; padding:0 10px; display:flex; justify-content:center; align-items:center; width:100%;
  }
  .labels-scope .row.item .add-to-cart-form .btn span{ display:none; } /* icon only */
  .labels-scope .row.item .add-to-cart-form .btn i{ margin:0; font-size:18px; line-height:1; }

  /* Filters & grid safety */
  .labels-scope .filters{ width:100%; padding:0 12px; margin:12px 0 6px; overflow:hidden; flex-wrap:wrap; }
  .labels-scope .filters .filter-btn{ flex:0 0 auto; white-space:nowrap; max-width:100%; }
  .labels-scope main .grid{ grid-template-columns:1fr !important; padding:0 12px; overflow:hidden; }
  .labels-scope .row.item{ overflow:visible; }
  .labels-scope .btn.tocart{ min-width:44px; }
}

/* ===== Mobile: move H1 above the image in hero section ===== */
@media (max-width:640px){
  .labels-scope header.container{ max-width:100%; width:100%; padding-left:0; padding-right:0; }
  .labels-scope header .hero{ border-radius:0; box-shadow:none; margin:0; }

  .labels-scope .hero{ display:flex; flex-direction:column; }
  .labels-scope .hero .text-wrap{ order:1; text-align:center; margin-bottom:12px; }
  .labels-scope .hero .img-wrap{ order:2; }
}

/* ===== DESKTOP: keep price | qty | button in their own cells ===== */
@media (min-width: 641px){
  /* 4 columns: Pack | Price | Qty | Button */
  .labels-scope .row.item .options{
    grid-template-columns: 1fr 150px 96px 170px;
    align-items: center;
    gap: 12px;
  }
  .labels-scope .row.item .options > *{ min-width:0; }

  /* Key fix: let fields lay out inline *inside the grid cell* */
  .labels-scope .row.item .add-to-cart-form{
    display: contents !important;  /* ensures Qty + Button occupy their cells */
  }

  /* Qty width is fixed so it can't collapse under the button */
  .labels-scope .row.item .qty-box select,
  .labels-scope .row.item .add-to-cart-form select.qty{
    width: 100%;
    min-width: 96px;
    height: 38px;
  }

  /* Button: inline size, not 100% */
  .labels-scope .row.item .add-to-cart-form .btn{
    width: auto;
    min-width: 150px;
    height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Show text on desktop */
  .labels-scope .row.item .add-to-cart-form .btn span{
    display: inline !important;
    margin-left: 6px;
  }
}


/* === MOBILE FIX: keep qty + cart fully inside card === */
@media (max-width:640px){
  /* Make the two columns truly flexible */
  .labels-scope .row.item .add-to-cart-form{
    display:grid;
    grid-template-columns: 84px minmax(0,1fr); /* qty | button (no fixed min!) */
    gap:8px;
    align-items:center;
    width:100%;
  }

  /* Button: allow shrinking to fit container */
  .labels-scope .row.item .add-to-cart-form .btn{
    height:40px;
    padding:0 10px;
    width:100%;
    max-width:100%;
    min-width:0 !important;   /* override theme min-widths */
    margin:0 !important;      /* avoid stray margins pushing it out */
    box-sizing:border-box;
  }

  /* Qty control height */
  .labels-scope .row.item .add-to-cart-form select.qty,
  .labels-scope .row.item .add-to-cart-form .qty-field{
    height:40px;
    width:100%;
    min-width:0;
  }

  /* Safety: the options wrapper shouldn’t clip on the right */
  .labels-scope .row.item .options{
    overflow:visible;
    padding-right:2px;
  }
}

.labels-scope .pill i{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#f3f4f6;
  border-radius:6px;
  padding:2px 6px;
  font-size:13px;
}

.labels-scope .title-link { color:#111; text-decoration:none; }
.labels-scope .title-link:hover { text-decoration:underline; }
.labels-scope .img-link img { transition:transform 0.2s ease; }
.labels-scope .img-link:hover img { transform:scale(1.03); }


/* Compact styling ONLY for width and length filter bars */
.labels-scope .filters[data-scope="width"],
.labels-scope .filters[data-scope="length"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

/* Smaller chips for width/length buttons */
.labels-scope .filters[data-scope="width"] .filter-btn,
.labels-scope .filters[data-scope="length"] .filter-btn {
  padding: 7px 15px;
  font-size: 14.5px;
  line-height: 1.1;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  cursor: pointer;
  margin: 0;
}

/* Active chip (width/length) */
.labels-scope .filters[data-scope="width"] .filter-btn.active,
.labels-scope .filters[data-scope="length"] .filter-btn.active {
  background: #e60028;  /* Ink Depot red */
  border-color: #e60028;
  color: #fff;
}

/* “All widths” and “All lengths” → look like small labels (not clickable) */
.labels-scope .filters[data-scope="width"] .filter-btn[data-width="all"],
.labels-scope .filters[data-scope="length"] .filter-btn[data-length="all"] {
  pointer-events: none;
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
  font-weight: 600;
  padding: 5px 11px;
}

/* Slightly smaller spacing on mobile */
@media (max-width: 480px) {
  .labels-scope .filters[data-scope="width"],
  .labels-scope .filters[data-scope="length"] {
    gap: 5px;
    margin: 5px 0;
  }
  .labels-scope .filters[data-scope="width"] .filter-btn,
  .labels-scope .filters[data-scope="length"] .filter-btn {
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* ============================= */
/* MINIMAL ADDITIONS FOR FIXES   */
/* ============================= */

/* 1) Dropdown filter bar layout (desktop = one row; tablet/phone wraps nicely) */
.labels-scope .filters-dropdowns{
  margin:16px 0 8px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr auto; /* Type | Size | Color | Reset */
  gap:12px;
  align-items:end;
}
.labels-scope .filters-dropdowns .fd-row{ display:flex; flex-direction:column; gap:6px; }
.labels-scope .filters-dropdowns label{ font-size:14px; font-weight:700; color:#0f172a; line-height:1; }
.labels-scope .filters-dropdowns .fd-select{
  height:44px; padding:0 12px;
  border-radius:10px; border:1px solid #d1d5db; background:#fff;
  font-size:15px; color:#111827;
  -webkit-appearance:auto; appearance:auto;
}
.labels-scope .filters-dropdowns .btn-reset{
  height:44px; padding:0 16px; border-radius:10px;
  border:1px solid var(--brand); background:var(--brand); color:#fff; font-weight:700;
}
@media (max-width:1024px){
  .labels-scope .filters-dropdowns{ grid-template-columns: 1fr 1fr; }
  .labels-scope .filters-dropdowns .fd-row:nth-child(3){ grid-column:1 / -1; }
  .labels-scope .filters-dropdowns .fd-reset-wrap{ grid-column:1 / -1; justify-self:start; }
}
@media (max-width:640px){
  .labels-scope .filters-dropdowns{ grid-template-columns:1fr; gap:10px; }
}

/* 2) Keep native select arrow from being clipped on some devices */
.labels-scope .options .pack-select{ padding-right:28px; }

/* 3) Tidy accordion caret so it doesn’t jump in responsive views */
.labels-scope details summary{ position:relative; padding-right:42px; }
.labels-scope details summary::-webkit-details-marker{ display:none; }
.labels-scope details summary::after{
  content:""; position:absolute; right:14px; top:50%;
  width:10px; height:10px; border-right:2px solid #6b7280; border-bottom:2px solid #6b7280;
  transform:translateY(-50%) rotate(45deg); transition:transform .2s ease;
}
.labels-scope details[open] summary::after{ transform:translateY(-50%) rotate(-135deg); }


/* === FINAL RESPONSIVE TWEAKS === */
@media (max-width: 640px) {

  /* Container padding on mobile */
  .labels-scope .container {
    padding: 10px !important;
  }

  /* Adjust dropdown filter layout on small screens */
  .labels-scope .filters-dropdowns {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 16px 10px 0 10px !important;
  }

  /* Adjust the little arrow tip position for pack labels */
  .labels-scope .pack-tip:after {
    top: 37% !important;
  }
}
