/*
Theme Name: Mitt Minilager
Theme URI: https://mitt-minilager.no
Description: Custom block theme for Mitt Minilager self-storage business.
Version: 1.4.1
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 8.0
Author: Henrik Smith
Author URI: https://mitt-minilager.no
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mitt-minilager
*/

/* === Font Smoothing === */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Focus States === */
:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

/* === Skip to Content === */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
  z-index: 10000;
  font-weight: 700;
  text-decoration: none;
}
.skip-to-content:focus {
  top: var(--wp--preset--spacing--30);
}

/* === Button Hover Enhancements === */
.wp-element-button,
.wp-block-button__link {
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, color 0.2s ease, border-color 0.2s ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover {
  transform: translateY(-1px);
}
.wp-element-button:active,
.wp-block-button__link:active {
  transform: translateY(0);
}
.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

/* === Header Layout === */
.site-header a:where(:not(.wp-block-button__link):not(.wp-block-navigation-item__content)) {
  color: var(--wp--preset--color--gray-600);
}
.site-header {
  position: fixed;
  top: 0;
  z-index: 100;
  width: 100%;
  left: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wp--preset--color--gray-200);
}
.admin-bar .site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}
.header-inner {
  max-width: var(--wp--style--global--wide-size);
  margin: 0 auto;
  padding: 0 var(--wp--preset--spacing--50);
  height: 64px;
}
/* === Nav Link Animated Underline === */
.site-header .wp-block-navigation-item__content {
  position: relative;
}
.site-header .wp-block-navigation-item__content::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--wp--preset--color--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 250ms ease;
}
.site-header .wp-block-navigation-item__content:hover::after,
.site-header .wp-block-navigation-item__content:focus::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Header button hover */
.site-header .wp-block-button__link:hover {
  filter: brightness(1.1);
}

/* === Footer Styles === */
.site-footer .no-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer a {
  transition: color 0.2s ease;
}
.site-footer a:hover {
  color: var(--wp--preset--color--white);
}
.site-footer a:focus-visible {
  outline: 2px solid var(--wp--preset--color--white);
  outline-offset: 2px;
}

/* === Button Style Variations === */

/* Large button */
.wp-block-button.is-style-large .wp-block-button__link {
  font-size: 1rem;
  padding: 1rem 2rem;
}

/* Outline Large button */
.wp-block-button.is-style-outline-large .wp-block-button__link {
  font-size: 1rem;
  color: var(--wp--preset--color--primary);
  background: transparent;
  border: 2px solid var(--wp--preset--color--primary);
  padding: 1rem 2rem;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.wp-block-button.is-style-outline-large .wp-block-button__link:hover {
  color: var(--wp--preset--color--white);
  background: var(--wp--preset--color--primary);
}

/* Outline button (theme override) */
.wp-block-button.is-style-outline .wp-block-button__link {
  color: var(--wp--preset--color--primary);
  background: transparent;
  border: 2px solid var(--wp--preset--color--primary);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  color: var(--wp--preset--color--white);
  background: var(--wp--preset--color--primary);
}

/* Plain Link button */
.wp-block-button.is-style-plain-link .wp-block-button__link {
  color: inherit;
  background: transparent;
  border: 0;
  font-size: var(--wp--preset--font-size--body-sm);
  text-decoration: underline;
  padding: 0;
  transition: color 0.2s ease;
}
.wp-block-button.is-style-plain-link .wp-block-button__link:hover {
  color: var(--wp--preset--color--primary);
  background: transparent;
  transform: none;
}

/* === General Link Transitions === */
a {
  transition: color 0.2s ease;
}

/* --- Product Card Styles --- */

/* Product Collection grid */
ul.wc-block-product-template {
  gap: var(--wp--preset--spacing--50);
}

ul.wc-block-product-template.columns-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

/* Product card container — style the li itself so all children are visually contained */
li.product,
li.wc-block-product-template__product {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--gray-100);
  border-radius: var(--wp--custom--border-radius--lg);
  padding: var(--wp--preset--spacing--50);
  box-shadow: var(--wp--preset--shadow--sm);
  transition: box-shadow 200ms ease, border-color 200ms ease;
  overflow: hidden;
}

li.product:hover,
li.wc-block-product-template__product:hover {
  box-shadow: var(--wp--preset--shadow--md);
  border-color: var(--wp--preset--color--brand-200);
}

