/* Shared responsive UI. Load after the existing storefront/admin styles. */
:root {
  --primary-color: #1d5b54;
  --bs-primary: #1d5b54;
  --bs-primary-rgb: 29, 91, 84;
  --ui-border: #dde5e7;
  --ui-ink: #1d3036;
  --ui-muted: #53666d;
}
body { color: var(--ui-ink); background: #f7f9fa; }
main { min-width: 0; }
img { max-width: 100%; }
.row > * { min-width: 0; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; overflow-wrap: anywhere; }
p, address, code, .card-title, .nav-link { overflow-wrap: anywhere; }
.text-muted { color: var(--ui-muted) !important; }
.card { border: 1px solid var(--ui-border); border-radius: 14px; box-shadow: 0 3px 12px #17383b08; }
.card:hover { transform: none; box-shadow: 0 3px 12px #17383b08; }
.card-header { background: #fff; padding: 1rem 1.25rem; border-color: var(--ui-border); }
.btn { border-radius: 9px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; }
.btn-primary, .btn-primary:hover, .btn-primary:focus { background: var(--primary-color); border: 1px solid var(--primary-color); transform: none; }
.btn-primary:hover { filter: brightness(.92); }
.btn-outline-primary { color: var(--primary-color); border-color: var(--primary-color); }
.btn-outline-primary:hover, .btn-outline-primary.active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; transform: none; }
.btn:disabled { opacity: .6; }
.btn-link { text-decoration: underline; text-underline-offset: 3px; }
.form-control, .form-select { min-height: 44px; border: 1px solid #b8c7cc; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px #1d5b5420; }
:focus-visible { outline: 3px solid #247a70; outline-offset: 3px; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary-color); }
.badge { white-space: normal; line-height: 1.35; }
.bg-warning, .bg-info { color: #243336 !important; }
.table-responsive { max-width: 100%; overflow: auto !important; overscroll-behavior-x: contain; }
.table td, .table th { vertical-align: middle; }
.pagination { flex-wrap: wrap; gap: .25rem; }
.pagination .page-link { min-height: 44px; min-width: 44px; display: grid; place-items: center; }
.navbar .container, .navbar .container-fluid { gap: .25rem; }
.navbar-brand { flex-shrink: 1; font-size: 1.2rem; }
.navbar .nav-link { min-height: 44px; display: flex; align-items: center; }
.mobile-cart-link { display: grid !important; place-items: center; width: 44px; color: #fff; flex-shrink: 0; }
.navbar-toggler { min-height: 44px; min-width: 44px; }
.navbar form { width: 100%; }
.navbar .dropdown-menu { max-width: min(22rem, calc(100vw - 2rem)); }
.hero-section { min-height: 370px; background: linear-gradient(120deg, #123f3b, #267269); }
.hero-section h1 { font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.035em; }
.hero-section .lead { font-size: 1.1rem; color: #e3f0ec; }
.hero-product-showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 1rem; }
.hero-product-tile { background: #fff; color: var(--ui-ink); padding: .75rem; border-radius: 14px; box-shadow: 0 12px 32px #071d2530; }
.hero-product-tile:nth-child(2) { margin-top: 3rem; }
.hero-product-tile img { width: 100%; height: 150px; object-fit: contain; }
.hero-product-tile span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8rem; margin-top: .5rem; }
.category-card { padding: .5rem 0; }
.category-card .card-body { padding: 1rem; }
.category-card i { font-size: 1.7rem; margin-bottom: .75rem !important; }
.category-card .card-title { font-size: 1rem; }
.product-card { height: 100%; background: #fff; }
.product-card > a { display: flex; flex: 1; flex-direction: column; }
.product-card .card-img-top { width: 100%; height: 210px !important; object-fit: contain !important; background: #fff; padding: 1rem; }
.product-card:hover .card-img-top { transform: none; }
.product-card .card-body { padding: 1rem; }
.product-card .card-title { font-size: .95rem; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .card-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .card-footer { padding: 0 1rem 1rem; }
.product-card .btn { width: 100%; font-size: .85rem; }
.product-item-list .product-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.product-item-list .product-card > a { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; }
.product-item-list .card-img-top { height: 140px !important; }
.product-item-list .card-footer { padding: 1rem; }
#filterCollapse .card { box-shadow: none !important; }
.product-feature-group { border: 0; min-width: 0; padding: 0; }
.product-feature-group legend { font-size: 1rem; font-weight: 600; float: none; width: auto; }
.product-choice-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.product-choice { position: relative; cursor: pointer; min-width: 74px; max-width: 100%; }
.product-choice input { position: absolute; left: .85rem; top: 1rem; width: 17px; height: 17px; margin: 0; }
.product-choice-content { min-height: 48px; padding: .7rem .9rem .7rem 2.3rem; border: 1px solid #b8c7cc; border-radius: 10px; display: flex; flex-direction: column; background: #fff; overflow-wrap: anywhere; }
.product-choice input:checked + .product-choice-content { border-color: var(--primary-color); box-shadow: inset 0 0 0 1px var(--primary-color); background: #edf6f2; color: #164b44; font-weight: 600; }
.product-choice input:focus-visible + .product-choice-content { outline: 3px solid #247a70; outline-offset: 3px; }
.product-choice small { color: #814224; font-size: .72rem; font-weight: 400; }
.choice-unavailable .product-choice-content { border-style: dashed; background: #f5f6f6; }
.product-detail-page #product-carousel .carousel-item > img, #product-option-image { height: clamp(250px, 38vw, 500px) !important; object-fit: contain !important; }
.purchase-bar-summary { display: none; }
.order-review-panel { border: 1px solid #d6e7e2; border-left: 4px solid var(--primary-color); border-radius: 12px; background: #edf6f2; padding: 1rem; }
.order-review-panel h2 { font-size: 1rem; margin: 0 0 .4rem; }
.order-review-panel p { margin: 0; }
footer { background: #153d39; }
footer .text-muted { color: #d2dfdc !important; }
.admin-shell main { max-width: 1680px; margin: 0 auto; }
.admin-shell .navbar { background: #193e3a !important; }
.admin-shell .table th { text-transform: none; letter-spacing: 0; }
.admin-shell .table td .btn { margin-bottom: .2rem; }
.admin-shell .table input { min-width: 70px; }
.admin-shell .table input[type=checkbox] { min-width: 20px; width: 20px; height: 20px; }
.combination-tools { border: 1px solid var(--ui-border); border-radius: 10px; padding: 1rem; background: #f7f9fa; }
.combination-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.combination-bulk .form-select, .combination-bulk .form-control { flex: 1 1 130px; width: auto; }
.combination-check { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.form-select[multiple] { min-height: 130px; }
#combination-prices { max-height: 650px; margin-top: 1rem; }
#combination-prices table { min-width: 920px; }
#combination-prices th { position: sticky; top: 0; z-index: 1; background: #edf3f2; }
#combination-prices td { padding: .75rem .5rem; }
#combination-prices input[type=number] { min-width: 105px; }
#combination-prices td:last-child { min-width: 170px; }
.product-save-actions { position: sticky; bottom: 0; z-index: 3; background: #fff; border-top: 1px solid var(--ui-border); padding: 1rem 0 .25rem; gap: .5rem; }
@media (min-width: 992px) {
  .mobile-cart-link { order: 3; margin-right: 0 !important; margin-left: .75rem !important; }
  #navbarNav { order: 2; }
  #filterCollapse { position: sticky; top: 95px; }
}
@media (max-width: 991.98px) {
  .navbar-collapse { width: 100%; }
  .navbar form { max-width: none !important; margin: .5rem 0 !important; }
  .hero-section { min-height: 0; text-align: left; }
  .hero-product-showcase { margin-top: 1.5rem; max-width: 580px; }
  .hero-product-tile:nth-child(2) { margin-top: 0; }
}
@media (max-width: 767.98px) {
  .container.py-5, section.py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  .d-flex.justify-content-between { flex-wrap: wrap; gap: .75rem; }
  .card-body { padding: 1rem; }
  .form-control, .form-select { font-size: 16px; }
  .table { font-size: .9rem; }
  .table td, .table th { padding: .7rem; }
  .table-responsive > .table { min-width: 540px; }
  .table td .d-flex { flex-wrap: wrap; }
  .mobile-cart-table, .mobile-cart-table tbody { display: block; min-width: 0 !important; }
  .mobile-cart-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mobile-cart-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--ui-border); padding: .75rem 0; }
  .mobile-cart-table td { border: 0; padding: .5rem; min-width: 0; }
  .mobile-cart-table td:first-child { grid-column: 1 / -1; }
  .mobile-cart-table td:first-child > .d-flex { flex-wrap: nowrap; }
  .mobile-cart-table td:first-child img { flex-shrink: 0; }
  .mobile-cart-table td:nth-child(2)::before { content: 'Unit price'; display: block; color: var(--ui-muted); font-size: .75rem; }
  .mobile-cart-table td:nth-child(4)::before { content: 'Line total'; display: block; color: var(--ui-muted); font-size: .75rem; }
  .mobile-cart-table td:nth-child(3) { grid-column: 1 / -1; }
  .mobile-cart-table .quantity-control { flex-wrap: nowrap !important; }
  .mobile-cart-table .quantity-input { min-width: 60px; }
  .card-body.p-5 { padding: 1.25rem !important; }
  .admin-shell .btn-sm { font-size: .85rem; padding: .5rem .7rem; }
  #combination-prices { max-height: none; overflow: visible !important; }
  #combination-prices table, #combination-prices tbody { display: block; min-width: 0 !important; }
  #combination-prices thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #combination-prices tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; border: 1px solid var(--ui-border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; background: #fff; }
  #combination-prices tr[hidden] { display: none; }
  #combination-prices td { display: block; border: 0; padding: 0; min-width: 0 !important; }
  #combination-prices td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--ui-muted); margin-bottom: .25rem; }
  #combination-prices td:nth-child(3), #combination-prices td:last-child { grid-column: 1 / -1; }
  #combination-prices input { min-width: 0 !important; }
  #combination-prices input[type=file] { width: 100%; }
  .product-detail-page { padding-bottom: calc(105px + env(safe-area-inset-bottom)) !important; }
  body:has(.product-detail-page) { padding-bottom: calc(105px + env(safe-area-inset-bottom)); }
  .purchase-actions { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(140px, 1fr); align-items: center; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -3px 18px #133e391c; border-top: 1px solid var(--ui-border); }
  .purchase-bar-summary { display: flex; flex-direction: column; }
  .purchase-bar-summary strong { font-size: 1.25rem; }
  .purchase-bar-summary small { font-size: .75rem; color: var(--ui-muted); }
  .purchase-actions .purchase-back { display: none; }
  .purchase-actions .btn-lg { padding: .65rem; font-size: .95rem; }
  .product-editor-aside { margin-top: 1rem; }
}
@media (max-width: 575.98px) {
  .navbar-brand { font-size: 1.05rem; }
  .navbar-brand i { display: none; }
  .hero-section h1 { font-size: 2rem; }
  .hero-section .btn { margin-bottom: .5rem; }
  .hero-product-showcase { gap: .5rem; }
  .hero-product-tile { padding: .5rem; }
  .hero-product-tile img { height: 90px; }
  .hero-product-tile span { font-size: .7rem; }
  .product-card .card-img-top { height: 150px !important; padding: .65rem; }
  .product-card .card-body { padding: .7rem; }
  .product-card .card-title { font-size: .85rem; }
  .product-card .card-text { display: none; }
  .product-card .card-footer { padding: 0 .7rem .7rem; }
  .product-card .btn { font-size: .75rem; padding: .5rem .3rem; }
  .product-card .h5, .product-card .h4 { font-size: 1.1rem; }
  .product-card .badge { font-size: .65rem; }
  .product-item-list .product-card { display: flex; }
  .product-item-list .product-card > a { grid-template-columns: 105px minmax(0, 1fr); }
  .product-item-list .card-footer { padding: .7rem; }
  .category-card .card-title { font-size: .9rem; }
  .category-card .card-text { display: none; }
  .category-card .btn { font-size: .75rem; padding: .5rem; }
  .combination-bulk > * { flex: 1 1 calc(50% - .5rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .purchase-actions, .product-save-actions { display: none !important; }
  body:has(.product-detail-page) { padding-bottom: 0; }
}
