/* Sunshine Jewels Responsive Master v9.0.0
   Broad modern-device support: phones, tablets, laptops, desktops, touch, portrait/landscape.
   Loaded after the main storefront CSS. */

:root{
  --sj-r-gutter:clamp(14px,3.2vw,34px);
  --sj-r-tap:44px;
}

html{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-padding-top:96px;
}
body{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:hidden;
}
main,section,header,footer,nav,aside,article,.container{min-width:0;max-width:100%}
.container{
  width:min(1440px,calc(100% - (var(--sj-r-gutter) * 2)))!important;
  margin-inline:auto!important;
}
img,video,canvas,picture{max-width:100%;height:auto}
iframe{max-width:100%}
input,select,textarea,button{max-width:100%}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button,.btn,.sjc-btn,.sjai-primary,.sjai-secondary{touch-action:manipulation}

/* Keep long content from forcing horizontal scrolling. */
.product-card,.editorial-product-card,.cart-item,.pdp,.catalog-layout,.story-editorial,.custom-editorial,
.footer-editorial-grid,.account-grid,.form-grid,.quick-layout,.checkout-grid,.sj-brand-signature-inner{min-width:0}
.product-name,.editorial-product-meta h3,.pdp-info h1,.page-hero h1,.story-editorial-copy h2,.custom-editorial-copy h2,
.footer-editorial-grid p,.footer-editorial-grid a{overflow-wrap:anywhere}

/* Touch targets */
.icon-btn,.mobile-menu-btn,.wish-btn{min-width:var(--sj-r-tap);min-height:var(--sj-r-tap)}
.btn,.chip,.occasion,.catalog-toolbar select{min-height:var(--sj-r-tap)}

