/* Shop / Yard maps modal + Shop tile launcher.
 * Extracted from public/index.html — see Specs/44_frontend-modularizacion.md. */

        .shop-modal { display: none; position: fixed; inset: 0; z-index: 9000;
            background: rgba(0,0,0,0.6); align-items: center; justify-content: center; }
        .shop-modal.active { display: flex; }
        .shop-modal-content {
            background: #F5F5F2; border-radius: 2px; width: 95vw; height: 92vh;
            display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
            overflow: hidden;
        }
        .shop-modal-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 18px; border-bottom: 1px solid #E2E2DC; background: white;
        }
        .shop-modal-title { font-size: 16px; font-weight: 700; color: #005B3A; }
        .shop-modal-close {
            background: none; border: none; font-size: 24px; color: #6E6E68;
            cursor: pointer; padding: 0 6px; line-height: 1;
        }
        .shop-modal-close:hover { color: #A32D2D; }
        .shop-tabs {
            display: flex; gap: 4px; padding: 6px 14px 0; background: white;
            border-bottom: 1px solid #E2E2DC;
        }
        .shop-tab {
            padding: 8px 16px; border: none; background: #F1EFE8; cursor: pointer;
            font-size: 13px; font-weight: 600; color: #6E6E68;
            border-radius: 2px 6px 0 0; border-bottom: 3px solid transparent;
        }
        .shop-tab.active { background: white; color: #005B3A; border-bottom-color: #005B3A; }
        .shop-tab:hover { color: #005B3A; }
        .shop-controls {
            display: flex; align-items: center; gap: 8px; padding: 8px 14px;
            background: white; border-bottom: 1px solid #E2E2DC;
        }
        .shop-ctl-btn {
            padding: 5px 10px; border: 1px solid #C9C9C0; background: white;
            border-radius: 2px; cursor: pointer; font-size: 12px; font-weight: 600;
            color: #37352F;
        }
        .shop-ctl-btn:hover { background: #F1EFE8; }
        .shop-ctl-info { font-size: 12px; color: #6E6E68; margin-left: auto; }
        .shop-svg-stage {
            flex: 1; position: relative; background: #37352F; overflow: hidden;
        }
        .shop-svg-wrap {
            width: 100%; height: 100%; background: #F5F2EA; overflow: hidden; cursor: grab;
            position: absolute; inset: 0;
        }
        .shop-svg-wrap.dragging { cursor: grabbing; }
        .shop-map-loader {
            position: absolute;
            inset: 0;
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #F5F2EA;
            pointer-events: none;
        }
        .shop-map-loader[hidden] { display: none !important; }
        .shop-map-loader .ras-loader-panel {
            min-height: 0;
            padding: 0;
        }
        .shop-svg { width: 100%; height: 100%; display: block; user-select: none; }
        [data-map-id]:not(.active) { display: none; }
        .shop-svg text { font-family: 'Helvetica Neue', Arial, sans-serif; }
        .shop-machines-wrap {
            width: 100%; height: 100%; position: absolute; inset: 0;
            overflow: hidden; background: #F5F5F2;
        }
        .shop-machines-panel {
            height: 100%; overflow: auto; padding: 16px 18px 24px;
            font-size: 13px; color: #37352F;
        }

        /* ---- Shop launcher ----
           Shop used to drop straight into the Yard Map with the other four
           features hidden behind tabs. It now opens on a grid of square tiles
           so everything under Shop is visible at once; picking one swaps the
           modal into that feature and a Back button returns here. */
        .shop-menu {
            flex: 1;
            overflow: auto;
            padding: 24px;
            background: #F5F5F2;
        }
        /* auto-FILL, not auto-fit. auto-fit collapses the tracks it doesn't
           fill, so a one-tile menu like Site handed its single tile the whole
           1290px row — and with aspect-ratio 1/1 that became a 1290px square.
           auto-fill keeps the empty tracks at their share of the width, so
           tiles stay tile-sized and pack from the top-left however many there
           are. Raising the old 900px cap is what widened the grid; that part
           was never about fit vs fill. */
        .shop-menu-grid {
            display: grid;
            /* 160, not the old 200: Shop went from 7 tiles to 16 when logistics
               moved in, and at 200 the first band alone filled the viewport. */
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            justify-content: start;
            align-content: start;
            gap: 16px;
            max-width: 1400px;
            margin: 0 auto;
        }
        .shop-menu-tile {
            aspect-ratio: 1 / 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            background: white;
            border: 1px solid rgba(31, 31, 28, 0.08);
            border-left: 3px solid #005B3A;
            border-radius: 2px;
            box-shadow: 0 1px 2px rgba(31, 31, 28, 0.04);
            cursor: pointer;
            font-family: inherit;
            padding: 16px;
            text-align: center;
            transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
        }
        .shop-menu-tile:hover {
            box-shadow: 0 6px 18px rgba(0, 91, 58, 0.14);
            transform: translateY(-2px);
        }
        .shop-menu-tile-icon {
            width: 42px; height: 42px;
            display: inline-flex; align-items: center; justify-content: center;
            border-radius: 2px;
            background: linear-gradient(135deg, #00935F, #005B3A);
            color: white;
            box-shadow: 0 3px 8px rgba(0, 91, 58, 0.28);
        }
        .shop-menu-tile-name {
            font-size: 13.5px; font-weight: 700; color: #1d1d1f; line-height: 1.25;
        }
        .shop-menu-tile-desc {
            font-size: 11px; color: #6E6E68; line-height: 1.3;
        }
        .shop-back-btn {
            display: none;
            align-items: center; gap: 6px;
            background: transparent; border: 1px solid #005B3A; color: #005B3A;
            padding: 5px 12px; border-radius: 2px; font-size: 12px; font-weight: 600;
            cursor: pointer; font-family: inherit; margin-right: 12px;
        }
        .shop-back-btn:hover { background: #E6F1ED; }
        /* Feature view active -> show Back, hide the launcher grid. */
        #shopMapModal.shop-in-feature .shop-back-btn { display: inline-flex; }
        #shopMapModal:not(.shop-in-feature) .shop-tabs,
        #shopMapModal:not(.shop-in-feature) .shop-controls,
        #shopMapModal:not(.shop-in-feature) .shop-svg-stage { display: none; }
        #shopMapModal.shop-in-feature .shop-menu { display: none; }

        @media (max-width: 768px) {
            .shop-menu { padding: 14px; }
            .shop-menu-grid {
                grid-template-columns: 1fr 1fr;
                gap: 10px;
            }
            .shop-menu-tile { gap: 6px; padding: 10px; }
            .shop-menu-tile-icon { width: 36px; height: 36px; }
            .shop-menu-tile-icon svg { width: 22px; height: 22px; }
            .shop-menu-tile-name { font-size: 12.5px; }
            .shop-menu-tile-desc { font-size: 10px; }
            .shop-modal-content { width: 100vw; height: 100vh; }
            /* Site opens the same launcher as Shop now, so it gets the same
               full-screen treatment on a phone instead of a floating card. */
            .launcher-content { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
            .launcher-section + .launcher-section { margin-top: 16px; }
        }
