/* ==================================== */
/* 1. Generics & Variables              */
/* ==================================== */
:root {

    color-scheme: light dark;

    --color-primary: #8B4513;
    --color-secondary: #D2B48C;
    --color-text: #333;
    --color-light: #f4f4f4;
    --color-light-body: #f4f4f4;
    --color-light-handcraft-bg: #f4f4f4;
    --color-dark: #1a1a1a;
    --color-dark-footer: #1a1a1a;
    --color-dark-player: #1a1a1a;
    --color-track-title: #f5eee7;
    --color-white: #ffffff;
    --color-white-hero: #ffffff;
    --color-white-products: #ffffff;
    --color-gray: gray;
    --color-dark-transparent: rgba(0, 0, 0, 0.95);
    --color-black-overlay: rgba(0, 0, 0, 0.5);
    --color-black-overlay-hero: rgba(0, 0, 0, 0.5);
    --color-black-overlay-darker: rgba(0, 0, 0, 0.6);
    --color-player-bg: rgba(255, 255, 255, 0.9);
    --color-player-bg-darker: rgba(255, 255, 255, 0.95);
    --color-light-gray: #ccc;
    --color-dark-gray: #aaa;
    --color-text-darker: #555;
    --color-overlay-light: rgba(0, 0, 0, 0.4);
    --color-shadow-light: rgba(0, 0, 0, 0.05);
    --color-shadow-medium: rgba(0, 0, 0, 0.1);
    --color-shadow-dark: rgba(0, 0, 0, 0.2);
    --color-shade: #666;
    --color-dark-primary: #A0522D;
    --color-player-text: rgba(255, 255, 255, 0.7);
    --color-player-progress-bg: #333;
    --color-player-shadow: rgba(0, 0, 0, 0.2);
    --color-footer-border: rgba(255, 255, 255, 0.1);
    --color-modal-close: #aaa;
    --color-modal-close-hover: #000;
    --color-mobile-submenu-bg: rgba(0, 0, 0, 0.2);

    --font-heading: 'Fragment Mono', 'Cormorant Garamond', serif;
    --font-body: 'Fragment Mono', 'Inter', sans-serif;
    --font-mono: 'Fragment Mono', monospace;
    --header-height: 80px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #8B4513;
        --color-secondary: #D2B48C;
        --color-text: #E0E0E0;
        --color-light: #202020;
        --color-light-body: #1b1b1b;
        --color-light-handcraft-bg: #1b1b1b;
        --color-dark: #f5eee7;
        --color-dark-footer: #1a1a1a;
        --color-dark-player: #1a1a1a;
        --color-track-title: #f5eee7;
        --color-white: #1A1A1A;
        --color-white-hero: #f5eee7;
        --color-white-products: #161616;
        --color-gray: darkgray;
        --color-dark-transparent: rgba(255, 255, 255, 0.1);
        --color-black-overlay: rgba(0, 0, 0, 0.7);
        --color-black-overlay-hero: rgba(1, 1, 1, 0.7);
        --color-black-overlay-darker: rgba(0, 0, 0, 0.9);
        --color-player-bg: rgba(26, 26, 26, 0.9);
        --color-player-bg-darker: rgba(26, 26, 26, 0.95);
        --color-light-gray: #333333;
        --color-dark-gray: #444444;
        --color-text-darker: #AAAAAA;
        --color-overlay-light: rgba(255, 255, 255, 0.1);
        --color-shadow-light: rgba(0, 0, 0, 0.5); 
        --color-shadow-medium: rgba(0, 0, 0, 0.7);
        --color-shadow-dark: rgba(0, 0, 0, 0.8);
        --color-shade: #999999;
        --color-dark-primary: #A0522D;
        --color-player-text: rgba(255, 255, 255, 0.7);
        --color-player-progress-bg: #666666;
        --color-player-shadow: rgba(0, 0, 0, 0.5);
        --color-footer-border: rgba(255, 255, 255, 0.1);
        --color-modal-close: #E0E0E0;
        --color-modal-close-hover: #FFFFFF;
        --color-mobile-submenu-bg: rgba(255, 255, 255, 0.1);
    }
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-light-body);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    text-transform: uppercase;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; margin-bottom: 2rem; }
h3 { font-size: 1.75rem; }

a {
    text-decoration: none;
    color: var(--color-primary);
}