/* Remove duplicate card styling from inner .wp-block-group (set by block editor inline styles) */
li.product > .wp-block-group,
li.wc-block-product-template__product > .wp-block-group {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Remove unwanted background/border on nested paragraphs */
li.product .wp-block-paragraph,
li.wc-block-product-template__product .wp-block-paragraph {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Card header: title + availability */
.ml-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: var(--wp--preset--spacing--30);
}

.ml-card-header .wp-block-post-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--wp--preset--color--gray-900);
  flex: 1;
}

/* Availability badge */
.ml-avail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.ml-avail__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.ml-avail--green .ml-avail__dot { background: #22c55e; }
.ml-avail--green { color: #22c55e; }
.ml-avail--amber .ml-avail__dot { background: #f59e0b; }
.ml-avail--amber { color: #f59e0b; }
.ml-avail--red .ml-avail__dot { background: #ef4444; }
.ml-avail--red { color: #ef4444; }

/* Size visualization */
.ml-card-visual {
  margin-top: var(--wp--preset--spacing--40);
  position: relative;
  height: 80px;
  background: var(--wp--preset--color--gray-50);
  border-radius: 8px;
  overflow: hidden;
}

.ml-card-visual__box {
  position: absolute;
  bottom: 8px;
  border-radius: 4px;
}

/* Capacity text — font-size & color via block attributes */
li.product .wp-block-paragraph,
li.wc-block-product-template__product .wp-block-paragraph {
  margin-top: var(--wp--preset--spacing--30);
  margin-bottom: 0;
}

/* Product price */
li.product .wc-block-components-product-price,
li.wc-block-product-template__product .wc-block-components-product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wp--preset--color--gray-900);
}

li.product .wc-block-components-product-price .wc-block-components-product-price__value,
li.wc-block-product-template__product .wc-block-components-product-price .wc-block-components-product-price__value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Subscription period text: "/ month" */
li.product .wc-block-components-product-price .subscription-details,
li.wc-block-product-template__product .wc-block-components-product-price .subscription-details {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--wp--preset--color--gray-500);
}

/* Sale-price presentation: strikethrough regular + discount badge */
.ml-price-regular {
  color: var(--wp--preset--color--text-muted);
  font-weight: 500;
  text-decoration: line-through;
  margin-right: 2px;
  font-size: 18px;
}
.ml-price-regular .woocommerce-Price-amount {
  font-size: 0.85em;
}

/* Sale badge — prominent */
.wc-block-components-product-sale-badge {
  background: #ff5b24;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.wc-block-components-product-sale-badge__text {
  color: #fff;
}

/* Bottom action bar: price + buttons */
li.product .wp-block-group.is-layout-flex:last-child,
li.wc-block-product-template__product .wp-block-group.is-layout-flex:last-child {
  margin-top: var(--wp--preset--spacing--40);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

/* "Les mer" link — base styles in theme.json core/read-more */
li.product .wp-block-read-more,
li.wc-block-product-template__product .wp-block-read-more {
  transition: color 150ms ease;
}

li.product .wp-block-read-more:hover,
li.wc-block-product-template__product .wp-block-read-more:hover {
  color: var(--wp--preset--color--primary-dark);
}

/* "Bestill" button */
li.product .wc-block-components-product-button .wc-block-components-product-button__button,
li.wc-block-product-template__product .wc-block-components-product-button .wc-block-components-product-button__button {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: var(--wp--preset--font-size--body-sm);
  border: none;
  transition: background 150ms ease;
  text-decoration: none;
}

li.product .wc-block-components-product-button .wc-block-components-product-button__button:hover,
li.wc-block-product-template__product .wc-block-components-product-button .wc-block-components-product-button__button:hover {
  background: var(--wp--preset--color--primary-dark);
}

/* Responsive: product card grid */
@media (max-width: 767px) {
  ul.wc-block-product-template.columns-3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  ul.wc-block-product-template.columns-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Blog Archive Styles === */

/* Blog hero section */
.blog-hero {
  background: var(--wp--preset--color--gray-50);
  text-align: center;
}

.blog-hero .wp-block-heading {
  color: var(--wp--preset--color--gray-900);
}

/* Blog card grid (post-template as grid) */
.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--wp--preset--spacing--60);
}

@media (max-width: 1023px) {
  .blog-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .blog-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Blog card */
.blog-card {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--gray-200);
  border-radius: var(--wp--custom--border-radius--xl);
  box-shadow: var(--wp--preset--shadow--sm);
  overflow: hidden;
  transition: box-shadow var(--wp--custom--transition--base), transform var(--wp--custom--transition--base);
}

.blog-card:hover {
  box-shadow: var(--wp--preset--shadow--md);
  transform: translateY(-2px);
}

/* Blog card featured image */
.blog-card .wp-block-post-featured-image {
  margin: 0;
}

.blog-card .wp-block-post-featured-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  display: block;
}

/* Placeholder gradient for posts without featured image */
.blog-card .wp-block-post-featured-image a,
.blog-card .blog-card__image-placeholder {
  display: block;
  aspect-ratio: 16 / 9;
  position: relative;
}

/* Category tag overlay on image */
.blog-card .blog-card__category-tag {
  position: absolute;
  top: var(--wp--preset--spacing--40);
  left: var(--wp--preset--spacing--40);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  font-size: var(--wp--preset--font-size--caption);
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  z-index: 1;
}

/* Blog card content area */
.blog-card__content {
  padding: var(--wp--preset--spacing--50);
}

/* Category + reading time meta line */
.blog-card .blog-card__meta,
.blog-card .wp-block-post-terms {
  font-size: var(--wp--preset--font-size--caption);
  color: var(--wp--preset--color--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-card .wp-block-post-terms a {
  color: inherit;
  text-decoration: none;
}

.blog-card .wp-block-post-terms a:hover {
  color: var(--wp--preset--color--primary);
}

/* Blog card title */
.blog-card .wp-block-post-title {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--wp--preset--color--gray-900);
  margin-top: var(--wp--preset--spacing--20);
  margin-bottom: 0;
}

.blog-card .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.blog-card .wp-block-post-title a:hover {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
}

/* Blog card excerpt */
.blog-card .wp-block-post-excerpt {
  margin-top: var(--wp--preset--spacing--20);
}

.blog-card .wp-block-post-excerpt__excerpt {
  font-size: var(--wp--preset--font-size--body-sm);
  color: var(--wp--preset--color--gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Blog card "Les mer" link */
.blog-card .wp-block-post-excerpt__more-link,
.blog-card .wp-block-read-more {
  color: var(--wp--preset--color--primary);
  font-size: var(--wp--preset--font-size--body-sm);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  margin-top: var(--wp--preset--spacing--40);
  transition: color var(--wp--custom--transition--fast);
}

.blog-card .wp-block-post-excerpt__more-link:hover,
.blog-card .wp-block-read-more:hover {
  color: var(--wp--preset--color--primary-dark);
  text-decoration: underline;
}

/* === Single Post Styles === */

/* Single post article content width */
.single-post-content {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Post meta (date, category, reading time) */
.single-post-meta {
  font-size: var(--wp--preset--font-size--body-sm);
  color: var(--wp--preset--color--text-muted);
}

.single-post-meta .wp-block-post-terms a {
  color: var(--wp--preset--color--primary);
  text-decoration: none;
}

.single-post-meta .wp-block-post-terms a:hover {
  text-decoration: underline;
}

/* Breadcrumb */
.blog-breadcrumb {
  font-size: var(--wp--preset--font-size--body-sm);
  color: var(--wp--preset--color--text-muted);
}

.blog-breadcrumb a {
  color: var(--wp--preset--color--primary);
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-breadcrumb .blog-breadcrumb__separator {
  color: var(--wp--preset--color--gray-400);
  margin: 0 0.5em;
}

/* Tables in post content */
.entry-content table,
.wp-block-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--wp--preset--spacing--40);
  margin-bottom: var(--wp--preset--spacing--40);
  font-size: var(--wp--preset--font-size--body-sm);
}

.entry-content table th,
.wp-block-post-content table th {
  background: var(--wp--preset--color--gray-50);
  font-weight: 600;
  text-align: left;
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
  border: 1px solid var(--wp--preset--color--gray-200);
}

.entry-content table td,
.wp-block-post-content table td {
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
  border: 1px solid var(--wp--preset--color--gray-200);
}

.entry-content table tr:nth-child(even) td,
.wp-block-post-content table tr:nth-child(even) td {
  background: var(--wp--preset--color--gray-50);
}

/* Blockquotes in post content */
.entry-content blockquote,
.wp-block-post-content blockquote {
  border-left: 4px solid var(--wp--preset--color--primary);
  padding-left: var(--wp--preset--spacing--50);
  margin-left: 0;
  margin-right: 0;
  font-style: italic;
  color: var(--wp--preset--color--text-muted);
}

/* Blog CTA section */
.blog-cta {
  background: var(--wp--preset--color--bg-highlight);
  border-radius: var(--wp--custom--border-radius--2xl);
  text-align: center;
}

/* Related articles grid */
.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--wp--preset--spacing--50);
}

@media (max-width: 767px) {
  .related-articles-grid {
    grid-template-columns: 1fr;
  }
}

.related-articles-grid .blog-card {
  font-size: var(--wp--preset--font-size--body-sm);
}

/* === Newsletter CTA === */
.newsletter-cta {
  text-align: center;
}

.newsletter-cta__subtitle {
  color: rgba(255, 255, 255, 0.8);
}

.newsletter-cta__input {
  flex: 1;
  min-width: 0;
}

.newsletter-cta__input .wp-block-paragraph {
  margin: 0;
  opacity: 0.6;
}

.newsletter-cta__disclaimer {
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--wp--preset--spacing--30);
}

@media (max-width: 480px) {
  .newsletter-cta__form {
    flex-direction: column;
  }
}

/* === Blog Meta Styling === */

/* Single post meta: uniform muted color for all items including category links */
.single-post-meta .wp-block-post-terms a,
.wp-block-group.has-text-muted-color .wp-block-post-terms a {
  color: inherit;
  text-decoration: none;
}

.single-post-meta .wp-block-post-terms a:hover,
.wp-block-group.has-text-muted-color .wp-block-post-terms a:hover {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
}

/* Single post meta dot separator */
.wp-block-group.has-text-muted-color.has-body-sm-font-size > .wp-block-paragraph {
  line-height: 1;
}

/* Archive card: category terms as styled label (no link appearance) */
.wp-block-post-template .wp-block-post-terms.taxonomy-category a {
  color: inherit;
  text-decoration: none;
}

.wp-block-post-template .wp-block-post-terms.taxonomy-category a:hover {
  color: var(--wp--preset--color--primary);
}

/* Related articles: category terms styled as label */
.wp-block-query .wp-block-post-terms.taxonomy-category {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* === Filter Pills === */
.filter-pill .wp-block-button__link {
  border-radius: 9999px;
  padding: 0.4rem 1.25rem;
  font-size: var(--wp--preset--font-size--body-sm);
  font-weight: 500;
  background: transparent;
  color: var(--wp--preset--color--gray-600);
  border: 1px solid var(--wp--preset--color--gray-200);
  text-decoration: none;
  transition: all var(--wp--custom--transition--fast);
}

.filter-pill .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--primary);
  transform: none;
}

/* Active state — "Alle" on blog home */
.filter-pill--active .wp-block-button__link,
.filter-pill--active .wp-block-button__link:hover {
  background: var(--wp--preset--color--primary);
  color: #fff;
  border-color: var(--wp--preset--color--primary);
}

/* Active state on category archive pages using WP body classes */
.category-lagring .filter-pill--lagring .wp-block-button__link,
.category-flytting .filter-pill--flytting .wp-block-button__link,
.category-organisering .filter-pill--organisering .wp-block-button__link,
.category-tips .filter-pill--tips .wp-block-button__link {
  background: var(--wp--preset--color--primary);
  color: #fff;
  border-color: var(--wp--preset--color--primary);
}

/* On category pages, "Alle" pill should NOT appear active */
.category .filter-pill--active .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--gray-600);
  border-color: var(--wp--preset--color--gray-200);
}
.category .filter-pill--active .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--primary);
}

