/* =============================================================================
   MOBILE RESPONSIVE STYLES
   ============================================================================= */

@media (max-width: 1024px) {

  /* .volume-control restored on mobile as requested */
  .volume-control {
    display: flex !important;
  }

  #cart-button {
    width: 70px;
    height: 70px;
  }

  #checkout-back-img {
    display: none !important;
  }

  #checkout-back-img {
    display: none !important;
  }

}

@media (max-width: 768px) {

  /* 1. Landing Page / Layout */
  .bg {
    position: relative !important;
    /* Anti-Stretch: Dynamic best-fit for 9:20 ratio */
    height: min(100vh, 100dvh, calc(100vw * 17 / 9)) !important;
    aspect-ratio: 9 / 20 !important;

    max-width: 450px !important;
    margin: auto !important;

    /* Cover is now safe because the container is exactly the image ratio */
    background: #000 url('../assets/images/wallmobile.png') center center / cover no-repeat !important;

    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  }

  body {
    overflow: hidden !important;
    background-color: #000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 100vw !important;
  }

  .main-buttons-container {
    position: absolute;
    top: 57%;
    left: 17%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    pointer-events: none;
    width: 60%;
    /* Uses % relative to .bg parent — stays locked to background on all screen sizes */
    transform: none;
  }

  .button-area {
    position: static !important;
    width: 22% !important;
    height: auto;
    pointer-events: auto;
    display: block !important;
    flex-shrink: 0;
  }

  /* Enabling Gallery on mobile */
  #gallery-overlay.visible {
    display: flex !important;
  }

  #gallery-overlay {
    padding-top: 20px;
    overflow-x: hidden !important;
  }

  .overlay-panel {
    overflow-x: hidden !important;
  }

  .product-detail-scroll {
    overflow-x: hidden !important;
  }

  /* Back Button spacing */
  .back-button {
    left: 27px !important;

  }


  .news-banner {
    display: none !important;
    top: calc(5% + env(safe-area-inset-top));
    right: calc(5% + env(safe-area-inset-right));
    width: 48%;
    max-width: 260px;
  }

  .floating-cat {
    display: none;
  }

  /* 2. Shop Overlay */
  .shop-header-panel {
    padding: 25px 15px !important;
  }

  .shop-title {
    font-size: 1.7em;
    letter-spacing: 2px;
  }

  .shop-subtitle {
    font-size: 0.9rem;
    padding: 0 10px;
    margin-bottom: 15px;
  }

  .shop-filter-tags {
    margin-bottom: 15px;
    padding: 0 10px;
  }

  #search-bar {
    height: 50px;
    font-size: 1.1rem;
  }

  .items-container {
    display: block;
    /* Remove grid from wrapper */
    padding: 0;
  }

  .products-grid,
  .designs-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    /* 3 columns for "much smaller" look */
    gap: 80px 10px;
    /* High vertical gap, smaller horizontal */
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    justify-items: center;
  }

  .products-grid {
    padding-bottom: 20px;
  }

  .designs-grid {
    padding-bottom: 200px;
  }

  /* Product detail title: scales fluidly from ~1.1rem (tiny screens) to 1.8rem (wider mobile) */
  .product-info h2 {
    font-size: clamp(1.1rem, 5vw, 1.8rem);
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.2;
  }

  .product-info h2 .design-name {
    font-size: 1em;
    display: inline;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .product-info h2 .product-name {
    font-size: 0.65em;
    margin-left: 6px;
  }

  .shop-item {
    width: 80%;
    margin: 0;
    height: auto;
  }

  .shop-item-image-wrapper {
    height: auto;
    flex: 1;
    scale: 80%;
    margin-bottom: 0px;
  }

  .item-name {
    font-size: 0.9rem;
    margin-top: 10px;
  }

  .design-nav-arrow.next {
    right: -50px;
  }

  .design-nav-arrow.prev {
    left: -50px;
  }

  .design-preorder-overlay {

    padding-top: 36%;
  }

  .preorder-custom-dropdown .dropdown-trigger {

    line-height: 2.4;
  }

  .dropdown-option-item {
    padding: 10px 16px;
  }

  /* 3. Overlays & Close Button */
  .close-overlay {
    width: 48px !important;
    /* Larger X */
    height: 48px !important;
    right: 20px !important;
    background: rgba(255, 0, 0, 0.2);
    /* Subtle background for visibility */
    border-radius: 6px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .option-group-label {
    margin-right: 15px;
    min-width: 40px;
  }

  .toggle-option.selected {

    transform: none;
  }

  .toggle-switch {
    display: flex;
    gap: 10px;
    flex-direction: row;
  }

  /* Centered and Aligned Options Styles */
  .product-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    gap: 15px;
    margin-right: 20px;
    margin-left: 20px;
  }

  .toggle-option {
    padding: 6px 8px;
  }

  .option-group {
    /* display: grid !important; */
    grid-template-columns: 85px 1fr !important;
    align-items: center !important;
    /* gap: 15px !important; */
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 auto !important;
    padding: 10px 0 !important;
  }

  .toggle-switch {
    justify-content: flex-start !important;
  }

  .design-product-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin: 8px 0 10px 0;
    max-width: 95%;
  }


  #product-detail-content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0;
    padding-bottom: 30px;
  }

  .product-detail-upper-panel {
    width: 96%;
    margin-top: -20px;
    border-radius: 0 0 20px 20px !important;
  }

  .product-detail-upper-panel.detail-view::before {
    display: none !important;
  }

  .product-images {
    background: url('https://res.cloudinary.com/dskue3561/image/upload/f_auto,q_auto/v1775044159/worktable_jgy6wg.png') center top / cover no-repeat;
    margin: -15px -15px 0 -15px;
    padding: 80px 15px 50px 15px;
    height: 400px;
    justify-content: center;

    position: relative;
    background-clip: padding-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    perspective: 1200px;
    width: auto;
    /* Reset to auto since we added margins */
  }

  .main-image-wrapper {
    margin-top: 0;
    margin-left: 0;
    width: 100%;
    /* Override desktop -60px */
    transform-style: preserve-3d;
  }

  .product-images .main-image {
    max-width: 260px;
    max-height: 260px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  }

  .product-info {
    text-align: center;
    min-height: 480px;
  }

  .product-info h2 {
    font-size: 1.5em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    scale: 1.3;
    margin: 0 0 30px;
  }

  .product-info .description {

    margin-left: 12px;
  }

  #product-detail-title .design-rank-stars {
    margin: 0;
  }

  .lock-icon {
    width: 35px;

  }

  .unlock-text {

    font-size: 0.7rem;

  }

  /* 4. Designs Grid */
  .designs-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .design-search-wrap {
    flex-direction: column;
    gap: 12px;
  }

  #product-design-container {
    width: 100% !important;
    padding: 15px 10px !important;
    margin: 0 !important;
  }




  .design-search-input-container {
    max-width: none;
    margin-bottom: 20px;
  }

  .design-search-input {
    height: 48px;
    font-size: 1rem;
  }


  .design-options-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 80px 10px !important;
    width: 100% !important;
    padding-bottom: 60px;

  }

  .design-option {
    display: flex;
    flex-direction: column;
    min-height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    max-width: 160px;
    margin: 0 auto;
  }

  .design-card-name {
    font-size: 0.75rem !important;
    /* Slightly larger to prevent sub-pixel blurring */
    padding-bottom: 1px !important;
    display: block !important;
    color: var(--color-white) !important;
    text-decoration: none !important;
    line-height: 1.1 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translateZ(0);
    /* Force GPU rendering to fix artifacts */
    backface-visibility: hidden;
  }

  .design-card-info {
    padding: 10px 8px 10px !important;
    /* Tighter padding */
    border-radius: 0px 0px 12px 12px !important;
    backdrop-filter: blur(12px) !important;
    background: rgba(20, 20, 24, 0.9) !important;
    /* More solid background for text readability */
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-top: none !important;
    transform: translateZ(0);
  }

  .design-name-stars {
    padding-bottom: 3px !important;
  }

  .design-price-tag {
    font-size: 0.7rem !important;
    /* Smaller price */
    padding: 2px 6px !important;
    border-radius: 8px !important;
  }

  .design-product-tag {
    font-size: 0.5rem !important;
    padding: 2px 4px !important;
    border-radius: 5px !important;
  }

  .design-rank-stars {
    font-size: 0.65rem !important;
    /* Slightly larger for stable glyph rendering */
    margin-top: 1px !important;
    line-height: 1 !important;
    display: flex !important;
    gap: 1px !important;
    justify-content: center !important;
    vertical-align: middle !important;
  }

  .design-image-container {
    padding: 8px !important;
    margin-bottom: 0px !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent) !important;
    backdrop-filter: blur(8px) !important;
    border: none !important;
    border-radius: 12px 12px 0 0 !important;
  }

  .design-image-container img.design-image {
    max-width: 140px !important;
    max-height: 140px !important;
  }

  /* Remove flicker-prone animations and filters on mobile/tablet */
  .design-star,
  [class*="rank-"] {
    animation: none !important;
    filter: none !important;
    text-shadow: none !important;
    transition: none !important;
  }

  .preorder-main-btn {

    padding: 12px 24px;

  }

  /* Specifically hide shine effects that glitch on touch */
  .toggle-option.selected::after,
  .shop-filter-tag.active::after,
  .design-filter-tag.active::after {
    display: none !important;
    animation: none !important;
  }

  /* Ensure button-area stays static and visible */
  .button-area {
    width: 13%;
    position: absolute;
    display: block !important;
  }

  #checkout-title {
    font-size: 0.9rem !important;
    text-transform: none !important;
    letter-spacing: 1px !important;
  }

  #cart-overlay.checkout-active #cart-header-summary {
    scale: 0.8;
  }

  .cart-header {
    height: 90px;
    flex-shrink: 0;
    display: flex;
    width: 100%;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 200;
    background: rgba(0, 0, 0, 0.4);
    gap: 0px;
    padding: 0 20px;
  }


  .design-info-banner .design-rank-stars {
    margin: 0;
    position: absolute;
    bottom: -6px;
    left: 50% !important;
    transform: translateX(-50%) scale(1.3);
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    z-index: 5;
    pointer-events: none;
  }

  .envelope-wrapper {
    position: absolute;
    width: 90%;
    max-width: 450px;
    margin: 0 auto;
    aspect-ratio: 1 / 1.1;
    filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.7));
    transition: all 0.3s ease;
    z-index: 999;
    overflow: hidden;
    container-type: inline-size;
    opacity: 0;
    transform: translateY(80px);
    padding-bottom: 10%;
  }

  .checkout-actions-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    padding-bottom: 140px;
    background: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
  }

  .design-star {
    font-size: 0.9rem !important;
    /* Even smaller stars for better fit */
  }

  /* 5. Cart & Footer */
  #product-detail-footer,
  .cart-footer {
    padding: 12px 10px;
  }

  .footer-price,
  .cart-total {
    font-size: 1.3em;
    margin-right: 10px;
  }

  .add-to-cart-btn {
    padding: 10px 15px;
    font-size: 0.85em;
  }

  .cart-view {
    padding: 15px;
    overflow-x: hidden;
  }

  .cart-item {
    padding: 1px;
    gap: 12px;
    padding-left: 50px;
  }

  .cart-item {
    position: relative;
    display: flex;
    margin-bottom: 5px;
    margin-left: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--color-white);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    min-height: 130px;
    max-height: 130px;
    scale: 0.96;
    align-items: center;
  }

  #cart-items-container {
    width: 100%;
    max-width: 1400px;
    margin-top: 50px;
    padding: 1px;
    display: grid;
    gap: 20px 25px;
    /* overflow-y: auto; */
    flex: 1;
    align-content: start;
    scale: 0.96;
  }

  .cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scale: 0.9;

  }

  .cart-item-image {
    width: 100px;
    height: 100px;
  }

  .cart-item-info h4 {
    font-size: 0.95rem;
  }

  .qty-controls {
    gap: 8px;
  }

  .design-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    margin: 0px;
  }

  /* Disable edge closing zones on mobile */
  .side-back-edge {
    display: none !important;
  }

  .gallery-section {
    margin-bottom: 50px;
    transition: opacity 0.8s ease, transform 0.8s ease;
    opacity: 0.2;
    transform: scale(0.98);
    padding: 50px;
    padding-top: 70px;
  }

  .amazon-disclaimer {
    display: inline-block;
    font-family: 'Nunito Sans', sans-serif;
    color: #878787;
    text-align: center;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 20px;
    margin-top: 10px;
    font-size: 0.8em;
    max-width: 300px;
  }

  .cart-item-price {
    font-size: 1rem
  }

  .tools-title {

    font-size: 1.8em;

  }

  .tool-price-tag {
    display: block;
    width: 100%;
    text-align: center;
    color: #8bc239;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    padding: 10px;
  }

  .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    background: #000000a4;
    /* padding: 15px; */
    /* border-radius: 12px; */
    padding: 10px;
    border-radius: 30px;
  }

  .tool-icon {

    width: 150px;
    height: 150px;

  }

  .tool-top-row {
    display: flex;
    gap: 20px;
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .tool-name {
    display: block;
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 4px;
    font-size: 1rem;
    justify-self: center;
  }

  .tool-desc {
    padding: 10px;
  }


  .bottom-right-controls {
    position: absolute;
    right: calc(2% + env(safe-area-inset-right));
    bottom: calc(4% + env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .overlay-nav-toggle {
    position: absolute !important;
  }

  .product-detail-upper-panel.detail-view::before {
    background-image: url('https://res.cloudinary.com/dskue3561/image/upload/f_auto,q_auto/v1775043876/worktable_bjnjky.png');
    width: 100%;
    height: 100%;
    inset: 0;
    opacity: 1;
    z-index: 0;
  }

  .main-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70%;
    max-width: 350px;

    aspect-ratio: 1 / 1;
    border-radius: 0;
    overflow: visible;
    transition: all 0.3s ease;
  }

  .product-detail-upper-panel.detail-view {
    position: relative;
    background: linear-gradient(180deg, #0a0a0a 20%, #1c1c1c 100%);
    border: 1px solid rgba(255, 215, 0, 0.25);
    /* border-top: none; */
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
    min-height: 520px;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    overflow: hidden;
    padding: 10px;
  }

  .shop-actions-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 15px;
    justify-content: center;
  }

  .design-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding-bottom: 20px;
  }

  .design-search-controls {
    display: flex;
    gap: 16px;
    flex: 1;
    max-width: 550px;
    flex-direction: column-reverse;
    align-items: stretch;
    scale: 1.2;
  }

  .design-search-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin: 0 auto 32px auto;
    max-width: 1000px;
    width: 100%;
    flex-direction: column;
  }

  .cart-item-image {
    left: -30px;

  }

  .cart-badge {
    top: -12px;
    right: 15px;
  }

  #cart-button {
    width: 70px;
    height: 70px;
  }

  .cart-wrapper {
    right: 6px;
  }

  .archive-badge {
    top: -12px;
  }

  .volume-control {
    bottom: 4%;
    scale: 1.5
  }

  .gallery-filter-header {
    /* padding: 20px 40px; */
    /* display: flex; */
    position: absolute;
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    /* align-items: center; */
  }

  .gallery-back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #fff;
    padding: 10px 10px;
    border-radius: 15px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    text-transform: unset;
  }

}

