/* Custom styles for Seav E-commerce 3D */

:root {
     /* --primary-color: #0d6efd; */
    --primary-color: #00ade4;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    min-height: 400px;
}

.hero-image i {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Home */
.featured-products img.img-demo-with-logo{
    display: none;
}
.featured-products a.text-decoration-none:hover img.img-demo-with-logo{
    display: block;
}
.featured-products a.text-decoration-none:hover img.img-cover{
    display: none;
}


/* Product cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-card .card-img-top {
    border-radius: 0.375rem 0.375rem 0 0;
    overflow: hidden;
}

.product-card .card-img-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Category cards */
.category-card {
    transition: transform 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.category-card:hover {
    transform: translateY(-3px);
}

/* Cart badge */
#cart-count {
    position: relative;
    top: -8px;
    left: -5px;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* List groups */
.list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        min-height: 300px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-image i {
        font-size: 100px !important;
    }
    
    .product-card .card-body {
        padding: 1rem;
    }
}

/* Utility classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.border-radius-lg {
    border-radius: 0.5rem;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}


/* Customizer styles */
.product-customizer {
    min-height: 500px;
}

.product-customizer-tools {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 1rem 0.5rem;
    height: 100%;
    position: relative;
}

/* Compact toolbar styles */
.customizer-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-group {
    position: relative;
}

.tool-btn {
    width: 100%;
    height: 50px;
    border: none;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #495057;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tool-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tool-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Expandable menu styles */
.tool-menu {
    position: absolute;
    left: 100%;
    top: 0;
    width: 300px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.tool-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.tool-menu-content {
    padding: 1.5rem;
    position: relative;
}

.tool-menu-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border: none;
    background-color: transparent;
    color: #6c757d;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

.tool-menu-close:hover {
    background-color: #f8f9fa;
    color: #dc3545;
    transform: scale(1.1);
}

.tool-menu-close:active {
    transform: scale(0.95);
}

.tool-menu-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Arrow pointing to the tool button */
.tool-menu::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #ffffff;
    transition: all 0.3s ease;
}

.tool-menu::after {
    content: '';
    position: absolute;
    left: -9px;
    top: 19px;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 9px solid #dee2e6;
    z-index: -1;
    transition: all 0.3s ease;
}

/* Arrow when menu is positioned to the left */
.tool-menu[style*="right: 100%"]::before {
    left: auto;
    right: -8px;
    border-left: 8px solid #ffffff;
    border-right: none;
}

.tool-menu[style*="right: 100%"]::after {
    left: auto;
    right: -9px;
    border-left: 9px solid #dee2e6;
    border-right: none;
}

.product-customizer-tools h6 {
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.product-customizer-canvas-container {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    min-height: 500px;
    overflow: visible;
}

.product-customizer-canvas-container canvas {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-width: 100%;
    height: auto;
    /* Mantiene le proporzioni originali */
    object-fit: contain;
}

/* Responsive adjustments for customizer */
@media (max-width: 768px) {
    .product-customizer-tools {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding: 1rem;
    }
    
    .customizer-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .tool-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .tool-menu {
        width: 280px;
        left: 0;
        top: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }
    
    .tool-menu::before {
        left: 20px;
        top: -8px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid #ffffff;
        border-top: none;
    }
    
    .tool-menu::after {
        left: 19px;
        top: -9px;
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-bottom: 9px solid #dee2e6;
        border-top: none;
    }
    
    .product-customizer-canvas-container {
        padding: 1rem;
        min-height: 300px;
        /* Permette lo scroll orizzontale quando il canvas è più largo dello schermo */
        overflow-x: auto;
        overflow-y: visible;
        /* Mantiene il canvas centrato verticalmente e orizzontalmente quando possibile */
        justify-content: center;
        align-items: center;
        /* Smooth scrolling su iOS */
        -webkit-overflow-scrolling: touch;
        /* Assicura che il contenitore possa scrollare */
        position: relative;
        /* Scrollbar sempre visibile e personalizzata */
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) #f0f0f0;
        /* Indicatori visivi per suggerire lo scroll */
        /*
        background: 
            linear-gradient(to right, rgba(0, 0, 0, 0.05) 0%, transparent 20px),
            linear-gradient(to left, rgba(0, 0, 0, 0.05) 0%, transparent 20px),
            #ffffff;
        background-attachment: local, local, scroll;
        */
    }
    
    /* Personalizzazione scrollbar per WebKit (Chrome, Safari, Edge) */
    .product-customizer-canvas-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .product-customizer-canvas-container::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 4px;
        margin: 0 1rem;
    }
    
    .product-customizer-canvas-container::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 4px;
        border: 1px solid #ffffff;
    }
    
    .product-customizer-canvas-container::-webkit-scrollbar-thumb:hover {
        background: #0099cc;
    }
    
    .product-customizer-canvas-container canvas {
        /* Su mobile, mantiene le dimensioni originali senza deformazioni */
        max-width: none;
        width: auto;
        height: auto;
        /* Assicura che il canvas non venga ridimensionato */
        flex-shrink: 0;
        /* Centra il canvas quando è più piccolo dello schermo */
        margin: 0 auto;
        display: block;
    }
}

/* Form controls in customizer */
.product-customizer-tools .form-control,
.product-customizer-tools .form-select {
    font-size: 0.875rem;
}

.product-customizer-tools .btn {
    font-size: 0.875rem;
}

/* Range slider styling */
.product-customizer-tools .form-range {
    height: 0.5rem;
}

.product-customizer-tools .form-range::-webkit-slider-thumb {
    background-color: var(--primary-color);
}

.product-customizer-tools .form-range::-moz-range-thumb {
    background-color: var(--primary-color);
    border: none;
}


/* Nascondi frecce quando il menu è centrato su mobile */
.tool-menu[style*="position: fixed"]::before,
.tool-menu[style*="position: fixed"]::after {
    display: none;
}

/* Overlay per menu mobile */
.tool-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}