.mono-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 1px;
}


/* ==================================== */
/* 2. Buttons & Tags                    */
/* ==================================== */
.btn {
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: inline-block;
}

.btn.primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn.primary:hover {
    background-color: var(--color-dark-primary);
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: transparent;
    color: var(--color-dark);
    border: 2px solid var(--color-dark);
}

.btn.secondary:hover {
    background-color: var(--color-dark);
    color: var(--color-light);
    transform: translateY(-2px);
}

.btn.tertiary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn.tertiary:hover {
    background-color: var(--color-primary);
    color: var(--color-light);
    transform: translateY(-2px);
}

.tag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-white);
    background-color: var(--tag-color, var(--color-gray));
    border-radius: 3px;
    z-index: 10;
}

.disabled-style {
    pointer-events: none;
    cursor: default;
    opacity: 0.6;
    background-color: var(--color-light-gray);
    border: 1px solid var(--color-dark-gray);
    color: var(--color-text-darker);
}


/* ==================================== */
/* 3. Header & Navigation               */
/* ==================================== */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--color-player-bg);
    backdrop-filter: blur(5px);
    z-index: 100;
    box-shadow: 0 2px 5px var(--color-shadow-medium);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.nav-menu {
    list-style: none;
    display: flex;
}

.nav-menu li {
    padding: 0 15px;
    position: relative;
}

.nav-menu a {
    color: var(--color-dark);
    font-weight: 400;
    padding: 5px 0;
}

.nav-menu a:hover {
    color: var(--color-primary);
}

/* Desktop Dropdown */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--color-player-bg-darker);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px var(--color-shadow-dark);
    z-index: 1;
    list-style: none;
    top: 100%;
    margin-top: 0;
    border-top: 15px solid transparent;
    background-clip: padding-box;
}

.dropdown-content li { padding: 0; }
.dropdown-content a { padding: 8px 16px; display: block; }
.dropdown:hover .dropdown-content { display: block; }

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    padding: 0;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--color-dark);
    transition: all 0.3s linear;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
}


/* ==================================== */
/* 4. Hero Section                      */
/* ==================================== */
.hero-section {
    position: relative;
    height: 100vh;
    background: url(./images/hero-bg.jpg) no-repeat center center/cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--color-white);
    margin-top: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--color-black-overlay-hero);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--color-white-hero);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-content p {
    color: var(--color-white-hero);
}

.hero-content .slogan {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
}


/* ==================================== */
/* 5. Product Grid                      */
/* ==================================== */
section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.products-section { 
    background-color: var(--color-white-products); 
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.product-info h3 {
    font-size: 1.2rem;
}

.product-card {
    background-color: var(--color-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px var(--color-shadow-light);
    text-align: left;
    transition: transform 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--color-shadow-medium);
}

.product-image-wrapper { position: relative; overflow: hidden; }

.product-image-wrapper img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.product-card:hover .product-image-wrapper img { transform: scale(1.05); }

.product-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--color-overlay-light);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-overlay { opacity: 1; }

section ul, .modal-content ul {
    padding-left: 2rem;
    margin-bottom: 1rem;
    list-style-position: outside;
}

section li, .modal-content li {
    margin-bottom: 0.5rem;
}

.play-demo {
    background-color: var(--color-light);
    color: var(--color-primary);
    border-radius: 4px;
    padding: 12px 25px;
    font-size: 1rem;
    text-transform: none;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    text-transform: uppercase;

}

.play-demo:hover { background-color: var(--color-secondary); }

.product-info { padding: 20px; }
.product-info .caption {
    font-size: 0.9rem;
    color: var(--color-shade);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}
.product-info .requirements {
    font-size: 0.7rem;
    color: var(--color-shade);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}

.product-actions { display: flex; gap: 10px; margin-top: 15px; }

/* ==================================== */
/* 6. Handcraft Section (Modern)        */
/* ==================================== */
.handcraft-section-modern {
    padding: 100px 20px;
    background-color: var(--color-light-handcraft-bg);
    text-align: center;
}

.handcraft-intro {
    margin-bottom: 60px;
}

.handcraft-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
    max-width: 1000px;
    margin: 0 auto;
}

.handcraft-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}

.handcraft-row:nth-child(1) { animation-delay: 0.1s; }
.handcraft-row:nth-child(2) { animation-delay: 0.3s; }
.handcraft-row:nth-child(3) { animation-delay: 0.5s; }

