/* =====================================================================
   Polish layer: sizing, alignment, buttons, spacing.
   Loaded after typeset.css and conversion.css.

   ":not(#cm)" matches every element (no element has that id); it only
   adds the weight of an id, so these rules win over the parent theme's
   long class chains without !important. The two Tailwind "!" utilities
   in the taste radar still need !important.
   ===================================================================== */

html:root {
  --cm-line: rgba(0, 14, 52, .2);      /* every box and card outline */
  --cm-ctl: 2.75rem;                   /* every button and control: 44 px */
}

/* ---- 1. Leading: titles 1.2, reading text 1.6 ---- */
html body[class] main :is(h1, h2, h3, h4):not(#cm) { line-height: 1.2; }
html body[class] main :is(p, li):not(#cm) { line-height: 1.6; }
html body[class] .caviar-slider--top .line .text:not(#cm) { line-height: 1.5; }
html body[class] [data-eggs_radar_meta] [class*="text-md"] { line-height: 1.65 !important; }

/* ---- 2. Section rhythm: one vertical padding (5rem, 3.5rem on phones);
   title to content 2.5rem, title to its paragraph 1.25rem ---- */
html body[class] :is(.logos-slider, .best-selling, .image-with-text, .blocks-with-icon, .columns-section):not(#cm) {
  padding-top: var(--cm-section); padding-bottom: var(--cm-section);
}
html body[class] .video-block h2:not(#cm),
html body[class] .blocks-with-icon .container > h2:not(#cm) { margin-bottom: 2.5rem; }
html body[class] :is(.image-with-list, .image-with-text) .text h2:not(#cm),
html body[class] .image-with-text h2:not(#cm) { margin-bottom: 1.25rem; }

/* ---- 3. Text links: label and arrow centred on one underline ----
   The arrow was drawn in white, so it was invisible and pushed the label off centre. */
html body[class] :is(.image-with-list, .blocks-with-icon .button-wrapper) .btn:not(#cm),
html body[class] #caviar-slider .caviar-slider--cta .btn.active:not(#cm) {
  display: inline-flex; align-items: center; justify-content: center; gap: .75rem;
  width: auto; min-width: 0; height: auto; min-height: 0; margin: 0; padding: .875rem 0 .625rem !important; /* the parent theme pads every .btn with !important */
  border: 0; border-bottom: 1px solid currentColor; border-radius: 0; background: transparent;
  color: var(--cm-navy); font-size: .75rem; line-height: 1; letter-spacing: .14em;
}
html body[class] #caviar-slider .caviar-slider--cta .btn:not(.active) { display: none; }
html body[class] :is(.image-with-list, .blocks-with-icon .button-wrapper) .btn .icon:not(#cm) {
  display: block; flex: none; width: 12px; height: 8px; margin: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M0 4h11M8 1l3 3-3 3' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M0 4h11M8 1l3 3-3 3' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .25s ease;
}
html body[class] :is(.image-with-list, .blocks-with-icon .button-wrapper) .btn:hover .icon:not(#cm) { transform: translateX(3px); }
html body[class] :is(.image-with-list, .blocks-with-icon .button-wrapper, #caviar-slider) .btn:hover:not(#cm) { color: var(--cm-teal-ink); background: transparent; }

/* ---- 4. One height for every button and control ---- */
html body[class] .slider-block .btn:not(#cm),
html body[class] .product-hero .single_add_to_cart_button:not(#cm),
html body[class] .variant-product .inner .add-to-cart:not(#cm) {
  height: var(--cm-ctl); min-height: var(--cm-ctl); padding-top: 0 !important; padding-bottom: 0 !important; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
html body[class] .product-hero .single_add_to_cart_button:not(#cm) { display: flex; width: 100%; }
html body[class] .product-hero .quantity .quantity-btn:not(#cm) { width: var(--cm-ctl); height: var(--cm-ctl); }
html body[class] .product-hero .quantity input.qty:not(#cm) { width: 3.5rem; height: var(--cm-ctl); padding: 0; }

/* ---- 5. Tin cards (home "Best selling", product "Similar products"): one box, button inside ---- */
html body[class] .variant-product .inner:not(#cm) {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--cm-line); background-color: #fff;
}
html body[class] .variant-product .inner > a.top:not(#cm) {
  flex: 1 1 auto; border: 0; background: transparent; padding: 2rem 1.5rem 1rem;
}
html body[class] .variant-product .inner > .add-to-cart:not(#cm) { width: auto; margin: 0 1.5rem 1.5rem; }
html body[class] .variant-product .inner > a.top .title:not(#cm) { margin: 1.75rem 0 .75rem; }
html body[class] .variant-product .inner > a.top > p:not(#cm) { margin: 0 auto 1.25rem; max-width: 17rem; }
html body[class] .variant-product .inner > a.top .price:not(#cm) { margin: 0 0 .5rem; }
/* sizes: one row of square hairline chips instead of wrapping circles */
html body[class] .variant-product .inner ul:not(#cm) {
  display: flex; flex-wrap: nowrap; justify-content: center; gap: .25rem; margin: 0 auto 1rem; padding: 0;
}
html body[class] .variant-product .inner ul > li:not(#cm) { flex: 0 1 2.75rem; min-width: 0; margin: 0; }
html body[class] .variant-product .inner ul > li > button:not(#cm) {
  width: 100%; height: 2rem; padding: 0; border: 1px solid var(--cm-line); border-radius: 0; outline: 0;
  background: transparent; color: var(--cm-navy); font-size: .6875rem; letter-spacing: 0; line-height: 1;
}
html body[class] .variant-product .inner ul > li > button.active:not(#cm) {
  border-color: var(--cm-teal); box-shadow: inset 0 0 0 1px var(--cm-teal);
}
html body[class] .variant-product .inner ul > li > button:hover:not(#cm) { border-color: var(--cm-navy); }
/* carousel arrows: square, like every other control */
html body[class] :is(.best-selling, .swiper-controls) :is(.swiper-button-prev, .swiper-button-next):not(#cm) {
  width: var(--cm-ctl); height: var(--cm-ctl); border-radius: 0; border: 1px solid var(--cm-line);
}
html body[class] .product-hero .gallery .nav :is(.slick-prev, .slick-next):not(#cm) { border-radius: 0; border: 1px solid var(--cm-line); }

/* ---- 6. Press logos: one optical size; the highlighted one in white ---- */
html body[class] .logos-slider .row .swiper .swiper-slide .image:not(#cm) { height: 7.5rem; padding: 0 1rem; overflow: visible; }
html body[class] .logos-slider .row .swiper .swiper-slide .image img:not(#cm) {
  width: 100%; max-width: none; height: auto; max-height: none; flex: none;
  transform: scale(var(--k, .6)); transform-origin: 50% 50%; transition: filter .4s ease, opacity .4s ease;
}
/* factors from each file's measured ink: equal area, capped at about 190 px wide and 64 px high */
html body[class] .logos-slider img[src*="/Telegraph."]               { --k: .97; }
html body[class] .logos-slider img[src*="/LifestylleAsia."]          { --k: .96; }
html body[class] .logos-slider img[src*="/Caterer."]                 { --k: .94; }
html body[class] .logos-slider img[src*="/ABC."]                     { --k: .85; }
html body[class] .logos-slider img[src*="/CondeNastTraveller."]      { --k: .84; }
html body[class] .logos-slider img[src*="/ElleGourmet."]             { --k: .83; }
html body[class] .logos-slider img[src*="/Falstaff."]                { --k: 1; }
html body[class] .logos-slider img[src*="/HarpersBazaar."]           { --k: 1.04; }
html body[class] .logos-slider img[src*="/SeafoodSource."]           { --k: 1; }
html body[class] .logos-slider img[src*="/ilSole24Ore."]             { --k: .9; }
html body[class] .logos-slider img[src*="/OkDiario."]                { --k: .44; }
html body[class] .logos-slider img[src*="/FinancialTimesCorporate."] { --k: .38; }
html body[class] .logos-slider img[src*="/Amex."]                    { --k: .27; }
/* quote marks: typographic, not two filled white discs */
html body[class] .logos-slider .swiper-quotes h3:not(#cm) { margin-bottom: 2.5rem; }
html body[class] .logos-slider .swiper-quotes h3:not(#cm)::before,
html body[class] .logos-slider .swiper-quotes h3:not(#cm)::after {
  content: "\201C"; width: auto; height: auto; background: none; margin: 0 1rem 0 0;
  font: 400 2.75rem/1 "Rosarivo", Georgia, serif; color: var(--cm-teal); transform: translateY(.4rem);
}
html body[class] .logos-slider .swiper-quotes h3:not(#cm)::after { content: "\201D"; margin: 0 0 0 1rem; }

/* ---- 7. Five promises: titles share a two-line slot so the texts start level ---- */
html body[class] .blocks-with-icon .block .front .title:not(#cm) { line-height: 1.5; margin: 1.25rem 0 0; }
html body[class] .blocks-with-icon .block .back:not(#cm) { margin-top: .75rem; }
@media (min-width: 769px) {
  html body[class] .blocks-with-icon .block .front .title:not(#cm) { min-height: 3em; }
}

/* ---- 8. Boxes: one outline colour ---- */
html body[class] .columns-section .column .inner:not(#cm) { border: 1px solid var(--cm-line); }
html body[class] .columns-section .column .inner .title:not(#cm) { margin-bottom: 1.5rem; }
html body[class] .columns-section .column .inner li:not(#cm) { margin-bottom: .5rem; }
html body[class] .description-content .item.with-hover:not(#cm) { border-color: var(--cm-line); }
html body[class].woocommerce-shop .shop-content ul.products li.product:not(#cm) { border-color: var(--cm-line); }

/* ---- 9. Shop: title sits closer to the cards; card text centred under its centred name ---- */
html body[class].woocommerce-shop .shop-content ul.products li.product .product-text > div:not(#cm) { text-align: center; }
html body[class].woocommerce-shop .shop-content ul.products li.product .product-text .price:not(#cm) { margin: .5rem 0 1rem; }
html body[class].woocommerce-shop .shop-content .woocommerce-products-header:not(#cm) { margin: 0; padding: 0; }
html body[class].woocommerce-shop .shop-content .woocommerce-products-header h1:not(#cm) { margin: 0 0 3.5rem; }

/* ---- 10. Product gallery, as on fashion-house product pages: the tin on a soft panel,
   held in view while the buy column scrolls. "multiply" lets photos shot on white
   take the panel colour instead of showing a white square. ---- */
html:root { --cm-panel: #F2F0EB; }
html body[class] .product-hero .gallery .slide .slick-slide:not(#cm) { background-color: var(--cm-panel); padding: 2.5rem; }
html body[class] .product-hero .gallery .slide .slick-slide :is(img, canvas):not(#cm) { mix-blend-mode: multiply; }
html body[class] .product-hero .gallery .nav .slick-slide:not(#cm) { border: 0; padding: 3px 0; }
html body[class] .product-hero .gallery .nav .slick-slide .image:not(#cm) {
  background-color: var(--cm-panel); border: 1px solid transparent; padding: .375rem; transition: border-color .2s ease;
}
html body[class] .product-hero .gallery .nav .slick-slide .image img:not(#cm) { mix-blend-mode: multiply; }
html body[class] .product-hero .gallery .nav .slick-slide.slick-current .image:not(#cm) { border-color: var(--cm-navy); }
@media (min-width: 993px) {
  html body[class] .product-hero .gallery-wrap:not(#cm) { position: sticky; top: 6.5rem; align-self: flex-start; }
}

/* ---- 11. Tin cards: image on the same panel, no box around the card ---- */
html body[class] .variant-product .inner:not(#cm) { border: 0; background: transparent; }
html body[class] .variant-product .inner > a.top:not(#cm) { padding: 0 0 .5rem; }
html body[class] .variant-product .inner > a.top .image:not(#cm) {
  width: 100%; height: auto; margin: 0; padding: 2.25rem 0; background-color: var(--cm-panel); justify-content: center;
}
/* the panel is square; both photos are square and centred in it */
html body[class] .variant-product .inner > a.top .image:not(#cm) { align-items: center; }
html body[class] .variant-product .inner > a.top .image :is(img.primary, img.secondary):not(#cm) { flex: 0 0 auto; align-self: center; aspect-ratio: 1 / 1; height: auto !important; object-fit: contain; }
html body[class] .variant-product .inner > a.top .image img.primary:not(#cm) { width: 58%; margin: 0 auto; }
html body[class] .variant-product .inner > a.top .image img.secondary:not(#cm) {
  top: 50%; bottom: auto; left: 0; right: 0; width: 58%; margin: 0 auto; transform: translateY(-50%);
}
html body[class] .variant-product .inner > a.top .rate:not(#cm) { top: 1rem; right: 1rem; z-index: 2; }
html body[class] .variant-product .inner > .add-to-cart:not(#cm) { margin: 0; }

/* ---- Phones ---- */
@media (max-width: 768px) {
  html body[class] .logos-slider .row .swiper .swiper-slide .image:not(#cm) { height: 5.5rem; padding: 0; }
  html body[class] .logos-slider .row .swiper .swiper-slide .image img:not(#cm) { transform: scale(calc(var(--k, .6) * 1.15)); }
  html body[class] .logos-slider .swiper-quotes h3:not(#cm)::before,
  html body[class] .logos-slider .swiper-quotes h3:not(#cm)::after { font-size: 2rem; }
  html body[class] .logos-slider .swiper-quotes h3:not(#cm) { margin-bottom: 1.5rem; }
  html body[class] .variant-product .inner > a.top .image:not(#cm) { padding: 1.5rem 0; }
  html body[class] .product-hero .gallery .slide .slick-slide:not(#cm) { padding: 1.5rem; }
  html body[class] .variant-product .inner ul:not(#cm) { gap: .1875rem; }
  html body[class].woocommerce-shop .shop-content .woocommerce-products-header h1:not(#cm) { margin-bottom: 2.5rem; }
}