/* === Single Product Page === */

.single-product .ml-product-sqm-badge {
  display: inline-block;
  background: var(--wp--preset--color--primary-light);
  color: var(--wp--preset--color--primary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--wp--custom--border-radius--full);
  font-size: var(--wp--preset--font-size--body-sm);
  font-weight: 500;
}

/* Quickview drawer dot styles (kept for product-quickview block) */
.single-product .ml-product-availability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--wp--preset--font-size--body-sm);
}

.single-product .ml-product-availability .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.single-product .ml-product-availability .dot--green { background: var(--wp--preset--color--success); }
.single-product .ml-product-availability .dot--amber { background: var(--wp--preset--color--warning); }
.single-product .ml-product-availability .dot--red { background: var(--wp--preset--color--danger); }

.single-product .ml-product-fits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.single-product .ml-product-fits-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--wp--preset--color--gray-100);
  padding: 0.75rem;
  border-radius: var(--wp--custom--border-radius--base);
}

.single-product .ml-product-fits-icon {
  width: 24px;
  height: 24px;
  color: var(--wp--preset--color--text-muted);
  flex-shrink: 0;
}

.single-product .ml-product-fits-label {
  font-size: var(--wp--preset--font-size--body-sm);
  font-weight: 500;
  color: var(--wp--preset--color--gray-900);
}

