/* Shared continuous corners for storefront controls and surfaces. */
:root { --ce-radius: 24px; }

:is(
  button, .btn, .button, .text-button, .icon-button, .news-ticker-pause,
  .shop-action, .shop-secondary, .shop-size, .news-ticker-all, .form-dt, .form-dt a,
  .c-search-button, .cep-header-ce-cart-nav__badge,
  .shape, .search, .icon-surface, .category-link, .category-surface,
  .category-popover, .category-popover a, .catalog-side-link, .subcat-link,
  .sort-control, .product-media, .product-link, .brand-tile,
  .news-priority, .news-ticker, .catalog-tags span, .stock-label, .tooltip,
  .shop-field input, .shop-field select, .shop-field textarea,
  .shop-contact-info, .shop-cart-summary, .shop-cart-line img,
  .catalog-cart-notice, .catalog-pagination a, .catalog-pagination span,
  .card, .border, .rounded, .modal-content, .dropdown-menu, .alert, .toast,
  .breadcrumb, .form-control, .custom-select, .page-link,
  input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="hidden"]),
  select, textarea
) {
  --corner: var(--ce-radius) !important;
  border-radius: var(--ce-radius) !important;
  corner-shape: superellipse(1.5) !important;
}

/* Replace the old per-element squircle masks with the shared CSS radius. */
.shape { mask-image: none !important; -webkit-mask-image: none !important; }
.product-media { overflow: hidden; }

/* Joined controls keep their shared outside outline without doubled curves. */
.card > .card-header:first-child {
  border-radius: var(--ce-radius) var(--ce-radius) 0 0 !important;
}
.card > .card-footer:last-child {
  border-radius: 0 0 var(--ce-radius) var(--ce-radius) !important;
}
.input-group > .form-control:not(:first-child),
.input-group > .input-group-append > .btn {
  border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important;
}
.input-group > .form-control:not(:last-child),
.input-group > .input-group-prepend > .btn {
  border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important;
}
.list-group > .list-group-item:first-child {
  border-top-left-radius: var(--ce-radius) !important;
  border-top-right-radius: var(--ce-radius) !important;
}
.list-group > .list-group-item:last-child {
  border-bottom-left-radius: var(--ce-radius) !important;
  border-bottom-right-radius: var(--ce-radius) !important;
}

/* Group content with its existing spacing, not repeated separator lines. */
.site-header, .site-footer, .shop-cart-line, .news-item, .brand-section {
  border-top: 0 !important; border-bottom: 0 !important;
}
.product-tabs { border-bottom: 0 !important; }
.card, .card-header, .card-footer, .form-dt,
.site-section .border:not(.btn):not(input):not(select):not(textarea),
#user-home .card, #layout-page .card {
  border: 0 !important; box-shadow: none !important;
}
.site-section hr { display: none; }
.site-section .table th, .site-section .table td { border: 0 !important; }
.list-group-item { border-left: 0 !important; border-right: 0 !important; }
.form-control, .custom-select, .shop-form input, .shop-form textarea,
.shop-filters select, .shop-cart-actions input {
  background-color: #f5f6f3;
  border-color: transparent;
  box-shadow: none;
}
.form-control:focus, .custom-select:focus, .shop-form input:focus,
.shop-form textarea:focus, .shop-filters select:focus, .shop-cart-actions input:focus {
  border-color: #526d59;
  box-shadow: 0 0 0 2px rgb(82 109 89 / 16%);
}

/* The legacy sidebar shares the storefront's quiet typography and icons. */
#left-sidebar.ce-sidebar { padding: 0; }
#left-sidebar.ce-sidebar .ce-menu { list-style: none; padding: 0; margin: 0; }
#left-sidebar.ce-sidebar .ce-menu li { border: 0; margin: 0; padding: 0; }
#left-sidebar.ce-sidebar .ce-menu-link {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 10px 12px; border: 0; color: #263b43;
  font-size: 14px; font-weight: 500; line-height: 1.6; text-decoration: none;
  border-radius: var(--ce-radius); corner-shape: superellipse(1.5);
  overflow-wrap: anywhere;
}
#left-sidebar.ce-sidebar .ce-menu-link:hover,
#left-sidebar.ce-sidebar .ce-category-toggle:hover { background: #f1f4ef; }
#left-sidebar.ce-sidebar :is(a,button):focus-visible { outline: 2px solid #526d59; outline-offset: 2px; }
#left-sidebar.ce-sidebar .ce-menu-icon { display: block; flex: 0 0 20px; width: 20px; height: 20px; }
#left-sidebar.ce-sidebar .ce-menu-heading {
  font-size: 13px; font-weight: 600; line-height: 1.6; color: #65716a;
  margin: 28px 12px 8px; padding: 0;
}
#left-sidebar.ce-sidebar .ce-category-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 8px; }
#left-sidebar.ce-sidebar .ce-category-toggle {
  display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px;
  padding: 12px; margin: 0; border: 0; background: transparent; color: #65716a;
}
#left-sidebar.ce-sidebar .ce-category-toggle[aria-expanded="true"] .ce-menu-icon { transform: rotate(180deg); }
#left-sidebar.ce-sidebar .ce-menu-children { padding-left: 14px; padding-bottom: 8px; }
#left-sidebar.ce-sidebar .ce-menu-children .ce-menu-link { font-size: 13px; font-weight: 400; }

/* An expanded category is one group, with a clear end before its sibling. */
#left-sidebar.ce-sidebar .ce-category-item:has(> .ce-category-row > .ce-category-toggle[aria-expanded="true"]) {
  background: #f0f4ee;
  border-radius: var(--ce-radius);
  corner-shape: superellipse(1.5);
  margin-block: 6px 12px;
  padding-bottom: 8px;
}
#left-sidebar.ce-sidebar .ce-category-toggle[aria-expanded="true"] { color: #31543e; }
#left-sidebar.ce-sidebar .ce-category-item:has(> .ce-category-row > .ce-category-toggle[aria-expanded="true"]) > .ce-category-row > .ce-menu-link { color: #31543e; font-weight: 600; }
#left-sidebar.ce-sidebar .ce-menu-children { padding: 0 8px 4px 24px; }
#left-sidebar.ce-sidebar .ce-menu-children .ce-menu-link { padding-block: 9px; }
