/* First cascade layer so shared public layout wins over older route overrides. */
@layer public-layout {
  body { --page-gutter: clamp(1rem, 4vw, 5rem); }
  body main, body .brand-footer,
  main :is(.section,.studio-section,.studio-shell,.shop-edit,.jewelry-detail,#retailCollection,.studio-gallery) {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    margin-inline:0!important;
  }
  main:is(.retail-main,.editorial-main,.account-main,.piece-layout,.policy-page),
  main :is(.section,.studio-section,.studio-gallery,.jewelry-detail,.shop-edit) {
    padding-inline:var(--page-gutter)!important;
  }
  .storefront .shop-intro { width:100%!important; max-width:none!important; }
  main.retail-main, main:has(>#collection), main:has(>.jewelry-detail) {padding-inline:0!important;}
  #retailCollection>:not(.gallery-shop-head), .gallery-shop-head nav,
  .retail-main>:is(#retailDetail,#retailCart,.retail-bespoke) {
    margin-inline:var(--page-gutter)!important;
  }
  #collection .collection-masthead {
    margin-inline:calc(-1 * var(--page-gutter))!important;
    width:auto!important;
    max-width:none!important;
  }
  .collection-masthead[data-category] {padding:0!important;}
  .gallery-shop-head {padding-top:0!important;}
  .shop-banner-title {width:100%!important;}
  .jewelry-detail,.piece-layout,.editorial-main,.policy-page,.account-main {
    padding-block:clamp(1.5rem,4vw,4rem)!important;
  }
  .jewelry-layout {max-width:none!important; align-items:center;}
  .jewelry-layout>div:last-child {max-width:42rem;}
  .policy-page>:is(p,ul,ol,section),.account-main form,.editorial-main form {max-width:72ch;}
  .brand-page main,.luxury-store main {background-color:#10100f!important;color:#f4efe6!important;}
  .brand-page main h1,.luxury-store:not(.storefront) main h1 {
    font-family:Georgia,serif!important;font-weight:400!important;letter-spacing:-.035em!important;
  }
  .account-intro,.editorial-hero,.gold-gallery>.section-heading,.studio-section>.section-heading {
    border-bottom:1px solid #39372f!important;
    padding-block:clamp(1.5rem,4vw,4rem)!important;
  }
  @media(max-width:700px) {
    .collection-masthead[data-category]>div {padding-inline:var(--page-gutter);}
    .jewelry-layout>div:last-child {max-width:none;}
  }
}

@layer public-layout {
  .gallery-shop-head nav {
    display:flex;
    align-items:center;
    gap:clamp(1.25rem,3vw,2.5rem);
    margin-block:1rem;
  }
  .gallery-shop-head nav button[data-group] {
    min-height:44px;
    padding:.5rem 0!important;
    background:transparent!important;
    border:0!important;
    border-bottom:1px solid transparent!important;
    border-radius:0!important;
    box-shadow:none!important;
    color:var(--soft)!important;
    font:inherit!important;
    font-size:.95rem!important;
    text-decoration:none!important;
  }
  .gallery-shop-head nav button[data-group][aria-pressed=true],
  .gallery-shop-head nav button[data-group]:hover {
    border-bottom-color:var(--champagne)!important;
    color:var(--champagne)!important;
  }
}

@layer public-layout {
  #studio .controls .atelier-step {
    background:transparent!important;
    border:0!important;
    border-bottom:1px solid #494338!important;
    border-radius:0!important;
    box-shadow:none!important;
    margin:0!important;
    padding:0!important;
  }
  #studio .controls .atelier-step[open] {padding-bottom:1.25rem!important;}
  #studio .atelier-step > summary {
    display:flex!important;align-items:center;justify-content:space-between;
    list-style:none!important;cursor:pointer;
    padding:1rem .2rem!important;margin:0!important;
    font:400 clamp(1.15rem,1.6vw,1.45rem)/1.35 Georgia,serif!important;
    letter-spacing:normal!important;text-transform:none!important;color:var(--ivory)!important;
  }
  #studio .atelier-step > summary::-webkit-details-marker {display:none;}
  #studio .atelier-step > summary::after {
    content:"";width:.45rem;height:.45rem;margin-right:.4rem;
    border:solid var(--champagne);border-width:0 1px 1px 0;transform:rotate(45deg);
  }
  #studio .atelier-step[open] > summary::after {transform:rotate(225deg);}
  #studio .atelier-step > summary:focus-visible {outline:2px solid var(--champagne);outline-offset:2px;}
  #studio .atelier-step select {
    width:100%;min-height:44px;box-sizing:border-box;padding:.55rem .7rem!important;
    color:var(--ivory)!important;background-color:var(--night)!important;
    border:1px solid var(--edge)!important;border-radius:0!important;
  }
}

@layer public-layout {
  @media (min-width:701px) {
    #collection .collection-masthead[data-category] {
      display:grid!important;
      grid-template-columns:minmax(0,1fr)!important;
      align-items:center!important;
      background:#100e0c!important;
    }
    #collection .collection-masthead[data-category] > :is(div,picture) {
      grid-area:1 / 1 / 2 / 2!important;
      position:relative!important;
      inset:auto!important;
      transform:none!important;
      min-width:0;
    }
    #collection .collection-masthead[data-category] > div {
      max-width:60%;
      padding-block:1rem;
    }
  }
}