/* Extra small devices */
@media (max-width: 380px) {
  .bg {
    background-size: contain !important;
    background-position: center center !important;
  }

  .cart-item {
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 30px 15px 30px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  .cart-item-image {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 120px !important;
    height: 120px !important;
    margin: 0 auto !important;
    z-index: 10 !important;
  }

  .cart-item-header {
    display: ruby;
    /* flex-direction: column !important; */
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
    margin-bottom: 8px !important;
  }

  .cart-item .design-rank-stars {
    order: 1 !important;
    justify-content: center !important;
    margin: 0 !important;
    transform: scale(0.9) !important;
  }

  .cart-item-title {
    order: 2 !important;
    font-size: 1.1rem !important;
    margin-bottom: 5px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  .cart-item-details {
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    scale: 1 !important;
  }

  .cart-item-footer {
    flex-direction: column-reverse;
    gap: 12px !important;
    width: 100% !important;
    margin-top: 10px !important;
    display: flex;
    flex-wrap: wrap;
  }

  .cart-item-controls {
    justify-content: center !important;
    width: 100% !important;
    gap: 15px !important;
  }

  .cart-item-price {
    font-family: var(--font-title);
    font-size: 1.2rem !important;
    color: var(--color-gold);
    font-weight: bold;
    margin-top: 0 !important;
    background: rgba(255, 215, 0, 0.1);
    padding: 4px 12px;
    border-radius: 10px;
    width: fit-content;
  }

  .qty-controls {
    justify-content: center !important;
    width: 100% !important;
  }

  .cart-view {
    padding: 5px;
  }

  #cart-items-container {
    margin: 5px;
    margin-top: 80px !important;
    gap: 15px !important;
  }

  .footer-price,
  .cart-total {
    font-size: 1.1em;
  }

  /* Shrink gallery lightbox content to leave space for arrows */
  .lightbox-content {
    max-width: 80vw !important;
  }

  .lightbox-video,
  .lightbox-image {
    max-width: 100% !important;
    max-height: 80vh !important;
  }

  /* .main-buttons-container inherits from @media (max-width: 768px) — no override needed */

  .checkout-actions-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    padding-bottom: 180px;
    background: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
  }


  .home-toggle,
  .faq-toggle {
    position: absolute;

  }

  .bottom-right-controls {
    position: absolute;

  }

  .volume-control {
    position: absolute;
    left: 4%;
  }


}



