/* ===================================
   MareSport CRM - Frontend Styles
   =================================== */

/* Container generale */
.maresport-archive,
.maresport-single-product {
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header archivio */
.maresport-archive-header {
    padding: 40px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.maresport-archive-title {
    margin: 0 0 15px 0;
    font-size: 2.5em;
    font-weight: 700;
    color: #1e293b;
}

.maresport-archive-description {
    color: #64748b;
    font-size: 1.1em;
}

/* Filtri */
.maresport-filters-wrapper {
    margin: 30px 0;
    padding: 25px;
    background: #000000;
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Toggle Button Filtri (Mobile) */
.maresport-filters-toggle-btn {
    display: none;
    width: 100%;
    padding: 15px 20px;
    background: #000000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.maresport-filters-toggle-btn:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.maresport-filters-toggle-btn:active {
    transform: translateY(0);
}

.maresport-filters-toggle-btn .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.maresport-filters-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.maresport-filters-toggle-btn .filter-count {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    margin-left: 8px;
    font-weight: 700;
}

.maresport-filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.maresport-filter-group {
    display: flex;
    flex-direction: column;
}

.maresport-filter-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95em;
}

.maresport-filter {
    padding: 10px 12px;
    border: 1px solid #444444;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #1a1a1a;
    color: #ffffff;
}

.maresport-filter:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.maresport-filter-actions {
    display: flex;
    gap: 10px;
}

.maresport-filter-button,
.maresport-reset-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.maresport-filter-button {
    background: #000000;
    color: #fff;
}

.maresport-filter-button:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.maresport-reset-button {
    background: #f3f4f6;
    color: #374151;
}

.maresport-reset-button:hover {
    background: #e5e7eb;
}

/* Griglia prodotti */
.maresport-products-wrapper {
    margin: 30px 0;
}

.maresport-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.maresport-products-container.loading {
    position: relative;
    pointer-events: none;
}

.maresport-products-container.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 10;
}

/* Card prodotto */
.maresport-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.maresport-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #000000;
}

.maresport-product-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f3f4f6;
}

.maresport-product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    transition: all 0.4s ease;
    z-index: 1;
}

.maresport-product-card:hover .maresport-product-image::after {
    background: rgba(0, 0, 0, 0.05);
}

.maresport-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
    position: relative;
    z-index: 0;
    filter: brightness(0.65) contrast(1.15);
}

.maresport-product-card:hover .maresport-product-image img {
    transform: scale(1.05);
    filter: brightness(1) contrast(1);
}

.maresport-condition-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    background: #10b981;
    color: #fff;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.maresport-product-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.maresport-product-title {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    font-weight: 700;
    line-height: 1.3;
}

.maresport-product-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.maresport-product-title a:hover {
    color: #000000;
}

.maresport-product-brand {
    margin: 0 0 15px 0;
    color: #64748b;
    font-size: 1em;
    font-weight: 500;
}

.maresport-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.maresport-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
    font-size: 0.9em;
}

.maresport-meta-item .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.maresport-product-price {
    font-size: 1.8em;
    font-weight: 700;
    color: #000000;
    margin: auto 0 15px 0;
}

.maresport-view-details {
    display: block;
    padding: 12px 20px;
    background: #000000;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.maresport-view-details:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Nessun risultato */
.maresport-no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2em;
    color: #64748b;
}

/* Paginazione */
.maresport-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.maresport-pagination a,
.maresport-pagination span {
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s ease;
}

.maresport-pagination a:hover {
    background: #000000;
    color: #fff;
    border-color: #000000;
}

.maresport-pagination .current {
    background: #000000;
    color: #fff;
    border-color: #000000;
}

/* ===================================
   Pagina singola prodotto
   =================================== */

.maresport-product-header {
    padding: 40px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.maresport-product-title {
    margin: 0 0 15px 0;
    font-size: 2.5em;
    font-weight: 700;
    color: #1e293b;
}

.maresport-product-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.maresport-brand,
.maresport-model {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-weight: 600;
    color: #374151;
}

.maresport-product-content {
    padding: 40px 0;
}

.maresport-product-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 40px;
}

