/* Shared layout rules (loaded once via mod/meta.jsp) */

#menu_inner {
    display: flex;
    justify-content: flex-end;
    margin-right: 13%;
}

/* logo: big on PC (as in mod/top.jsp), small on mobile */
.logo_box { height: 100px; margin-top: 11px; padding: 0 10px; }
.logo_box img { border: 0; }
.logo-mobile { display: none; }

@media (max-width: 600px) {
    .logo_box { height: auto; margin-top: 0; padding: 3px 10px; }
    .logo-pc { display: none; }
    .logo-mobile { display: inline; }
}

/* category tiles: whole tile clickable via the title link */
.tile { position: relative; cursor: pointer; }
.tile .tile-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* item list tiles (itemManagerm.jsp): 3 per row on PC, 1 on mobile */
.item-tile { width: 100%; max-width: 500px; }
.item-tile-box {
    display: flex;
    align-items: flex-end;
    aspect-ratio: 1 / 1;
    margin: 5px;
    border: 1px solid #c0c0c0;
    border-radius: 8px;
}
.item-tile-title {
    margin: 12px 15px;
    width: 100%;
    padding: 10px 5px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(81,81,81,0.3) 100%);
}
.item-tile-title a { color: #fff; text-decoration: none; text-transform: uppercase; }

/* ===== welcome page (shop/mody/middlePanelm.jsp) ===== */
.wp-main { margin: 0 2%; }
.wp-main *, .wp-main *::before, .wp-main *::after { box-sizing: border-box; }
.wp-main img { max-width: 100%; border: 0; vertical-align: bottom; }

/* section headings */
.wp-section { width: 100%; max-width: 1650px; margin: 5px auto; padding: 20px 0; background: #fff; }
.wp-section-title { padding: 10px 35px; color: #000; font-size: 24px; font-weight: 600; text-transform: uppercase; }

/* bestsellers */
.wp-best { display: flex; justify-content: center; flex-wrap: wrap; gap: 50px; margin: 5px 0; align-items: flex-start; }
.wp-best-box { width: 350px; max-width: 100%; margin: 0; }
.wp-best-img { width: 100%; height: 300px; display: flex; justify-content: center; align-items: flex-start; }
.wp-best-img--bottom { align-items: flex-end; }
.wp-best-body { padding: 20px; background: #000; color: #fff; min-height: 270px; display: flex; flex-direction: column; }
.wp-best-name { font-size: 24px; margin-bottom: 15px; }
.wp-best-name a, .wp-best-name a:link, .wp-best-name a:visited { color: #fff; text-decoration: none; }
.wp-best-desc { font-size: 14px; margin-bottom: 15px; height: 120px; overflow: hidden; }
.wp-btn {
    align-self: flex-start; max-width: 100%;
    padding: 13px 20px; border-radius: 30px; background: #fff; color: #000;
    text-align: center; text-transform: uppercase; font-weight: 600; cursor: pointer;
}

/* category tiles */
.wp-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; max-width: 1550px; margin: 0 auto; }
.wp-tile { width: 100%; max-width: 500px; }
.wp-tile-box {
    display: flex; align-items: flex-end; width: 100%; aspect-ratio: 1 / 1;
    border: 1px solid #c0c0c0; border-radius: 8px; padding: 12px 10px;
}
.wp-tile-title {
    width: 100%; padding: 10px 5px; text-align: center; font-size: 18px; font-weight: 600;
    background: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(81,81,81,0.3) 100%);
}
.wp-tile-title a, .wp-tile-title a:link, .wp-tile-title a:visited { color: #fff; text-decoration: none; text-transform: uppercase; }

/* extras */
.wp-extras { display: flex; justify-content: center; flex-wrap: wrap; gap: 40px; margin: 5px 0; }
.wp-extra {
    display: flex; align-items: center; width: 100%; max-width: 500px;
    background: linear-gradient(100deg, rgba(75,75,107,0.5) 50%, #fff 100%);
}
.wp-extra-title { flex: 1; padding: 10px; text-align: center; font-size: 18px; font-weight: 600; }
.wp-extra-title a, .wp-extra-title a:link, .wp-extra-title a:visited { color: #fff; text-decoration: none; text-transform: uppercase; }
.wp-extra img { height: 250px; width: auto; object-fit: contain; border-radius: 8px; flex-shrink: 1; min-width: 0; }

/* burger hidden on PC, shown only in mobile media query below */
#menuico { display: none !important; }

@media (max-width: 600px) {
    /* menu: hamburger visible, menu hidden until toggled */
    #menuico { display: block !important; }
    #menu_inner { display: none; flex-direction: column; margin-right: 0; }

    /* bestseller boxes stacked */
    #box_outer1 { flex-direction: column; align-items: center; }
    .bracket_box { width: 100% !important; margin: 10px 0 !important; }

    /* hero slider: full width, height scales with banner ratio (2100x700 = 3:1) */
    .hero-slide { width: 100%; overflow: hidden; }
    .hero-slide .hero-image {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 1;
        background-size: cover;
        background-position: center;
    }
    /* welcome page */
    .wp-section-title { font-size: 20px; padding: 10px 15px; }
    .wp-best-img { width: 100%; height: auto; min-height: 200px; }
    .wp-best-body { height: auto; }
    .wp-best-desc { height: 120px; }
    .wp-tiles { gap: 10px; }
    .wp-extras { gap: 10px; }
    .wp-extra img { height: 150px; }

    .hero-slide .columns { position: relative; overflow: hidden; }
    /* text confined to the right third of the banner */
    .hero-slide .hero-text {
        box-sizing: border-box;
        width: 33.333%;
        max-height: 100%;
        left: auto;
        right: 0;
        top: 50%;
        padding: 0 6px;
        transform: translateY(-50%) !important;
        -webkit-transform: translateY(-50%) !important;
        font-size: 10px;
        line-height: 1.25;
        overflow: hidden;
        overflow-wrap: break-word;
        height: auto !important;
    }
}
