/* Custom Overrides - Layer 6 */
/* Add template-specific personalizations here */
/* This file loads LAST and overrides all previous layers */

/* ============================================
   DARK MODE WIDGET BACKGROUND FIX
   Forza sfondo scuro quando l'utente imposta dark mode,
   sovrascrivendo il bg_color inline dei widget
   ============================================ */
[data-theme="dark"] section[style*="background-color"] {
  background-color: var(--bg-secondary, #1a1a1a) !important;
}

/* Eccezione per hero e widget con immagini di sfondo */
[data-theme="dark"] .widget-hero[style*="background-color"],
[data-theme="dark"] .widget-text-over-image[style*="background-color"] {
  background-color: inherit !important;
}

/* ============================================
   DARK MODE WIDGET TEXT FIX
   Forza testo chiaro nei widget in dark mode
   ============================================ */
[data-theme="dark"] .widget-title,
[data-theme="dark"] .widget-subtitle,
[data-theme="dark"] .widget-content,
[data-theme="dark"] .widget-content p,
[data-theme="dark"] section[class*="widget-"] h1,
[data-theme="dark"] section[class*="widget-"] h2,
[data-theme="dark"] section[class*="widget-"] h3,
[data-theme="dark"] section[class*="widget-"] p,
[data-theme="dark"] section[class*="widget-"] li {
  color: var(--text-primary, #f8f9fa) !important;
}

/* Link nei widget dark mode */
[data-theme="dark"] section[class*="widget-"] a:not(.btn) {
  color: var(--primary-light, #6bc4f0) !important;
}

/* ============================================
   DARK MODE MOBILE TOGGLE ICON FIX
   L'icona hamburger Bootstrap è nera di default,
   in dark mode deve essere bianca
   ============================================ */
[data-theme="dark"] .navbar-toggler-icon,
[data-theme="dark"] .header-mobile-toggle .navbar-toggler-icon {
  filter: invert(1) brightness(2);
}

/* Fix anche per btn-close in dark mode */
[data-theme="dark"] .offcanvas .btn-close {
  filter: invert(1) brightness(2);
}

/* ============================================
   DARK MODE TABLE FIX (Cookie/Privacy Policy)
   Le tabelle Bootstrap con .table-light hanno
   sfondo chiaro che non cambia in dark mode
   ============================================ */
[data-theme="dark"] .table,
[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
  color: var(--text-primary, #f8f9fa) !important;
  border-color: var(--border-color, #495057) !important;
}

[data-theme="dark"] .table-light,
[data-theme="dark"] .table thead.table-light,
[data-theme="dark"] .table-light th,
[data-theme="dark"] .table-light td {
  background-color: var(--bg-tertiary, #2d2d2d) !important;
  color: var(--text-primary, #f8f9fa) !important;
}

[data-theme="dark"] .table-hover tbody tr:hover {
  background-color: var(--bg-secondary, #1a1a1a) !important;
}

/* Card headers in dark mode */
[data-theme="dark"] .card {
  background-color: var(--bg-secondary, #1a1a1a) !important;
  border-color: var(--border-color, #495057) !important;
}

[data-theme="dark"] .card-header {
  border-color: var(--border-color, #495057) !important;
}

[data-theme="dark"] .card-body {
  color: var(--text-primary, #f8f9fa) !important;
}

/* Alert in dark mode */
[data-theme="dark"] .alert-info {
  background-color: rgba(13, 202, 240, 0.15) !important;
  border-color: rgba(13, 202, 240, 0.3) !important;
  color: #6edff6 !important;
}

[data-theme="dark"] .alert-light {
  background-color: var(--bg-tertiary, #2d2d2d) !important;
  border-color: var(--border-color, #495057) !important;
  color: var(--text-primary, #f8f9fa) !important;
}

[data-theme="dark"] .alert-warning {
  background-color: rgba(255, 193, 7, 0.15) !important;
  border-color: rgba(255, 193, 7, 0.3) !important;
  color: #ffda6a !important;
}

/* ====================================
   SEZIONE CHI SIAMO / SERVIZI – STILE PRO
   ==================================== */

.services-section {
    padding: 80px 20px;
    background: #f8f9fa;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.services-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px;
}

.services-intro h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--epc-primary, #E6672A);
    margin-bottom: 1rem;
    position: relative;
}

.services-intro h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--epc-primary, #E6672A);
    margin: 20px auto 0;
    border-radius: 2px;
}

.services-intro p {
    font-size: 1.2rem;
    color: #555;
    line-height: 1.7;
}

/* Highlight storia */
.about-highlight .service-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-left: 6px solid var(--epc-primary, #E6672A);
    margin-bottom: 3rem;
}

/* Grid generale */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Card singola */
.service-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 10px;
}

.service-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--epc-primary, #E6672A);
    border-radius: 2px;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.service-list li {
    padding: 0.6rem 0;
    position: relative;
    padding-left: 28px;
    color: #444;
    line-height: 1.5;
}

.service-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--epc-primary, #E6672A);
    font-weight: bold;
    font-size: 1.1em;
}

/* Bottone finale */
.services-section .btn-primary {
    background: var(--epc-primary, #E6672A);
    color: white;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(230, 103, 42, 0.3);
    transition: all 0.3s ease;
}

.services-section .btn-primary:hover {
    background: #002066;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(230, 103, 42, 0.4);
}

/* Responsive fine */
@media (max-width: 768px) {
    .services-intro h2 { font-size: 2.3rem; }
    .service-card { padding: 1.5rem; }
    .services-grid { gap: 1.5rem; }
}

/* ====================================
   TEMA DARK – versione per [data-theme="dark"]
   ==================================== */

[data-theme="dark"] .services-section {
    background: var(--bg-secondary, #1a1a1a);
    color: #e2e8f0;
}

[data-theme="dark"] .services-intro h2 {
    color: #F28E4E;
}

[data-theme="dark"] .services-intro h2::after {
    background: #F28E4E;
}

[data-theme="dark"] .services-intro p {
    color: #cbd5e1;
}

/* Card */
[data-theme="dark"] .service-card,
[data-theme="dark"] .about-highlight .service-card {
    background: #1e293b;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-left-color: #F28E4E !important;
}

[data-theme="dark"] .about-highlight .service-card {
    border-left: 6px solid #F28E4E;
}

[data-theme="dark"] .service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
    background: #28354b;
}

[data-theme="dark"] .service-title {
    color: #f8fafc;
}

[data-theme="dark"] .service-title::after {
    background: #F28E4E;
}

[data-theme="dark"] .service-list li {
    color: #cbd5e1;
}

[data-theme="dark"] .service-list li::before {
    color: #F28E4E;
}

/* Bottone finale */
[data-theme="dark"] .services-section .btn-primary {
    background: #F28E4E;
    color: #0f172a;
    box-shadow: 0 8px 20px rgba(242, 142, 78, 0.4);
}

[data-theme="dark"] .services-section .btn-primary:hover {
    background: #f9a571;
    box-shadow: 0 12px 30px rgba(242, 142, 78, 0.4);
    transform: translateY(-3px);
}

/* ====================================
   SEZIONE CLIENTI – Stile professionale
   ==================================== */

.clients-section {
    padding: 90px 20px;
    background: #ffffff;
    position: relative;
}

.clients-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(248,249,250,0.6) 100%);
    pointer-events: none;
}

/* Intro */
.clients-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.clients-intro h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--epc-primary, #E6672A);
    margin-bottom: 1rem;
    position: relative;
}

.clients-intro h2::after {
    content: '';
    display: block;
    width: 90px;
    height: 4px;
    background: var(--epc-primary, #E6672A);
    margin: 20px auto 0;
    border-radius: 2px;
}

.clients-intro p {
    font-size: 1.2rem;
    color: #555;
    line-height: 1.7;
}

/* Grid clienti */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Card cliente */
.client-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.client-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: var(--epc-primary, #E6672A);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.client-card:hover::before {
    transform: scaleX(1);
}

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

.client-logo {
    margin-bottom: 1.5rem;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-logo img {
    max-width: 180px;
    max-height: 70px;
    width: auto;
    height: auto;
    filter: grayscale(100%) opacity(0.8);
    transition: all 0.4s ease;
}

.client-card:hover .client-logo img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

.client-category {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 30px;
    margin-bottom: 1rem;
    background: #e9ecef;
    color: #495057;
}

/* Colori categorie (personalizzabili) */
.cat-elettronica { background: #e3f2fd; color: #1976d2; }
.cat-fashion     { background: #fce4ec; color: #c2185b; }
.cat-beauty      { background: #f3e5f5; color: #7b1fa2; }
.cat-retail      { background: #e8f5e8; color: #2e7d32; }
.cat-transport   { background: #fff3e0; color: #ef6c00; }
.cat-food        { background: #fff8e1; color: #f9a825; }

.client-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #222;
    margin: 0.5rem 0;
}

.client-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    flex-grow: 1;
}

/* ====================================
   DARK MODE – [data-theme="dark"]
   ==================================== */

[data-theme="dark"] .clients-section {
    background: var(--bg-secondary, #1a1a1a);
}

[data-theme="dark"] .clients-section::before {
    background: linear-gradient(180deg, rgba(15,23,42,0) 0%, rgba(15,23,42,0.8) 100%);
}

[data-theme="dark"] .clients-intro h2 { color: #F28E4E; }
[data-theme="dark"] .clients-intro h2::after { background: #F28E4E; }
[data-theme="dark"] .clients-intro p { color: #cbd5e1; }

[data-theme="dark"] .client-card {
    background: #1e293b;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

[data-theme="dark"] .client-card::before {
    background: #60a5fa;
}

[data-theme="dark"] .client-card:hover {
    box-shadow: 0 20px 45px rgba(0,0,0,0.7);
}

[data-theme="dark"] .client-logo img {
    filter: brightness(0.8) grayscale(80%);
}

[data-theme="dark"] .client-card:hover .client-logo img {
    filter: brightness(1) grayscale(0%);
}

[data-theme="dark"] .client-category {
    opacity: 0.9;
}

[data-theme="dark"] .client-name { color: #f8fafc; }
[data-theme="dark"] .client-description { color: #94a3b8; }

/* Responsive */
@media (max-width: 768px) {
    .clients-intro h2 { font-size: 2.3rem; }
    .clients-grid { gap: 2rem; }
    .client-card { padding: 1.8rem; }
}

/* ====================================
   DARK MODE FIX – [data-theme="dark"]
   ==================================== */


[data-theme="dark"] .contact-info-card 
 {
    background-color: var(--bg-secondary, #1a1a1a) !important;
    border-color: var(--border-color, #495057) !important;
}

/* ============================================
   GO TO TOP BUTTON
   ============================================ */
.go-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background-color: var(--primary-color, #0047AB);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

.go-to-top .bi {
    font-size: 18px;
    opacity: 0.9;
}

.go-to-top.show {
    opacity: 1;
    visibility: visible;
}

.go-to-top:hover {
    background-color: var(--primary-dark, #003380);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .go-to-top {
    background-color: var(--primary-light, #4a90e2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .go-to-top:hover {
    background-color: var(--primary-color, #0047AB);
}

@media (max-width: 768px) {
    .go-to-top {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   FOOTER PAGES LIST - Enhanced Styling
   ============================================ */

.footer-pages-list {
    margin: 0;
    padding: 0;
}

.footer-pages-list li {
    margin-bottom: 0.6rem;
}

.footer-page-link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: all 0.25s ease;
    background-color: rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
}

.footer-page-link:hover {
    color: #fff;
    background-color: rgba(230, 103, 42, 0.25);
    transform: translateX(4px);
    text-decoration: none;
}

.footer-page-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(230, 103, 42, 0.4);
    text-decoration: none;
}

/* Dark mode footer pages */
[data-theme="dark"] .footer-page-link {
    color: rgba(255, 255, 255, 0.65);
    background-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .footer-page-link:hover {
    color: #fff;
    background-color: rgba(242, 142, 78, 0.2);
    text-decoration: none;
}

[data-theme="dark"] .footer-page-link:focus {
    box-shadow: 0 0 0 2px rgba(242, 142, 78, 0.35);
    text-decoration: none;
}