/* Immagini prodotto */
.maresport-product-images {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.maresport-main-image {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.maresport-main-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

.maresport-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.maresport-thumb {
    width: 100%;
    height: 80px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f3f4f6;
}

.maresport-thumb:hover,
.maresport-thumb.active {
    border-color: #000000;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.maresport-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dettagli prodotto */
.maresport-product-details {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.maresport-product-price-box {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid #e5e7eb;
}

.maresport-price {
    font-size: 2.5em;
    font-weight: 700;
    color: #000000;
}

.maresport-quick-info {
    padding: 25px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 25px;
}

.maresport-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.maresport-info-item:last-child {
    border-bottom: none;
}

.maresport-info-label {
    font-weight: 600;
    color: #64748b;
}

.maresport-info-value {
    font-weight: 700;
    color: #1e293b;
}

.maresport-contact-box {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px;
    text-align: center;
}

.maresport-contact-box h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.maresport-contact-box p {
    margin: 0 0 20px 0;
    opacity: 0.9;
}

.maresport-contact-button,
.maresport-phone-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 10px;
    background: #fff;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.05em;
    transition: all 0.3s ease;
}

.maresport-contact-button:hover,
.maresport-phone-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.maresport-phone-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.maresport-phone-button:last-child {
    margin-bottom: 0;
}

/* Descrizione */
.maresport-product-description {
    padding: 40px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 30px;
}

.maresport-product-description h2 {
    margin: 0 0 20px 0;
    font-size: 2em;
    color: #1e293b;
}

.maresport-description-content {
    color: #374151;
    line-height: 1.8;
    font-size: 1.05em;
}

/* Specifiche tecniche */
.maresport-product-specs {
    padding: 40px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.maresport-product-specs h2 {
    margin: 0 0 30px 0;
    font-size: 2em;
    color: #1e293b;
}

.maresport-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.maresport-spec-item {
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #000000;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maresport-spec-label {
    font-size: 0.9em;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.maresport-spec-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #1e293b;
}

/* Lightbox */
.maresport-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.maresport-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.maresport-lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.maresport-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
}

.maresport-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.maresport-lightbox-close:hover {
    background: #f3f4f6;
    transform: rotate(90deg);
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 1024px) {
    .maresport-product-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .maresport-product-images,
    .maresport-product-details {
        position: static;
    }
    
    .maresport-filters-form {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet - 2 colonne */
@media (min-width: 768px) and (max-width: 1024px) {
    .maresport-archive-title,
    .maresport-product-title {
        font-size: 2em;
    }
    
    .maresport-filters-form {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .maresport-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .maresport-specs-grid {
        grid-template-columns: 1fr;
    }
    
    .maresport-product-description,
    .maresport-product-specs {
        padding: 25px;
    }
}

/* Desktop - 3 colonne */
@media (min-width: 1025px) {
    .maresport-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

/* Mobile - Sempre 1 colonna */
@media (max-width: 767px) {
    .container {
        padding: 0 15px;
    }
    
    .maresport-archive-header {
        padding: 30px 0;
    }
    
    .maresport-archive-title,
    .maresport-product-title {
        font-size: 1.75em;
    }
    
    .maresport-filters-wrapper {
        margin: 20px 0;
        padding: 20px 15px;
    }
    
    /* Mostra il toggle button su mobile */
    .maresport-filters-toggle-btn {
        display: flex !important;
    }
    
    /* Nascondi il form di default su mobile */
    .maresport-filters-form {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
        opacity: 0;
        margin-top: 0;
        grid-template-columns: 1fr;
    }
    
    /* Mostra il form quando attivo */
    .maresport-filters-form.active {
        max-height: 2000px;
        opacity: 1;
        margin-top: 15px;
    }
    
    .maresport-filter-actions {
        flex-direction: column;
    }
    
    .maresport-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .maresport-product-card {
        max-width: 100%;
    }
    
    /* Assicura che tutte le griglie siano su 1 colonna */
    .maresport-shortcode-grid,
    .maresport-grid-layout,
    #maresport-products-grid,
    .maresport-catalog-products .maresport-shortcode-grid {
        grid-template-columns: 1fr;
    }
    
    .maresport-specs-grid {
        grid-template-columns: 1fr;
    }
    
    .maresport-product-description,
    .maresport-product-specs {
        padding: 20px;
    }
}

/* Load More Button */
.maresport-load-more-btn {
    background: #000000 !important;
    color: white !important;
    border: none !important;
    padding: 15px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.maresport-load-more-btn:hover {
    background: #1a1a1a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.maresport-load-more-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.maresport-load-more-btn.loading {
    opacity: 0.7 !important;
    cursor: wait !important;
}