@layer public-layout {
  #collection .collection-masthead[data-category] > div {
    display:block!important;
    justify-self:start!important;
    box-sizing:border-box;
    width:100%;
    margin:0!important;
    text-align:left!important;
  }
  #collection .collection-masthead[data-category] :is(.eyebrow,h1,p) {
    display:block!important;
    text-align:inherit!important;
    margin-inline:0!important;
    padding-inline:0!important;
    text-indent:0!important;
  }
  #collection .collection-masthead[data-category] p {margin-top:.65rem!important;}
  .collection-category-links .filter-tab {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }
  @media (max-width:700px) {
    #collection .collection-masthead[data-category] > div {text-align:center!important;}
    #collection .collection-masthead[data-category] :is(.eyebrow,h1,p) {margin-inline:auto!important;}
  }
}

@layer public-layout {
  #gallery.product-gallery {width:100%!important;max-width:none!important;padding:0!important;margin:0!important;}
  .product-gallery article {background:transparent!important;border:0!important;min-width:0;}
  .product-gallery button[data-gallery-photo] {
    display:block;width:100%;border:0!important;padding:0!important;
    background:transparent!important;cursor:zoom-in;border-radius:0!important;
  }
  .product-gallery button img {display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:contain;}
  .gallery-feature {display:grid;grid-template-columns:42% 58%;align-items:center;}
  .gallery-feature button img {mask-image:linear-gradient(to right,transparent,#000 10%);}
  .gallery-feature .gallery-caption {padding:var(--page-gutter);}
  .gallery-feature h1 {font-style:italic!important;margin:0 0 1.4rem!important;}
  .gallery-pieces {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2.25rem 1rem;padding:var(--page-gutter);}
  .gallery-piece {display:flex;flex-direction:column-reverse;justify-content:flex-end;text-align:center;}
  .gallery-caption h3 {font-size:clamp(1rem,1.35vw,1.4rem)!important;line-height:1.35!important;margin:.8rem 0 .4rem!important;}
  .gallery-caption span {color:var(--soft);font-size:.95rem;}
  .product-gallery a {color:var(--ivory);text-underline-offset:.25em;}
  .product-gallery a:hover {color:var(--champagne);}
  .gallery-collections {padding:var(--page-gutter);border-top:1px solid var(--edge);display:flex;flex-wrap:wrap;gap:1rem 2rem;}
  .gallery-collections h2 {width:100%;margin:0;}
  #galleryFullImage {width:100%;height:auto!important;max-height:75vh;object-fit:contain!important;}
  @media(max-width:700px){
    .gallery-feature {display:flex;flex-direction:column;text-align:center;}
    .gallery-feature button img {mask-image:none;}
    .gallery-pieces {grid-template-columns:repeat(2,minmax(0,1fr));}
    .gallery-piece:last-child:nth-child(odd) {grid-column:1/-1;width:calc(50% - .5rem);justify-self:center;}
  }
}

@layer public-layout {
  #gallery .gallery-feature button[data-gallery-photo] {
    box-sizing:border-box!important;
    min-width:0;
    width:100%!important;
    height:auto!important;
    padding-inline:4%!important;
  }
  #gallery .gallery-feature button img {
    width:100%!important;
    max-width:60rem!important;
    height:auto!important;
    margin:auto!important;
    object-fit:contain!important;
    object-position:center!important;
    transform:none!important;
    mask-image:linear-gradient(to right,transparent,#000 7%,#000 93%,transparent);
  }
}

@layer public-layout {
 @media (max-width:700px) {
  #collection .collection-masthead[data-category] {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:0!important;background:#100e0c!important}
  #collection .collection-masthead[data-category] > picture {display:block!important;grid-area:1/1!important;width:100%!important;margin:0!important}
  #collection .collection-masthead[data-category] picture img {display:block!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;aspect-ratio:1.65!important;object-fit:cover!important;object-position:right center!important;margin:0!important}
  #collection .collection-masthead[data-category] > div {grid-area:2/1!important;position:static!important;max-width:none!important;padding:1.4rem var(--page-gutter)!important}
 }
}

@layer public-layout {
 .jewelry-detail a.piece-buy {
   display:flex!important; align-items:center; justify-content:center;
   box-sizing:border-box; width:min(100%,17rem)!important; min-height:50px;
   margin:20px 0 26px!important; padding:14px 24px!important;
   background:#dcc496!important; color:#191711!important;
   border:1px solid #dcc496!important; border-radius:2px;
   font:600 15px/1.35 system-ui,sans-serif!important; letter-spacing:.04em;
   text-decoration:none!important; text-align:center;
 }
 .jewelry-detail a.piece-buy:hover {background:#efdbb5!important}
 .jewelry-detail a.piece-buy:focus-visible {outline:2px solid ivory;outline-offset:4px}
 @media(max-width:700px){.jewelry-detail a.piece-buy{width:100%!important}}
}
@layer public-layout{
 .jewelry-detail .piece-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:32rem;margin:20px 0 26px}
 .jewelry-detail .piece-actions :is(a.piece-buy,a,button){display:flex!important;align-items:center;justify-content:center;width:100%!important;box-sizing:border-box;min-height:50px;margin:0!important;padding:10px!important;text-align:center;font:500 15px/1.35 system-ui!important}
 .piece-actions button{border:1px solid #dcc496!important;background:transparent!important;color:#dcc496!important;cursor:pointer;border-radius:2px}
 .piece-actions button:hover{background:#29251e!important}
 #savedPieces:not(:empty)~#retailCartItems .retail-empty{display:none!important}
 #savedPieces article{display:flex;gap:20px;align-items:center;border-bottom:1px solid #514737;padding:18px 0}
 #savedPieces img{width:clamp(90px,24vw,160px);height:auto}
 #savedPieces a,#savedPieces button{color:#dcc496!important}
 #savedPieces button{background:none;border:none;padding:10px 14px;text-decoration:underline;cursor:pointer}
 #savedPieces p{margin:12px 0}
}
