/* ROOH mobile layout refinement
   Compact the page composition without globally scaling down typography or controls.
   Loaded after the shared site stylesheet so it applies consistently to every route. */

@media (max-width: 800px) {
  html, body { width: 100%; overflow-x: clip; }
  body { font-size: 16px; line-height: 1.6; }

  /* Keep the mobile header and its touch controls comfortable. */
  .header-inner { height: 76px; padding-inline: 16px; gap: 10px; }
  .brand-mark { flex: 0 0 112px; width: 112px; }
  .header-actions { gap: 9px; }
  .menu-toggle, .theme-toggle { width: 42px; height: 42px; min-width: 42px; min-height: 42px; }

  /* More useful hero composition: same readable type, less empty vertical space. */
  .hero {
    min-height: 585px;
    height: auto;
    max-height: 700px;
    align-items: flex-start;
  }
  .hero-content {
    width: min(86%, 610px);
    max-width: 610px;
    padding: 54px 18px 104px;
  }
  .hero h1 {
    max-width: 620px;
    font-size: clamp(47px, 10.5vw, 60px);
    line-height: 1.05;
    margin-bottom: 18px;
  }
  .hero-copy {
    max-width: 440px;
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 20px;
  }
  .hero-actions { gap: 12px 18px; align-items: center; }
  .hero-actions > .btn {
    width: auto;
    min-height: 50px;
    padding: 0 21px;
    font-size: 13px;
    white-space: nowrap;
  }
  .hero-actions > .text-link { font-size: 12px; }
  .hero-note { margin-top: 30px; font-size: 10px; }
  .hero-bottom { padding: 13px 17px; font-size: 9px; }
  .hero-media .hero-image { object-position: 74% center; }
  .hero:after {
    background:
      linear-gradient(90deg, rgba(7,7,7,.96) 0%, rgba(7,7,7,.84) 42%, rgba(7,7,7,.40) 72%, rgba(7,7,7,.16) 100%),
      linear-gradient(0deg, rgba(7,7,7,.50), rgba(7,7,7,.03) 58%);
  }
  html[data-theme="light"] .hero:after {
    background:
      linear-gradient(90deg, rgba(249,244,235,.97) 0%, rgba(249,244,235,.88) 42%, rgba(249,244,235,.44) 72%, rgba(249,244,235,.12) 100%),
      linear-gradient(0deg, rgba(249,244,235,.40), rgba(249,244,235,.03) 58%);
  }
  .hero-side { opacity: .25; right: -12px; bottom: 52px; width: min(58vw, 300px); }

  /* Use width efficiently on every public page. Keep type sizes; trim gutters and gaps. */
  .section { width: 100%; max-width: none; padding: 52px 18px; }
  .category-section { padding-top: 52px; padding-bottom: 48px; }
  .featured-section { padding-top: 48px; }
  .values-section { padding-top: 52px; padding-bottom: 56px; }
  .section-heading { gap: 14px; margin-bottom: 25px; align-items: flex-end; }
  .section-heading h2, .craft-section h2, .custom-intro h2,
  .about-lead h2, .contact-band h2 { font-size: clamp(32px, 7.4vw, 42px); }

  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .category-tile { min-height: 172px; padding: 16px; }
  .category-tile h3 { font-size: 18px; line-height: 1.18; }
  .category-tile span:not(.tile-number):not(.tile-mark) { font-size: 10px; }
  .tile-mark { right: 12px; bottom: 12px; width: 34px; height: 34px; }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .product-image { width: 100%; height: auto; aspect-ratio: 4 / 5; }
  .product-meta { padding-top: 12px; }
  .product-meta h3 { font-size: 17px; line-height: 1.3; }
  .product-price { font-size: 14px; }
  .product-card-actions { gap: 8px; }
  .product-card-action-form { min-width: 0; flex: 1 1 0; }
  .product-card-action-form .btn, .product-card-actions > .btn {
    width: 100%; min-height: 46px; padding: 8px 9px; font-size: 11px;
  }
  .card-link { min-height: 42px; font-size: 10px; }

  .editorial-feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px; padding: 0 18px 46px;
  }
  .editorial-feature { min-height: 225px; }
  .editorial-copy { padding: 18px 15px; }
  .editorial-copy h2 { font-size: clamp(21px, 5.3vw, 28px); }
  .banner-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 25px 18px 0; }
  .promo-banner { min-height: 170px; padding: 16px; }
  .values-grid, .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .values-grid article { padding: 18px 0 0; }
  .values-grid h3 { font-size: 20px; margin: 12px 0 6px; }
  .values-grid p, .review-grid p { font-size: 13px; line-height: 1.6; }

  /* Collection and category pages. */
  .page-hero, .page-hero.compact, .custom-hero, .about-hero {
    padding: 58px 18px 48px;
    text-align: left;
  }
  .page-hero h1, .page-hero.compact h1, .custom-hero h1, .about-hero h1 {
    font-size: clamp(43px, 10vw, 58px);
    line-height: 1.06; margin-bottom: 14px;
  }
  .page-hero > p:not(.eyebrow) { margin-left: 0; margin-right: 0; max-width: 560px; font-size: 15px; line-height: 1.65; }
  .shop-section { padding-top: 28px; }
  .shop-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shop-toolbar .search-field { grid-column: 1 / -1; min-width: 0; }
  .shop-toolbar > .btn { grid-column: 1 / -1; }
  .shop-toolbar select, .shop-toolbar > .btn { width: 100%; min-height: 48px; font-size: 14px; }
  .results-line { margin: 18px 0; font-size: 13px; }
  .breadcrumbs { padding: 18px 18px 0; }

  /* Product, cart and checkout pages. */
  .product-detail { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 22px 18px 0; }
  .gallery-main { width: 100%; height: auto; aspect-ratio: 4 / 5; }
  .product-information { padding-top: 2px; }
  .product-information h1 { font-size: clamp(36px, 8.5vw, 48px); margin-bottom: 14px; }
  .product-description { padding: 16px 0; line-height: 1.7; }
  .product-purchase-panel { padding: 16px; margin: 18px 0 12px; }
  .product-purchase-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-purchase-buttons .btn { min-height: 48px; font-size: 12px; }
  .cart-section { padding-top: 28px; }
  .cart-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cart-row { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; }
  .cart-thumb { height: 88px; }
  .cart-product h3 { font-size: 18px; }
  .cart-summary { position: static; padding: 20px; }
  .checkout-section { width: 100%; }
  .form-panel { padding: 20px; }
  .checkout-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .checkout-form .form-grid .full-span { grid-column: 1 / -1; }
  .checkout-form input, .checkout-form textarea, .checkout-form select,
  .stack-form input, .stack-form textarea, .stack-form select { min-height: 48px; font-size: 15px; }

  /* Content pages, account, authentication and contact. */
  .custom-process { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .process-list article { grid-template-columns: 38px minmax(0, 1fr); gap: 13px; padding: 16px 0; }
  .measurement-panel { padding: 30px 18px; flex-wrap: wrap; gap: 14px; }
  .measurement-panel h2 { font-size: 30px; }
  .about-body { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .contact-page { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .contact-card { min-height: 205px; padding: 18px; }
  .contact-card h2 { font-size: 22px; margin: 17px 0 8px; }
  .contact-band { padding: 28px 18px; gap: 16px; flex-wrap: wrap; }
  .contact-band > div { flex: 1 1 220px; }
  .contact-band .btn { min-height: 50px; }
  .auth-wrap { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .auth-aside { padding: 42px 20px 30px; }
  .auth-aside h1 { font-size: clamp(42px, 9vw, 54px); }
  .auth-panel { width: 100%; max-width: none; padding: 34px 20px 46px; }
  .auth-panel h2 { font-size: 31px; margin-bottom: 22px; }
  .account-section { padding-top: 32px; }
  .account-title { gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .account-title h2 { font-size: 34px; }
  .account-order { padding: 17px; }
  .account-order-top { gap: 10px; }
  .success-page { padding: 64px 18px 76px; }
  .success-page h1 { font-size: clamp(44px, 10vw, 58px); }

  /* Footer stays compact without shrinking link text or touch targets. */
  .site-footer { padding: 38px 18px 18px; }
  .footer-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-bottom: 28px; }
  .footer-brand img { width: 145px; }
  .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .footer-links a { font-size: 13px; }
  .footer-bottom { display: grid; gap: 8px; line-height: 1.5; }

  /* Admin remains readable, but uses less wasted space on the same device. */
  .admin-main { padding: 20px 14px 42px; }
  .admin-card { padding: 18px; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-dashboard-grid, .admin-split, .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .hero { min-height: 565px; }
  .hero-content { width: 88%; padding: 48px 17px 96px; }
  .hero h1 { font-size: clamp(47px, 11.8vw, 56px); }
  .hero-copy { font-size: 15px; }
  .hero-actions { gap: 10px 14px; }
  .hero-actions > .btn { min-height: 50px; padding-inline: 18px; }
  .hero-bottom { padding: 12px 15px; font-size: 8px; }
  .section { padding: 46px 16px; }
  .category-section { padding-top: 48px; padding-bottom: 42px; }
  .featured-section { padding-top: 42px; }
  .section-heading { margin-bottom: 22px; }
  .section-heading h2, .craft-section h2, .custom-intro h2,
  .about-lead h2, .contact-band h2 { font-size: clamp(31px, 8vw, 38px); }
  .category-grid { gap: 9px; }
  .category-tile { min-height: 158px; padding: 14px; }
  .category-tile h3 { font-size: 17px; }
  .tile-number { font-size: 10px; }
  .product-grid { gap: 19px 10px; }
  .product-image { aspect-ratio: 4 / 5; }
  .product-meta h3 { font-size: 16px; }
  .product-card-action-form .btn, .product-card-actions > .btn { font-size: 11px; min-height: 46px; }
  .editorial-feature { min-height: 205px; }
  .editorial-copy { padding: 15px 12px; }
  .editorial-copy h2 { font-size: 22px; }
  .contact-page { gap: 10px; }
  .contact-card { min-height: 190px; padding: 15px; }
  .contact-card h2 { font-size: 20px; }
  .checkout-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .checkout-form .form-grid .full-span { grid-column: auto; }
  .footer-links { gap: 16px; }
  .admin-card { padding: 16px; }
}

@media (max-width: 380px) {
  .hero-content { width: 94%; }
  .hero h1 { font-size: 46px; }
  .category-tile { min-height: 148px; padding: 12px; }
  .category-tile h3 { font-size: 16px; }
  .editorial-feature-row, .banner-strip, .contact-page { grid-template-columns: minmax(0, 1fr); }
  .editorial-feature { min-height: 220px; }
  .cart-row { grid-template-columns: 66px minmax(0, 1fr); }
  .cart-row > strong { grid-column: 2; text-align: left; }
}


@media(max-width:800px){
  .admin-shell{grid-template-columns:minmax(0,1fr)}
  .admin-sidebar{position:relative;min-width:0;padding:12px 14px;border-right:0;border-bottom:1px solid var(--line)}
  .admin-sidebar nav{display:flex;gap:7px;overflow-x:auto;padding:10px 0 3px;scrollbar-width:thin}
  .admin-sidebar nav a{flex:0 0 auto;white-space:nowrap;padding:9px 11px;border:1px solid transparent;border-radius:10px}
  .admin-sidebar-bottom{display:flex;gap:14px;flex-wrap:wrap;margin-top:12px;padding:10px 0 0}
  .admin-main{min-width:0;padding:18px 13px 36px}
  .admin-topbar{align-items:flex-start;gap:10px}
  .admin-topbar h1{font-size:29px}
  .admin-top-actions{gap:9px}
  .catalogue-admin-card,.low-stock-admin-panel{min-width:0}
  .manage-actions form{display:block}
}
@media(max-width:520px){
  .admin-sidebar{padding:10px}
  .admin-sidebar nav a{font-size:11px;min-height:40px}
  .admin-sidebar-bottom a,.admin-sidebar-bottom button{font-size:11px}
  .admin-topbar h1{font-size:25px}
  .admin-top-actions>a{font-size:10px}
  .admin-stats{gap:8px}
  .admin-stats article{padding:13px}
  .admin-stats strong{font-size:29px}
  .admin-card{padding:14px}
  .order-share-actions .btn{white-space:normal;text-align:center;line-height:1.4;padding:11px 14px}
  .success-page{width:100%;max-width:100%;overflow-wrap:anywhere}
}

/* Homepage mobile alignment: keep hero actions and collection heading on the left. */
@media (max-width: 800px) {
  .hero .hero-content .hero-actions {
    width: 100%;
    margin-left: 0 !important;
    padding-left: 0;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }
  .hero .hero-content .hero-actions > a {
    align-self: flex-start !important;
    margin-left: 0 !important;
  }

  .category-section > .section-heading {
    align-items: flex-start !important;
    text-align: left !important;
  }
  .category-section > .section-heading > div {
    align-self: flex-start !important;
    width: 100%;
    margin-left: 0;
    text-align: left !important;
  }
  .category-section > .section-heading > .text-link {
    align-self: flex-start !important;
    margin-left: 0;
  }
}

/* Bring the complete mobile hero copy and actions closer to the scroll divider. */
@media (max-width: 520px) {
  .hero .hero-content {
    transform: translateY(40px);
  }
}


/* Final mobile hero refinement: left-aligned copy and vertically stacked actions. */
@media (max-width: 800px) {
  .hero .hero-content {
    text-align: left !important;
  }
  .hero .hero-content .hero-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    text-align: left !important;
  }
  .hero .hero-content .hero-actions > a {
    align-self: flex-start !important;
    margin: 0 !important;
  }
  .hero .hero-content .hero-actions > .text-link {
    display: inline-flex;
    justify-content: flex-start;
    text-align: left !important;
  }
}

/* Align the secondary rental link with the label inside the primary hero button on mobile. */
@media (max-width: 800px) {
  .hero .hero-content .hero-actions > a.text-link {
    margin-left: 34px !important;
    align-self: flex-start !important;
  }
}