.single-product .ml-product-fits-count {
  font-size: var(--wp--preset--font-size--body-xs);
  color: var(--wp--preset--color--text-muted);
  margin-left: auto;
}

.single-product .ml-product-tips-text {
  font-size: var(--wp--preset--font-size--body-sm);
  color: var(--wp--preset--color--primary-dark);
  line-height: 1.5;
  margin: 0;
}

.single-product .ml-product-ideal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.single-product .ml-product-tag {
  background: var(--wp--preset--color--gray-100);
  color: var(--wp--preset--color--gray-700);
  padding: 0.375rem 0.75rem;
  border-radius: var(--wp--custom--border-radius--full);
  font-size: var(--wp--preset--font-size--body-xs);
  font-weight: 500;
}

.single-product .ml-product-price-prefix,
.single-product .ml-product-price-suffix {
  font-size: var(--wp--preset--font-size--body-sm);
  color: var(--wp--preset--color--text-muted);
  font-weight: 400;
}

/* Product image container */
.single-product .product-image-container {
  overflow: hidden;
}

.single-product .product-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive: stack columns on mobile */
@media (max-width: 767px) {
  .single-product .wp-block-columns.alignwide {
    flex-direction: column;
  }
  .single-product .wp-block-columns.alignwide > .wp-block-column {
    flex-basis: 100% !important;
  }
  .single-product .ml-product-fits-grid {
    grid-template-columns: 1fr;
  }
}