.sticky-image {
    position: relative;
    top: 0;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--color-shadow-medium);
    transition: transform 0.1s ease-out;
}

.sticky-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scroll-text {
    background: var(--color-player-bg);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 5px 20px var(--color-shadow-light);
}

.step-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 3rem;
    color: var(--color-primary);
    opacity: 0.3;
    margin-bottom: -10px;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}


/* ==================================== */
/* 7. Footer                            */
/* ==================================== */
footer {
    background-color: var(--color-dark-footer);
    color: var(--color-light);
    padding: 60px 20px 100px;
    font-size: 0.9rem;
}

.footer-email {
    display: block;
    color: #8e4e1d;
    font-family: 'Fragment Mono', monospace;
    font-size: 0.9rem;
    text-decoration: none;
}

.footer-email:hover {
    opacity: 0.8; /* Effetto al passaggio del mouse */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 50px;
}

.footer-block { 
    text-align: center; 
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
}

.footer-content h4 {
    color: var(--color-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-contact-btn {
    display: inline-block;
    margin-bottom: 15px;
}

.footer-cookie-controls button {
    display: block;
    margin: 5px auto;
    color: var(--color-secondary);
    border: 1px solid var(--color-secondary);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.85rem;
    width: 200px;
    background: transparent;
    cursor: pointer;
}

.footer-cookie-controls button:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.copyright {
    border-top: 1px solid var(--color-footer-border);
    padding-top: 15px;
    text-align: center;
    color: var(--color-secondary);
}


/* ==================================== */
/* 8. Audio Player & Drag Bar           */
/* ==================================== */
.audio-player-container {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--color-dark-player);
    color: var(--color-white);
    z-index: 90;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    box-shadow: 0 -4px 10px var(--color-player-shadow);
    display: flex;
    flex-direction: column;
}

.audio-player-container.active { transform: translateY(0); }

/* Draggable Progress Bar */
.audio-progress-bar {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--color-player-progress-bg);
    outline: none;
    cursor: pointer;
    margin: 0;
}

.audio-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--color-primary);
    cursor: pointer;
    transition: transform 0.1s;
}

.audio-progress-bar::-webkit-slider-thumb:hover { transform: scale(1.5); }
.audio-progress-bar::-moz-range-thumb {
    width: 12px; height: 12px;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
}

.player-content {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

#player-close {
    background: none;
    color: var(--color-secondary);
    font-size: 1.2rem;
    border: none;
    padding: 5px;
    margin-right: 15px;
    cursor: pointer;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    overflow: hidden;
}

#player-art {
    width: 50px; height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.track-details { display: flex; flex-direction: column; }
.track-title { 
    font-weight: 600; 
    white-space: nowrap; 
    color: var(--color-track-title);
}
.track-artist { font-size: 0.8rem; color: var(--color-player-text); font-family: var(--font-mono); }

.instrument-link {
    font-size: 0.8rem;
    color: var(--color-secondary);
    margin-left: 15px;
    font-family: var(--font-mono);
    display: none;
}

@media (min-width: 600px) {
    .instrument-link { display: inline-block; }
}

.player-controls { display: flex; gap: 15px; }
.player-controls button {
    background: none;
    border: none;
    color: var(--color-white);
    cursor: pointer;
}

.time-display {
    font-size: 0.8rem;
    color: var(--color-secondary);
    min-width: 80px;
    text-align: right;
    margin-left: 15px;
    display: none;
}
@media (min-width: 600px) {
    .time-display { display: block; }
}

.player-controls button img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.play-demo img {
    width: 15px;
    height: 15px;
    vertical-align: top;
    transform: translateY(-100px);
}


/* ==================================== */
/* 9. Modals / Popups                   */
/* ==================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: var(--color-black-overlay-darker);
    backdrop-filter: blur(3px);
    padding-top: 60px;
}

.modal-content {
    background-color: var(--color-white);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--color-dark-gray);
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    position: relative;
}

.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.close-btn {
    color: var(--color-modal-close);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px; right: 20px;
}
.close-btn:hover { color: var(--color-modal-close-hover); }
.modal-product-image {
    max-width: 100%; height: auto;
    display: block; margin: 15px 0 25px;
    border-radius: 4px;
}


/* ==================================== */
/* 10. Cookie Banner                    */
/* ==================================== */
.cookie-banner-container {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 150;
    box-shadow: 0 -2px 10px var(--color-player-shadow);
}