/* Header / navigation */
.editorial-header,.site-header{max-width:100vw}
.header-top,.header-main{width:min(1440px,calc(100% - (var(--sj-r-gutter) * 2)))!important;margin-inline:auto!important}
.mobile-nav,.mobile-nav-v14{
  max-height:calc(100dvh - 92px)!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.search-overlay{padding-left:var(--sj-r-gutter);padding-right:var(--sj-r-gutter)}
.search-overlay form{max-width:100%}

/* Fluid storefront media / cards */
.product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.home-product-panel{grid-template-columns:repeat(4,minmax(0,1fr))}
.product-photo,.editorial-product-photo{min-width:0}
.product-photo img,.editorial-product-photo img{max-width:100%;height:100%;object-fit:cover}
.gem-carousel-track,.chip-row,.thumbs,.sjai-version-scroll{scrollbar-width:none;-webkit-overflow-scrolling:touch}
.gem-carousel-track::-webkit-scrollbar,.chip-row::-webkit-scrollbar,.thumbs::-webkit-scrollbar{display:none}

/* Responsive content that may contain wide tables. */
main table{max-width:100%}

/* Large desktop: use space without making text/card widths enormous. */
@media (min-width:1600px){
  .container{width:min(1500px,calc(100% - 80px))!important}
  .header-top,.header-main{width:min(1500px,calc(100% - 80px))!important}
  .product-grid,.home-product-panel{gap:28px 22px}
}

/* Laptop / small desktop */
@media (max-width:1280px){
  .container{width:min(100% - 40px,1240px)!important}
  .header-top,.header-main{width:min(100% - 40px,1240px)!important}
  .footer-editorial-grid{gap:34px!important}
  .story-editorial-copy,.custom-editorial-copy{padding-left:clamp(24px,4vw,54px)!important;padding-right:clamp(24px,4vw,54px)!important}
}

/* Tablet landscape / compact laptop */
@media (max-width:1100px){
  .container{width:min(100% - 34px,1040px)!important}
  .header-top,.header-main{width:min(100% - 28px,1040px)!important}
  .desktop-nav,.editorial-nav{display:none!important}
  .mobile-menu-btn{display:grid!important}
  .product-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .home-product-panel{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .catalog-layout{grid-template-columns:1fr!important}
  .filters{position:static!important}
  .pdp{grid-template-columns:1fr!important}
  .pdp-info{position:static!important}
  .footer-editorial-grid{grid-template-columns:1.2fr 1.2fr 1fr!important}
  .footer-editorial-grid>div:last-child{grid-column:auto}
}

/* Tablet portrait */
@media (max-width:900px){
  :root{--sj-r-gutter:18px}
  html{scroll-padding-top:78px}
  .announcement{padding-inline:14px!important;white-space:normal!important}
  .header-top,.header-main{width:calc(100% - 28px)!important;gap:10px!important}
  .home-editorial .editorial-header{position:absolute!important;left:0;right:0}
  .nav-open{overflow:hidden}
  .nav-open .mobile-nav,.nav-open .mobile-nav-v14{
    position:fixed!important;
    left:0!important;right:0!important;
    top:calc(30px + 66px)!important;
    max-height:calc(100dvh - 96px)!important;
    padding:16px max(18px,env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))!important;
    background:#fffaf6!important;
    z-index:1500!important;
  }
  .sj-brand-lockup{min-width:0!important}
  .sj-brand-lockup-text{min-width:0}
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .home-product-panel{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .photo-category-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .category-grid,.three-category-grid{grid-template-columns:1fr!important}
  .story-editorial,.custom-editorial,.story-split{grid-template-columns:1fr!important}
  .story-collage{min-height:430px;height:auto!important;aspect-ratio:5/4}
  .custom-editorial-image img{min-height:0!important;aspect-ratio:4/3;object-fit:cover}
  .promo-pair,.theme-grid,.blog-grid{grid-template-columns:1fr!important}
  .gift-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .birth-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .style-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .reassurance-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .footer-editorial-grid{grid-template-columns:1fr 1fr!important;gap:30px!important}
  .newsletter-block,.sj-footer-brand{grid-column:1/-1!important}
  .pdp{gap:26px!important}
  .gallery{grid-template-columns:1fr!important}
  .thumbs{order:2;flex-direction:row!important;overflow-x:auto!important;padding-bottom:6px}
  .thumb{flex:0 0 76px;width:76px!important}
  .cart-grid,.quick-layout,.account-grid,.form-grid{grid-template-columns:1fr!important}
  .cart-summary{position:static!important}
  main table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
}

/* Phones */
@media (max-width:680px){
  :root{--sj-r-gutter:14px}
  body{font-size:15px}
  .container{width:calc(100% - 28px)!important}
  .header-top,.header-main{width:calc(100% - 20px)!important}
  .announcement{font-size:8.5px!important;line-height:1.4!important;min-height:30px!important}
  .header-top,.header-main{height:64px!important}
  .sj-brand-logo-mini{width:34px!important;height:34px!important}
  .header-top .sj-brand-lockup .brand-word{font-size:15px!important;letter-spacing:.10em!important}
  .header-top .sj-brand-lockup small{font-size:5px!important;letter-spacing:.22em!important}
  .header-actions .icon-btn{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important}
  .header-actions{gap:0!important}
  .search-overlay{padding-top:10vh}
  .search-overlay input{font-size:18px!important;min-width:0}
  .search-overlay button{padding-inline:16px!important}
  .search-close{right:14px!important;top:14px!important}

  /* Hero sections should fit viewport without clipping copy/buttons. */
  .sj-hero-slider,.lux-hero,.v12-hero{height:auto!important;min-height:clamp(540px,78svh,680px)!important}
  .sj-hero-center,.lux-hero-copy{width:calc(100% - 28px)!important;max-width:480px!important;left:50%!important;right:auto!important;transform:translate(-50%,-50%)!important;text-align:center!important}
  .sj-hero-center h1,.lux-hero-copy h1{font-size:clamp(25px,8vw,34px)!important;line-height:1.18!important}
  .sj-hero-actions,.lux-hero-actions{width:100%!important;max-width:360px!important;margin-inline:auto!important;display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .sj-hero-actions a,.lux-hero-actions a{width:100%!important;min-width:0!important;min-height:46px!important}
  .sj-video-collection{left:14px!important;right:14px!important;max-width:none!important}
  .sj-video-shop{right:14px!important}

  .lux-section,.section{padding-top:48px!important;padding-bottom:48px!important}
  .lux-heading h2,.section-title{font-size:clamp(24px,7.2vw,32px)!important}
  .section-head{gap:10px!important;margin-bottom:22px!important}
  .product-grid,.home-product-panel{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:20px 10px!important}
  .product-meta,.editorial-product-meta{padding-left:1px!important;padding-right:1px!important}
  .product-name,.editorial-product-meta h3{font-size:12.5px!important;line-height:1.35!important}
  .editorial-price,.product-price{font-size:11.5px!important}
  .quick-btn,.editorial-quick{opacity:1!important;transform:none!important}
  .badge,.editorial-badge{font-size:8px!important;padding:5px 7px!important}
  .swatches{gap:5px!important;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}
  .swatch{flex:0 0 auto}

  .photo-category-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .photo-category-tile img,.v12-gem-strip .photo-category-tile img{height:clamp(170px,48vw,220px)!important}
  .v15-gem-carousel .photo-category-tile{flex-basis:78%!important;min-width:78%!important}
  .v15-gem-carousel .gem-image-wrap{height:min(74vw,300px)!important}
  .gem-carousel-arrow{display:none!important}

  .gift-grid,.reassurance-grid{grid-template-columns:1fr!important}
  .birth-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .style-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .story-editorial-copy,.custom-editorial-copy,.story-copy{padding:30px 18px!important}
  .story-editorial-copy h2,.custom-editorial-copy h2,.story-copy h2{font-size:clamp(28px,8vw,40px)!important}
  .story-collage{aspect-ratio:1/1;height:auto!important;min-height:0!important}
  .custom-editorial{margin-bottom:48px!important}
  .custom-editorial-image img{aspect-ratio:1/1!important}

  .page-hero{padding:38px 0 32px!important}
  .page-hero h1{font-size:clamp(34px,10vw,48px)!important}
  .catalog-layout{padding-top:18px!important;gap:18px!important}
  .catalog-toolbar{align-items:flex-start!important;gap:10px!important;flex-wrap:wrap}
  .catalog-toolbar select{width:100%;font-size:16px}
  .chip-row{margin-inline:-14px;padding-inline:14px}

  .product-page{padding-top:18px!important;padding-bottom:58px!important}
  .main-media{border-radius:14px!important}
  .pdp-info h1{font-size:clamp(28px,8vw,38px)!important}
  .pdp-price{font-size:21px!important}
  .option-values{gap:7px!important}
  .metal-choice,.size-choice{min-height:44px;padding:9px 11px!important}
  .benefit-row{grid-template-columns:1fr 1fr!important}

  .form-card{margin:18px 0 48px!important;padding:18px!important;border-radius:16px!important}
  .form-grid{gap:14px!important}
  .field input,.field select,.field textarea,.form-input,input,select,textarea{font-size:16px}
  .cart-item{grid-template-columns:76px minmax(0,1fr)!important;gap:12px!important}
  .cart-item img{width:76px!important;height:76px!important}
  .cart-item>div:last-child{grid-column:2!important}

  .footer-editorial-grid{grid-template-columns:1fr!important;gap:30px!important;padding:42px 0 34px!important}
  .sj-footer-brand,.newsletter-block{grid-column:1!important}
  .editorial-footer-bottom{grid-template-columns:1fr!important;text-align:left!important;gap:7px!important;padding-bottom:calc(18px + env(safe-area-inset-bottom))!important}
  .editorial-footer-bottom span:nth-child(2),.editorial-footer-bottom span:nth-child(3){text-align:left!important}
  .sj-footer-brand-logo{width:96px!important;height:96px!important}
}

/* Small phones */
@media (max-width:480px){
  .container{width:calc(100% - 22px)!important}
  .header-top,.header-main{width:calc(100% - 14px)!important}
  .sj-brand-lockup{gap:6px!important}
  .sj-brand-logo-mini{width:31px!important;height:31px!important;border-radius:8px!important}
  .header-top .sj-brand-lockup .brand-word{font-size:13.5px!important;letter-spacing:.085em!important}
  .header-top .sj-brand-lockup small{font-size:4.8px!important}
  .header-actions .icon-btn{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important}
  .mobile-menu-btn{width:38px!important;height:38px!important}
  .product-grid,.home-product-panel{gap:17px 8px!important}
  .wish-btn,.editorial-heart{width:34px!important;height:34px!important}
  .birth-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px 6px!important}
  .style-grid{grid-template-columns:1fr 1fr!important;gap:12px!important}
  .benefit-row{grid-template-columns:1fr!important}
  .sj-brand-signature-inner{grid-template-columns:56px 1fr!important;gap:12px!important;width:calc(100% - 24px)!important}
  .sj-brand-signature-logo{width:56px!important;height:56px!important}
  .sj-brand-signature-copy strong{font-size:20px!important}
  .sj-brand-signature-copy p{font-size:10px!important}
  .sj-brand-signature-action{grid-column:1/-1!important;width:100%!important}
}

/* Very small phones: avoid two columns becoming unreadable. */
@media (max-width:360px){
  :root{--sj-r-gutter:10px}
  .container{width:calc(100% - 18px)!important}
  .header-top,.header-main{width:calc(100% - 10px)!important}
  .header-top .sj-brand-lockup small{display:none!important}
  .product-grid,.home-product-panel{grid-template-columns:1fr!important;gap:24px!important}
  .product-name,.editorial-product-meta h3{font-size:14px!important}
  .editorial-price,.product-price{font-size:13px!important}
  .photo-category-strip{grid-template-columns:1fr!important}
  .birth-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .style-grid{grid-template-columns:1fr!important}
  .cart-item{grid-template-columns:64px minmax(0,1fr)!important}
  .cart-item img{width:64px!important;height:64px!important}
}

/* Short landscape phones/tablets */
@media (orientation:landscape) and (max-height:560px) and (max-width:980px){
  .sj-hero-slider,.lux-hero,.v12-hero{min-height:100svh!important;height:auto!important}
  .sj-hero-center,.lux-hero-copy{top:56%!important}
  .sj-hero-center h1,.lux-hero-copy h1{font-size:24px!important}
  .sj-hero-actions,.lux-hero-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:520px!important}
  .sj-hero-actions a:last-child:nth-child(3),.lux-hero-actions a:last-child:nth-child(3){grid-column:1/-1}
  .mobile-nav,.mobile-nav-v14{max-height:calc(100dvh - 76px)!important}
}

/* Touch devices: never hide important actions behind hover. */
@media (hover:none),(pointer:coarse){
  .quick-btn,.editorial-quick{opacity:1!important;transform:none!important}
  .product-card:hover .product-photo img,.editorial-product-card:hover img,.three-category-grid>a:hover img{transform:none!important}
  .btn:hover,.sjc-btn:hover{transform:none!important}
}

/* Accessibility / low-motion devices */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