/* === Single Product Page Fixes === */

/* Breadcrumb spacing and link styles */
.single-product .product-breadcrumb {
  gap: var(--wp--preset--spacing--20);
}
.single-product .product-breadcrumb .wp-block-post-terms a {
  color: inherit;
  text-decoration: none;
}
.single-product .product-breadcrumb .wp-block-post-terms a:hover {
  color: var(--wp--preset--color--primary);
}

/* Hide WooCommerce variation stock (the block-level stock indicator handles display) */
.single-product .woocommerce-variation-availability {
  display: none !important;
}

/* WC Stock Indicator — colored dots */
.wc-block-components-product-stock-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.wc-block-components-product-stock-indicator::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wc-block-components-product-stock-indicator--in-stock {
  color: #22c55e;
}
.wc-block-components-product-stock-indicator--in-stock::before {
  background: #22c55e;
}

.wc-block-components-product-stock-indicator--low-stock {
  color: #f59e0b;
}
.wc-block-components-product-stock-indicator--low-stock::before {
  background: #f59e0b;
}

.wc-block-components-product-stock-indicator--out-of-stock {
  color: #ef4444;
}
.wc-block-components-product-stock-indicator--out-of-stock::before {
  background: #ef4444;
}

/* Hide variant selector (room number auto-assigned) */
.single-product .variations_form .variations,
.single-product table.variations,
.single-product .reset_variations {
  display: none !important;
}

/* Hide quantity field (not needed for subscriptions) */
.single-product .woocommerce-variation-add-to-cart .quantity,
.single-product .variations_button .quantity,
.single-product .cart .quantity {
  display: none !important;
}

/* Hide duplicate variation price (we show price above the form) */
.single-product .woocommerce-variation-price {
  display: none !important;
}

/* Large add-to-cart button */
.single-product .single_add_to_cart_button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--wp--custom--border-radius--lg);
}

/* === Related Products Cards (Single Product) === */

/* Grid gap matching homepage */
.wp-block-woocommerce-related-products ul.wp-block-post-template {
  gap: var(--wp--preset--spacing--50);
}

.wp-block-woocommerce-related-products ul.wp-block-post-template.columns-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

/* Card container — match homepage product cards */
.wp-block-woocommerce-related-products li.wp-block-post {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--gray-100);
  border-radius: var(--wp--custom--border-radius--lg);
  padding: var(--wp--preset--spacing--50);
  box-shadow: var(--wp--preset--shadow--sm);
  transition: box-shadow 200ms ease, border-color 200ms ease;
  overflow: hidden;
  list-style: none;
}

