/* ============================================================
   Entomania – Responsive stylesheet
   Target: Full HD (1920×1080) downward
   ============================================================ */

:root {
    --color-bg:       #D0C9AC;
    --color-white:    #ffffff;
    --color-nav:      #B08B3C;
    --color-green:    #7CA328;
    --color-green-dk: #466209;
    --color-green-btn:#63890F;
    --color-sidebar:  #DCD8BF;
    --color-text:     #000000;
    --color-price:    #9C7B03;
    --color-red:      #BA554D;
    --sidebar-w:      260px;
    --max-w:          1400px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */

.site-wrapper {
    max-width: var(--max-w);
    margin: 0 auto;
    background-color: var(--color-white);
    box-shadow: 0 0 30px rgba(0,0,0,0.25);
}

/* ============================================================
   HEADER BANNER
   ============================================================ */

.site-header {
    border-top: 2px solid #000;
    border-bottom: 1px solid #000;
    overflow: hidden;
    line-height: 0;
}

.site-header img {
    display: block;
    width: 100%;
    height: auto;
}

/* ============================================================
   MAIN NAVIGATION
   ============================================================ */

nav.main-nav {
    display: flex;
    align-items: stretch;
    background-color: var(--color-nav);
    border-bottom: 1px solid rgba(0,0,0,0.35);
    position: relative;
}

/* Hamburger (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 0 18px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

/* Link group */
.nav-links {
    display: flex;
    flex: 1;
}

.nav-links a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    color: #000;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid rgba(0,0,0,0.2);
    transition: background-color .15s, color .15s;
    white-space: nowrap;
}

.nav-links a:last-child { border-right: none; }
.nav-links a:hover     { background-color: rgba(0,0,0,.12); color: #fff; }
.nav-links a.active    { font-weight: bold; color: #fff; }

/* ============================================================
   TWO-COLUMN BODY
   ============================================================ */

.main-layout {
    display: flex;
    min-height: 520px;
}

/* ---- Sidebar ---- */

.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    flex-shrink: 0;
    border-right: 1px solid #000;
    background-color: var(--color-sidebar);
}

/* Image carousel */
.carousel {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #000;
    background-color: #111;
}

.carousel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .75s ease-in-out;
}

.carousel img.active { opacity: 1; }

/* Sidebar section header */
.sidebar-title {
    background-color: var(--color-green);
    color: #fff;
    font-weight: bold;
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 1px solid rgba(0,0,0,.2);
    letter-spacing: .02em;
}

/* Sidebar links */
.sidebar-menu { padding: 6px 0 12px; }

.sidebar-menu a {
    display: block;
    padding: 4px 12px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.7;
    transition: color .12s;
}

.sidebar-menu a:hover { color: var(--color-green-dk); }

.sidebar-spacer { height: 10px; }

/* ---- Main content ---- */

.content {
    flex: 1;
    padding: 24px 30px;
    min-height: 520px;
}

/* ============================================================
   HOME PAGE – news article
   ============================================================ */

.news-butterfly { text-align: center; margin-bottom: 12px; }