.cookie-banner-container p { margin: 0; flex-grow: 1; }
.cookie-buttons button { margin-left: 10px; padding: 8px 15px; border-radius: 4px; }
#cookie-refuse { color: var(--color-white); border-color: var(--color-white); }
#cookie-refuse:hover { background-color: var(--color-white); color: var(--color-dark); }
.cookie-buttons .tertiary { color: var(--color-white); border: 1px solid var(--color-white); }


/* ==================================== */
/* NUOVA SEZIONE: Scrolling Emulato (JS)*/
/* ==================================== */

#smooth-wrapper {
    will-change: transform;
    transition: none !important;
}

header,
.cookie-banner-container,
.audio-player-container,
.modal {
    position: fixed !important;
    z-index: 999;
}

/* ==================================== */
/* 11. Hidden Data Containers           */
/* ==================================== */
.product-hidden-data {
    display: none !important;
}


/* ==================================== */
/* 12. Media Queries                    */
/* ==================================== */
@media (max-width: 768px) {

    .product-overlay {
        opacity: 1;
        background: none;
        justify-content: flex-start;
        align-items: flex-end;
        padding: 10px;
    }

    .play-demo {
        border-radius: 4px;
        padding: 6px 12px;
        font-size: 0.8rem;
        background-color: var(--color-primary);
        color: var(--color-white);
    }

    .play-demo h4 {
        color: var(--color-white);
    }

    .play-demo:hover {
        background-color: var(--color-dark-primary);
    }

    .play-demo img {
        display: none;
    }

    .desktop-menu { display: none; }
    .hamburger-menu { display: flex; z-index: 101; }

    /* Mobile Overlay: Dark and Solid */
    .mobile-menu-overlay {
        display: block;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background-color: var(--color-dark);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
        padding-top: var(--header-height);
        overflow-y: auto;
    }

    .mobile-menu-overlay.active { opacity: 1; visibility: visible; }

    .mobile-nav-list {
        list-style: none;
        text-align: center;
        padding: 40px 0;
    }

    .mobile-nav-list a, .mobile-dropdown-trigger span {
        color: var(--color-white);
        display: block;
        padding: 15px;
        font-size: 1.2rem;
        border-bottom: 1px solid var(--color-footer-border);
        cursor: pointer;
    }

    /* Mobile Accordion Styles */
    .mobile-submenu {
        list-style: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        background-color: var(--color-mobile-submenu-bg);
    }

    .mobile-submenu.open {
        max-height: 500px;
    }

    .mobile-submenu a {
        font-size: 1rem;
        padding-left: 30px;
        color: var(--color-secondary);
        border-bottom: none;
    }

    /* Adjust Handcraft for Mobile (Stack vertically, no sticky) */
    .handcraft-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sticky-image {
        position: relative;
        top: -50px;
        height: 250px;
        transition: transform 0.1s ease-out;
    }

    .scroll-text {
        margin-top: -30px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p.slogan {
        font-size: 1rem;
    }

    .footer-content { flex-direction: column; align-items: center; }

    .cookie-banner-container {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 20px;
    }

    .cookie-buttons {
        width: 100%;
        display: flex;
        justify-content: space-around;
        gap: 5px;
    }

    .cookie-buttons button { margin: 0; flex: 1; }

    .product-card {
        box-shadow: 0 4px 10px var(--color-shadow-dark);
    }
}


@media (min-width: 769px) and (max-width: 1024px) {
    .product-overlay {
        opacity: 1;
        background: none;
        justify-content: flex-start;
        align-items: flex-end;
        padding: 10px;
    }

    .play-demo {
        border-radius: 4px;
        padding: 6px 12px;
        font-size: 0.8rem;
        background-color: var(--color-primary);
        color: var(--color-white);
    }

    .play-demo h4 {
        color: var(--color-white);
    }

    .play-demo:hover {
        background-color: var(--color-dark-primary);
    }

    .play-demo img {
        display: none;
    }

    .handcraft-row {
        grid-template-columns: 1fr 1fr;
        gap: 30px; 
    }

    .handcraft-section-modern {
        padding: 100px 40px; 
    }

    .scroll-text {
        padding: 30px;
    }
}