.wp-block-woocommerce-related-products li.wp-block-post:hover {
  box-shadow: var(--wp--preset--shadow--md);
  border-color: var(--wp--preset--color--brand-200);
}

/* Product image — rounded container with gray background */
.wp-block-woocommerce-related-products .wc-block-components-product-image {
  background: var(--wp--preset--color--gray-50);
  border-radius: var(--wp--custom--border-radius--base);
  overflow: hidden;
  margin-bottom: var(--wp--preset--spacing--40);
}

.wp-block-woocommerce-related-products .wc-block-components-product-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Title — left-aligned, smaller, matching homepage card title */
.wp-block-woocommerce-related-products .wp-block-post-title {
  font-size: 1.125rem !important;
  font-weight: 600;
  color: var(--wp--preset--color--gray-900);
  text-align: left !important;
  margin-top: 0;
  margin-bottom: var(--wp--preset--spacing--30);
}

.wp-block-woocommerce-related-products .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.wp-block-woocommerce-related-products .wp-block-post-title a:hover {
  color: var(--wp--preset--color--primary);
}

/* Price — left-aligned, larger, matching homepage card price */
.wp-block-woocommerce-related-products .wc-block-components-product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wp--preset--color--gray-900);
  text-align: left !important;
}

.wp-block-woocommerce-related-products .wc-block-components-product-price .wc-block-components-product-price__value {
  font-size: 1.5rem;
  font-weight: 700;
}

.wp-block-woocommerce-related-products .wc-block-components-product-price .subscription-details {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--wp--preset--color--gray-500);
}

/* Responsive: related products grid */
@media (max-width: 767px) {
  .wp-block-woocommerce-related-products ul.wp-block-post-template.columns-3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .wp-block-woocommerce-related-products ul.wp-block-post-template.columns-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Product Filter Chips === */

/* Hide the "Kategori" heading */
.wc-block-product-filters h3 {
  display: none;
}

/* Always show filters inline — disable WC overlay mode on mobile */
.wc-block-product-filters__open-overlay {
  display: none;
}
.wc-block-product-filters {
  display: flex;
}
.wc-block-product-filters .wc-block-product-filters__overlay {
  position: static;
  height: auto;
  pointer-events: auto;
}
.wc-block-product-filters .wc-block-product-filters__overlay-wrapper,
.wc-block-product-filters .wc-block-product-filters__overlay-wrapper .wc-block-product-filters__overlay-dialog {
  position: static;
  width: auto;
  height: auto;
  max-height: none;
  max-width: none;
  transform: none;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}
.wc-block-product-filters .wc-block-product-filters__overlay-content {
  position: static;
  height: auto;
  overflow: visible;
  padding: 0;
}
.wc-block-product-filters .wc-block-product-filters__overlay-header,
.wc-block-product-filters .wc-block-product-filters__overlay-footer {
  display: none;
}

/* Center the chips row */
.wc-block-product-filter-chips__items {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Base chip style */
.wc-block-product-filter-chips__item {
  border-radius: 9999px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.wc-block-product-filter-chips__item:hover {
  border-color: #93c5fd;
}

/* Selected chip */
.wc-block-product-filter-chips__item[aria-checked="true"] {
  background: #0070f3;
  color: #fff;
  border-color: #0070f3;
}

/* Hide checkmarks / icons WC may add */
.wc-block-product-filter-chips__item svg,
.wc-block-product-filter-chips__item .wc-block-product-filter-chips__icon {
  display: none;
}

/* Hide product counts */
.wc-block-product-filter-chips__count {
  display: none;
}

/* "Alle" button — active when no filters selected */
.wc-block-product-filter-chips__items:not(:has(.wc-block-product-filter-chips__item[aria-checked="true"])) .wc-block-product-filter-chips__item--alle {
  background: #0070f3;
  color: #fff;
  border-color: #0070f3;
}

/* Chip ordering */
.wc-block-product-filter-chips__item--alle { order: 0; }
.wc-block-product-filter-chips__item[value="liten"] { order: 1; }
.wc-block-product-filter-chips__item[value="mellomstor"] { order: 2; }
.wc-block-product-filter-chips__item[value="stor"] { order: 3; }

/* Override WC default chip selected colors with our values */
.wc-block-product-filter-chips {
  --wc-product-filter-chips-selected-background: #0070f3;
  --wc-product-filter-chips-selected-text: #fff;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