.news-title {
    color: var(--color-red);
    font-weight: bold;
    text-align: center;
    font-size: 20px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.news-intro {
    text-align: center;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.8;
}

.news-body {
    line-height: 1.85;
    font-size: 13px;
    overflow: hidden;
}

.news-body img {
    float: left;
    margin: 0 18px 10px 0;
    border: 1px solid #000;
    border-radius: 2px;
}

.news-body p  { margin-bottom: 12px; }
.news-body em { font-style: italic; color: #444; }

.clearfix::after { content: ""; display: table; clear: both; }

/* ============================================================
   INNER PAGES (chi siamo, condizioni, contact)
   ============================================================ */

.page-body {
    padding: 32px 40px;
    min-height: 520px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.page-text          { flex: 1; line-height: 1.85; font-size: 13px; }
.page-text h1       { font-size: 18px; margin-bottom: 18px; }
.page-text p        { margin-bottom: 12px; }
.page-text a        { color: #000; text-decoration: none; font-weight: bold; }
.page-text a:hover  { color: var(--color-green-dk); }

.page-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    flex-shrink: 0;
}

/* ============================================================
   CATALOG PAGE
   ============================================================ */

.cat-section-header {
    grid-column: 1 / -1;
    background-color: var(--color-green);
    color: #fff;
    font-weight: bold;
    padding: 7px 12px;
    font-size: 13px;
    margin-top: 12px;
    border-radius: 2px;
    letter-spacing: .02em;
}

.cat-section-header:first-child { margin-top: 0; }

.cat-subsection-header {
    grid-column: 1 / -1;
    background-color: var(--color-sidebar);
    border-left: 3px solid var(--color-green);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 6px;
    color: #333;
}

.catalog-section { padding: 20px 24px; }

.catalog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ccc;
}

.catalog-filter a {
    padding: 6px 16px;
    background-color: var(--color-sidebar);
    border: 1px solid #000;
    color: #000;
    text-decoration: none;
    font-size: 12px;
    transition: background-color .15s, color .15s;
    border-radius: 2px;
}

.catalog-filter a:hover,
.catalog-filter a.active {
    background-color: var(--color-green);
    color: #fff;
    border-color: var(--color-green-dk);
}

/* Grid: 4 cols on wide desktop */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.product-card {
    border: 1px solid #aaa;
    padding: 12px 10px;
    background-color: #f9f8f4;
    text-align: center;
    position: relative;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
    border-radius: 3px;
}

.product-card:hover {
    background-color: #eae6d0;
    border-color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.product-card .badge       { position: absolute; top: 6px; right: 6px; }
.product-card img.product-img {
    display: block;
    margin: 0 auto 10px;
    width: 100%;
    height: 120px;
    object-fit: contain;
    object-position: center;
}
.product-card h3           { font-size: 12px; font-weight: bold; margin-bottom: 4px; }
.product-card .origin      { font-size: 11px; color: #555; margin-bottom: 8px; }
.product-card .price       { color: var(--color-price); font-weight: bold; font-size: 15px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-back {
    display: inline-block;
    padding: 7px 18px;
    background-color: var(--color-green-btn);
    color: #fff;
    border: 1px solid #000;
    cursor: pointer;
    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
    text-decoration: none;
    border-radius: 2px;
    transition: background-color .15s;
}

.btn-back:hover { background-color: var(--color-green); color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    border-top: 1px solid #000;
    background-color: var(--color-sidebar);
}

.footer-ticker-row {
    display: flex;
    align-items: center;
    height: 38px;
    overflow: hidden;
}

.footer-spacer  { width: 30%; flex-shrink: 0; }

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    height: 26px;
    position: relative;
}

.ticker-text {
    position: absolute;
    white-space: nowrap;
    font-size: 12px;
    line-height: 26px;
    animation: scroll-left 28s linear infinite;
}

@keyframes scroll-left {
    from { transform: translateX(800px); }
    to   { transform: translateX(-100%); }
}

.footer-corner     { width: 10%; text-align: right; flex-shrink: 0; }
.footer-corner img { display: inline-block; vertical-align: bottom; }

.footer-bottom-strip {
    border-top: 1px solid #aaa;
    height: 18px;
    background: url('../immagini/sotto3_04.gif') repeat-x center;
}

.footer-credits {
    text-align: center;
    padding: 10px 0 14px;
    font-size: 12px;
}

.footer-credits a       { color: #000; text-decoration: none; }
.footer-credits a:hover { color: var(--color-green-dk); }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* --- Large desktop (1200px–1400px): keep 4-col grid --- */
@media (max-width: 1200px) {
    :root { --max-w: 100%; --sidebar-w: 240px; }
    .catalog-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Tablet landscape (≤ 1024px) --- */
@media (max-width: 1024px) {
    :root { --sidebar-w: 210px; }
    .content  { padding: 20px 22px; }
    .page-body { padding: 24px 28px; }
    .news-title { font-size: 17px; }
}

/* --- Tablet portrait (≤ 768px) --- */
@media (max-width: 768px) {
    :root { --sidebar-w: 190px; }
    .nav-links a  { font-size: 12px; padding: 10px 6px; }
    .catalog-grid { grid-template-columns: repeat(2, 1fr); }
    .news-title   { font-size: 15px; }
    .page-body    { padding: 20px 20px; }
}

/* --- Mobile (≤ 600px): single-column stack --- */
@media (max-width: 600px) {
    /* Hamburger visible, links hidden by default */
    .nav-toggle { display: flex; align-items: center; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-nav);
        z-index: 200;
        border-top: 1px solid rgba(0,0,0,.25);
        box-shadow: 0 4px 10px rgba(0,0,0,.2);
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,.15);
        text-align: left;
        padding: 12px 20px;
        justify-content: flex-start;
    }

    /* Stack sidebar above content */
    .main-layout { flex-direction: column; }

    .sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #000;
    }

    .sidebar-spacer { height: 4px; }

    .carousel { height: 160px; }

    .content   { padding: 16px 16px; }
    .page-body { flex-direction: column; padding: 16px; }

    .news-body img {
        float: none;
        display: block;
        margin: 0 auto 14px;
        max-width: 100%;
        height: auto;
    }


    .catalog-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .catalog-section { padding: 14px 14px; }

    .footer-spacer { display: none; }
    .ticker-wrapper { flex: 1; }
}

/* --- Very small (≤ 380px) --- */
@media (max-width: 380px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .catalog-filter a { padding: 5px 10px; font-size: 11px; }
}