@media (min-width: 430px) and (max-width: 768px) {
  .checkout-actions-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px;
    padding-bottom: 60px;
    background: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
  }

  .product-info .description,
  .product-info .details {
    margin-right: 20px;
    margin-left: 20px;
  }

  .product-info .description {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
    white-space: pre-wrap;
    padding: 12px 16px;
    background: rgb(255 215 0 / 4%);
    /* border-left: 3px solid var(--color-gold); */
    /* border-radius: 6px; */
    text-align: left;
    margin: 16px;
    margin-bottom: 30px;
  }



}


@media (max-width: 930px) and (max-height: 1280px) {

  .close-overlay {
    right: 2%;
    width: 5%;
    z-index: 999;
  }

  /* Compact Toasts on Mobile */
  .toast-stack {
    top: 15px;
    right: 15px;
    gap: 8px;
    width: min(300px, calc(100vw - 30px));
    z-index: 100000;
  }

  .toast {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 12px;
  }

  .toast__title {
    font-size: 0.85rem;
    margin-bottom: 2px;
  }

  .toast__message {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .toast__close {
    min-width: 24px;
    min-height: 24px;
    font-size: 0.9rem;
  }
}

@media (max-width: 1280px) and (max-height: 930px) {


  .shop-header-panel {
    padding-top: 70px !important;
    padding-bottom: 40px !important;
  }

  #detail-nav-toggle {

    left: 2.5%;
    top: 6%;
    scale: 0.9;
    z-index: 999;
  }

  .back-button {
    display: none !important;
  }

  .close-overlay {
    right: 3%;
    top: 6%;
    width: 4%;
    z-index: 999;
    will-change: transform, opacity;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
  }

  .cart-header {
    margin-top: 2%;
  }


}

@media (min-width: 257px) and (max-width: 368px) {
  .bg {
    position: relative !important;
    height: min(100vh, 100dvh, calc(70vw * 24 / 9)) !important;
    aspect-ratio: 9 / 20 !important;

  }



}

/* main-buttons-container no longer needs per-breakpoint left overrides.
   It is absolutely positioned inside .bg (position:relative) using %,
   so it automatically follows the background at any screen size. */

/* Narrow + short screens: switch from space-between to center+gap
   so buttons stay compact as they shrink (space-between would spread them) */
@media (max-width: 380px) and (max-height: 600px) {
  .main-buttons-container {
    justify-content: center;
    gap: 3%;
  }

  .button-area {
    width: 16% !important;
  }
}

@media (max-width: 380px) and (max-height: 450px) {
  .main-buttons-container {
    justify-content: center;
    gap: 2%;
  }

  .button-area {
    width: 13% !important;
  }
}