/*
Theme Name: On Page Theme
Template: twentytwentyone
*/

/* === SFONDO A SCACCHIERA CON COLORI PASTELLO === */
.woocommerce-page {
    background-color: #fff6e8;
    background-image: 
        linear-gradient(45deg, #ffe0b2 25%, transparent 25%), 
        linear-gradient(-45deg, #ffe0b2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ffe0b2 75%),
        linear-gradient(-45deg, transparent 75%, #ffe0b2 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
    position: relative;
}

/* Pattern overlay per aggiungere texture */
.woocommerce-page:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffddc1' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

/* Versione alternativa: vera scacchiera con CSS puro */
@supports (background-image: conic-gradient(#fff6e8, #fff6e8)) {
    .woocommerce-page {
        background-image: 
            conic-gradient(#fff6e8 90deg, #ffe0b2 90deg 180deg, #fff6e8 180deg 270deg, #ffe0b2 270deg);
        background-size: 60px 60px;
        background-position: 0 0;
    }
}

/* Contenitore principale per dare più spazio */
.woocommerce-page .site-main,
.woocommerce-page .content-area {
    position: relative;
    z-index: 1;
    padding: 20px;
}

/* === NUOVO LAYOUT SHOP CON SIDEBAR === */
.shop-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.shop-sidebar {
    flex: 0 0 250px;
}

.products-grid {
    flex: 1;
    min-width: 300px;
}

@media (max-width: 768px) {
    .shop-container {
        flex-direction: column;
    }
    
    .shop-sidebar {
        order: 1;
        width: 100%;
    }
    
    .products-grid {
        order: 2;
        width: 100%;
    }
}

/* Widget di filtro */
.filter-widget {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #ffe0b2;
}

.filter-widget h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #d77f42;
    border-bottom: 2px solid #ffe0b2;
    padding-bottom: 8px;
}

/* Categorie */
.product-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-categories li {
    margin-bottom: 8px;
}

.product-categories a {
    display: block;
    padding: 8px 15px;
    background: #fff1e6;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #795548;
    border: 1px solid transparent;
}

.product-categories a:hover {
    background: #ffe0b2;
    color: #d77f42;
    transform: translateX(5px);
}

.product-categories .current-cat a {
    background: #ffcc80;
    color: #d35400;
    border-color: #e67e22;
    font-weight: bold;
}

/* Filtro prezzo */
.price-range {
    margin-top: 10px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-inputs input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ffe0b2;
    border-radius: 4px;
    background: #fff;
}

.price-inputs span {
    color: #d77f42;
    font-weight: bold;
}

.price-filter-button {
    width: 100%;
    padding: 10px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.price-filter-button:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Header risultati */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #ffe0b2;
}

.shop-header h1 {
    font-size: 24px;
    margin: 0;
    color: #d77f42;
}

.woocommerce-result-count {
    margin: 0;
    color: #795548;
    font-style: italic;
}

/* === STILI PERSONALIZZATI PER I BOX PRODOTTO === */

/* Stile base per tutti i prodotti */
.woocommerce ul.products li.product {
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px !important;
    background: linear-gradient(135deg, #fff6e8, #fff1e6);
    position: relative;
    border: 1px solid #ffe0b2;
}

/* Animazione hover */
.woocommerce ul.products li.product:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(232, 185, 138, 0.25);
    border-color: #ffcc80;
}

/* Immagine prodotto */
.woocommerce ul.products li.product img {
    transition: all 0.5s ease;
    margin-bottom: 0 !important;
    border-bottom: 3px solid #ffe0b2;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}

/* Contenitore delle informazioni */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price {
    padding: 0 15px;
}

/* Titolo prodotto */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding-top: 15px;
    font-size: 16px !important;
    color: #795548;
    transition: color 0.3s ease;
    height: 50px;
    overflow: hidden;
    margin-bottom: 5px !important;
}

.woocommerce ul.products li.product:hover .woocommerce-loop-product__title {
    color: #d77f42;
}

/* Prezzo */
.woocommerce ul.products li.product .price {
    color: #e67e22 !important;
    font-weight: bold;
    font-size: 18px !important;
    margin-bottom: 10px;
}

/* Badge Offerta */
.woocommerce span.onsale {
    background-color: #ff9800;
    border-radius: 50%;
    left: 10px;
    top: 10px;
    min-height: 3.236em;
    min-width: 3.236em;
    padding: 0;
    font-weight: 600;
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
    line-height: 3.236;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Pulsante aggiungi al carrello */
.woocommerce ul.products li.product .button {
    margin: 0;
    width: 100%;
    border-radius: 0;
    background-color: #e67e22;
    color: white;
    text-transform: uppercase;
    font-weight: 500;
    text-align: center;
    padding: 12px 0;
    position: absolute;
    bottom: -40px;
    left: 0;
    transition: all 0.3s ease;
    opacity: 0;
}

.woocommerce ul.products li.product:hover .button {
    bottom: 0;
    opacity: 1;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #d35400;
}

/* === STILI PER LA PAGINA SINGOLO PRODOTTO === */

/* Contenitore del prodotto */
.single-product-custom {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid #ffe0b2;
}

/* Immagine principale prodotto */
.woocommerce div.product div.images img {
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Miniature galleria */
.woocommerce div.product div.images .flex-control-thumbs li img {
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 5px;
    border: 2px solid #ffe0b2;
}

.woocommerce div.product div.images .flex-control-thumbs li img:hover {
    transform: scale(1.1);
    border-color: #ffcc80;
}

/* Titolo prodotto */
.woocommerce div.product .product_title {
    font-size: 28px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: #795548;
}

.woocommerce div.product .product_title:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: #e67e22;
    bottom: 0;
    left: 0;
    animation: expandWidth 2s ease-in-out;
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 60px; }
}

/* Prezzo */
.woocommerce div.product p.price {
    font-size: 24px !important;
    color: #e67e22 !important;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Pulsante aggiungi al carrello pagina prodotto */
.woocommerce div.product form.cart .button {
    background-color: #e67e22;
    border-radius: 30px;
    padding: 12px 30px;
    text-transform: uppercase;
    font-weight: 500;
    transition: all 0.3s ease;
}

.woocommerce div.product form.cart .button:hover {
    background-color: #d35400;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Tabs prodotto */
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border-radius: 0;
    padding: 0 20px;
    background: #fff8e1;
    transition: all 0.3s ease;
    border-color: #ffe0b2;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: #fff;
    border-top: 3px solid #e67e22;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li:hover {
    background: #ffe0b2;
}

.woocommerce div.product .woocommerce-tabs .panel {
    background-color: #fff;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    border: 1px solid #ffe0b2;
    border-top: none;
}

/* Effetto loading quando si carica la pagina */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.woocommerce ul.products,
.woocommerce div.product {
    animation: fadeIn 1s ease-in-out;
}

/* Layout responsive per mobile */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        width: 100% !important;
        margin-right: 0 !important;
    }
    
    .woocommerce ul.products li.product .button {
        opacity: 1;
        position: relative;
        bottom: 0;
    }
}

/* === MIGLIORAMENTI RESPONSIVE PER MOBILE E TABLET === */

/* Stili per tablet (iPad) */
@media (min-width: 601px) and (max-width: 1024px) {
    /* Layout contenitore shop */
    .shop-container {
        gap: 20px;
        padding: 0 15px;
    }
    
    /* Sidebar più stretta su tablet */
    .shop-sidebar {
        flex: 0 0 220px;
    }
    
    /* Griglia prodotti più compatta */
    .woocommerce ul.products li.product {
        margin-bottom: 20px !important;
    }
    
    /* Header del negozio più compatto */
    .shop-header {
        flex-wrap: wrap;
        padding: 12px 15px;
    }
    
    /* Layout pagina singolo prodotto */
    .product-main {
        flex-wrap: wrap;
    }
    
    .product-gallery, 
    .product-summary {
        width: 100%;
    }
    
    /* Tabs prodotto più compatti */
    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        padding: 0 15px;
    }
}

/* Stili specifici per smartphone */
@media (max-width: 600px) {
    /* Layout contenitore shop */
    .shop-container {
        gap: 15px;
        padding: 0 10px;
    }
    
    /* Sidebar ottimizzata per mobile */
    .shop-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* Categorie più grandi per facilità di tocco su mobile */
    .product-categories a {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    /* Header risultati semplificato */
    .shop-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .shop-header h1 {
        font-size: 20px;
    }
    
    .woocommerce-result-count {
        font-size: 14px;
    }
    
    /* Griglia prodotti a singola colonna */
    .woocommerce ul.products {
        display: flex;
        flex-direction: column;
    }
    
    .woocommerce ul.products li.product {
        width: 100% !important;
        margin: 0 0 20px 0 !important;
    }
    
    /* Pulsante aggiungi al carrello sempre visibile */
    .woocommerce ul.products li.product .button {
        opacity: 1;
        position: static;
        display: block;
        margin-top: 10px;
        margin-bottom: 10px;
        border-radius: 4px;
    }
    
    /* Titolo prodotto ridimensionato */
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        height: auto;
        min-height: 40px;
        font-size: 15px !important;
    }
    
    /* Pagina singolo prodotto ottimizzata */
    .single-product-custom {
        padding: 15px;
        border-radius: 8px;
    }
    
    /* Immagini prodotto più grandi */
    .product-image img {
        width: 100%;
        height: auto;
    }
    
    /* Layout più compatto per il form carrello */
    .woocommerce div.product form.cart {
        display: flex;
        flex-direction: column;
    }
    
    .woocommerce div.product form.cart .button {
        margin-top: 10px;
        width: 100%;
    }
    
    /* Tabs prodotto verticali */
    .woocommerce div.product .woocommerce-tabs ul.tabs {
        display: flex;
        flex-direction: column;
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        margin: 0 0 5px 0;
        border-radius: 4px;
        border: 1px solid #ffe0b2;
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs li.active {
        border-left: 3px solid #e67e22;
        border-top: 1px solid #ffe0b2;
    }
    
    /* Prodotti correlati più compatti */
    .woocommerce .related ul.products {
        gap: 15px;
    }
    
    /* Filtro prezzo più facile da usare su mobile */
    .price-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .price-inputs input {
        width: 100%;
        padding: 12px;
    }
    
    .price-filter-button {
        padding: 12px;
        margin-top: 5px;
    }
}

/* Ottimizzazioni per dispositivi molto piccoli */
@media (max-width: 320px) {
    .shop-container,
    .shop-sidebar,
    .products-grid {
        padding: 0 5px;
    }
    
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
    }
    
    .woocommerce div.product .product_title {
        font-size: 20px;
    }
    
    .filter-widget h3 {
        font-size: 16px;
    }
}

/* Layout per pagina prodotto su tablet */
@media (min-width: 601px) and (max-width: 1024px) {
    .product-main {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .product-gallery {
        flex: 0 0 100%;
        margin-bottom: 20px;
    }
    
    .product-summary {
        flex: 0 0 100%;
    }
}

/* Responsive per il prodotto singolo */
@media (max-width: 1024px) {
    .product-main {
        display: flex;
        flex-wrap: wrap;
    }
    
    .product-gallery,
    .product-summary {
        width: 100%;
    }
}
