/**
 * Style LM - Leone America Custom Styles
 * Foglio di stile personalizzato
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    /* Primary colors */
    --lm-primary: #214ecd;
    --lm-primary-dark: #1a3fa3;
    --lm-secondary: #001b2e;
    --lm-accent: #e53935;

    /* Text */
    --lm-text: #333333;
    --lm-text-light: #666666;

    /* Backgrounds */
    --lm-bg: #ffffff;
    --lm-bg-light: #f5f5f5;
    --lm-border: #e0e0e0;

    /* Gray scale */
    --lm-gray-50: #f9fafb;
    --lm-gray-100: #f3f4f6;
    --lm-gray-200: #e5e7eb;
    --lm-gray-300: #d1d5db;
    --lm-gray-400: #9ca3af;
    --lm-gray-500: #6b7280;
    --lm-gray-600: #4b5563;
    --lm-gray-700: #374151;

    /* Status colors */
    --lm-success: #059669;
    --lm-success-light: #d1fae5;
    --lm-error: #dc2626;
    --lm-error-light: #fee2e2;
    --lm-warning: #d97706;
    --lm-warning-light: #fef3c7;
    --lm-info: #1d4ed8;
    --lm-info-light: #dbeafe;

    /* Shadows */
    --lm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --lm-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --lm-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --lm-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);

    /* Radius */
    --lm-radius-full: 9999px;

    /* Transitions */
    --lm-transition: 0.3s ease;
}

/* ==========================================================================
   Base Utilities
   ========================================================================== */

/* Page container base */
.page-base {
    min-height: 60vh;
    padding-bottom: 60px;
}

/* Card base */
.card-base {
    background: var(--lm-bg);
    box-shadow: var(--lm-shadow-sm);
    transition: background-color var(--lm-transition);
}

.card-base:hover {
    background-color: var(--lm-gray-50);
}

/* Form input base */
.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    font-size: 16px;
    transition: border-color var(--lm-transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--lm-primary);
}

/* Section title */
.section-title-base {
    color: var(--lm-primary) !important;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 40px;
}

@media screen and (max-width: 768px) {
    .section-title-base {
        font-size: 36px;
    }
}

/* ==========================================================================
   Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Product Table
   -------------------------------------------------------------------------- */
.product-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.product-table thead {
    text-transform: uppercase;
    font-size: 12px;
    color: #374151;
    /* gray-700 */
    background-color: var(--lm-gray-50);
    /* gray-50 */
}

.product-table thead th {
    text-align: left;
    padding: 8px 8px 8px 8px;
    font-weight: 600;
    background-color: var(--lm-gray-50);
}

.product-table thead th .sort-icon {
    cursor: pointer;
    padding: 0 8px;
    color: var(--lm-text-light);
}

.product-table thead th .sort-icon:hover {
    color: var(--lm-primary);
}

.product-table thead th img {
    display: inline-block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.product-table tbody tr {
    border-bottom: 1px solid var(--lm-border);
    background-color: #ffffff;
    transition: background-color var(--lm-transition);
}

.product-table tbody tr:hover {
    background-color: var(--lm-gray-50);
}

.product-table tbody tr.highlight,
.product-table tbody tr.highlight-row {
    background-color: #ffffea;
    /* bg-yellow */
}

.product-table tbody td {
    min-width: 150px;
    height: 48px;
    padding: 6px 8px;
    vertical-align: middle;
}

.product-table tbody td.codice,
.product-table tbody td.first-col {
    color: var(--lm-primary);
    font-weight: 700;
}

.product-table tbody td img {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Table info button */
.product-table .info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    /* blue-700 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: color var(--lm-transition);
}

.product-table .info-btn:hover {
    color: #1e40af;
    /* blue-800 */
}

.product-table .info-btn svg {
    width: 24px;
    height: 24px;
}

/* Cart column (for logged users) */
.product-table .cart-col {
    text-align: center;
    padding: 8px 16px;
}

.product-table .cart-btn {
    color: #ffffff;
    background-color: #1d4ed8;
    /* blue-700 */
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color var(--lm-transition);
}

.product-table .cart-btn:hover {
    background-color: #1e40af;
    /* blue-800 */
}

/* Quantity input */
.product-table .quantity-input {
    width: 60px;
    text-align: center;
    padding: 6px 8px;
    border: 1px solid var(--lm-border);
    font-size: 14px;
}

/* Responsive table */
@media screen and (max-width: 768px) {
    .product-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .product-table tbody td {
        min-width: 120px;
    }
}


/* --------------------------------------------------------------------------
   Tables Container
   -------------------------------------------------------------------------- */
.tables-container {
    margin-top: 40px;
}

/* --------------------------------------------------------------------------
   Table Tabs
   -------------------------------------------------------------------------- */
.table-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--lm-gray-200);
    margin-bottom: 12px;
    padding: 0;
    list-style: none;
}

.table-tabs .table-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 14px;
    margin: 0 0 -1px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: var(--lm-primary);
    background: #fff;
    border: 1px solid #d7dce8;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--lm-transition);
}

.table-tabs .table-tab:hover {
    color: #fff;
    background: var(--lm-primary);
    border-color: var(--lm-primary);
}

.table-tabs .table-tab.active {
    color: #fff;
    background: var(--lm-primary);
    border-color: var(--lm-primary);
}

/* Table panel */
.table-panel {
    display: none;
    padding-top: 16px;
}

.table-panel.active {
    display: block;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Highlight legend (square indicator) */
.highlight-legend {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.highlight-legend .legend-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.highlight-legend .legend-square {
    width: 40px;
    height: 40px;
    background-color: #ffffea;
    border: 1px solid var(--lm-border);
}

.highlight-legend .legend-text {
    font-size: 12px;
    color: var(--lm-text-light);
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    padding: 24px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.modal-content img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    margin: 0 auto;
}

.modal-gallery-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(-50%);
    z-index: 1002;
    transition: background-color var(--lm-transition), border-color var(--lm-transition);
}

.modal-gallery-nav:hover {
    background: rgba(0, 0, 0, 0.72);
    border-color: rgba(255, 255, 255, 0.85);
}

.modal-gallery-nav[hidden] {
    display: none;
}

.modal-gallery-prev {
    left: 12px;
}

.modal-gallery-next {
    right: 12px;
}

.modal-gallery-counter {
    position: absolute;
    left: 50%;
    bottom: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    transform: translateX(-50%);
    z-index: 1002;
}

.modal-content iframe {
    width: 800px;
    height: 450px;
    max-width: 100%;
    border: none;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 32px;
    font-weight: 300;
    color: var(--lm-text-light);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color var(--lm-transition);
    z-index: 1002;
}

.modal-close:hover {
    color: var(--lm-text);
}

@media screen and (max-width: 768px) {
    .modal-content {
        padding: 16px;
        max-width: 95%;
    }

    .modal-content iframe {
        width: 100%;
        height: 280px;
    }

    .modal-close {
        top: 4px;
        right: 8px;
        font-size: 28px;
    }

    .modal-gallery-nav {
        width: 38px;
        height: 38px;
    }
}

/* --------------------------------------------------------------------------
   Product Detail Page
   -------------------------------------------------------------------------- */
.product-detail {
    max-width: var(--container, 1536px);
    width: 100%;
    box-sizing: border-box;
    padding: 64px 20px;
    overflow-x: hidden;
}

/* Product Header - 2 columns layout */
.product-header {
    display: grid !important;
    grid-template-columns: minmax(320px, 520px) minmax(340px, 1fr) !important;
    gap: 32px !important;
    align-items: start !important;
    margin-bottom: 56px;
    min-width: 0;
}

/* Left Column: Product Info */
.product-info {
    display: flex;
    flex-direction: column;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.product-title,
#product-name {
    color: var(--lm-primary) !important;
    font-size: 34px;
    font-weight: 700;
    font-style: normal;
    line-height: 1.12;
    margin: 20px 0 16px 0;
}

.product-description {
    color: #525659;
    font-size: 16px;
    line-height: 1.55;
    background: #f4f5f7;
    padding: 28px;
    min-height: 220px;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.product-description p {
    margin: 10px 0;
}

.product-description ul {
    font-size: 18px;
    margin: 10px 0;
    padding-left: 0;
}

.product-description li {
    list-style: disc inside;
    margin: 6px 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
    transition: all var(--lm-transition);
    text-decoration: none;
}

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

.btn-outline:hover {
    color: #ffffff;
    background-color: var(--lm-primary);
}

.btn-primary {
    color: #ffffff;
    background-color: var(--lm-primary);
    border: 2px solid var(--lm-primary);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-success {
    color: #ffffff;
    background-color: var(--lm-success);
    border: 2px solid var(--lm-success);
}

.btn-success:hover {
    background-color: #047857;
    border-color: #047857;
}

.btn-error {
    color: #ffffff;
    background-color: var(--lm-error);
    border: 2px solid var(--lm-error);
}

.btn-error:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn i {
    font-size: 14px;
}

/* Right Column: Gallery */
.product-gallery {
    display: flex;
    flex-direction: column;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.featured-container {
    border: 1px solid var(--lm-primary);
    overflow: hidden;
    margin-bottom: 12px;
    aspect-ratio: 1 / 1;
    max-width: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-sizing: border-box;
    min-width: 0;
}

.featured-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    max-height: none;
    padding: 16px;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.thumbnails-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thumbnail {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 1px solid #dcdcdc;
    cursor: pointer;
    transition: border-color var(--lm-transition);
}

.thumbnail:hover {
    border-color: var(--lm-primary);
}

.thumbnail.selected {
    border-color: var(--lm-primary);
    box-shadow: 0 0 0 1px var(--lm-primary);
}

.tables-container {
    margin-top: 16px;
    margin-bottom: 56px;
}

.table-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.table-tab {
    border: 1px solid #d7dce8;
    background: #fff;
    color: var(--lm-primary);
    min-width: 110px;
    min-height: 34px;
    padding: 7px 14px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-align: left;
}

.table-tab.active,
.table-tab:hover,
.table-tab:focus-visible {
    background: var(--lm-primary);
    border-color: var(--lm-primary);
    color: #fff;
    outline: none;
}

.table-panel {
    display: none;
}

.table-panel.active {
    display: block;
}

.table-responsive {
    width: 100%;
    max-height: 520px;
    overflow: auto;
    background: #f4f5f7;
    padding: 0;
}

.product-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: inset 0 -1px 0 var(--lm-border);
}

.product-table thead tr.header-icons th {
    top: 0;
    z-index: 4;
}

.product-table thead tr.header-names th {
    top: 0;
}

.product-table thead tr.header-icons + tr.header-names th {
    top: 64px;
}

.related-products-section {
    margin-top: 64px;
    margin-bottom: 72px;
}

.related-products-title {
    margin: 0 0 16px;
    color: var(--lm-primary);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.15;
}

.related-products-grid {
    grid-template-columns: repeat(4, 1fr);
}

.no-images {
    color: var(--lm-text-light);
    font-style: italic;
    padding: 40px;
    text-align: center;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--lm-border);
    border-top-color: var(--lm-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner span {
    color: var(--lm-text-light);
    font-size: 14px;
}

/* Error Message */
.error-message {
    color: var(--lm-accent);
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

/* Responsive Product Detail */
@media screen and (max-width: 1024px) {
    .product-header {
        grid-template-columns: 1fr !important;
        gap: 32px;
    }

    .product-info,
    .product-gallery {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .product-title {
        font-size: 32px;
    }

    .product-description {
        font-size: 16px;
    }

    .product-gallery {
        order: -1;
    }

    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .product-detail {
        width: calc(100% - 96px);
        padding: 20px 0;
        margin-left: auto;
        margin-right: auto;
    }

    .product-title {
        font-size: 28px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .product-description {
        padding: 20px;
        min-height: auto;
    }

    .related-products-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Layout
   ========================================================================== */


/* ==========================================================================
   Downloads Page
   ========================================================================== */

.downloads-page {
    padding-top: 120px;
}

/* Download Section */
.download-section {
    margin-bottom: 48px;
}

.download-section-title {
    color: var(--lm-primary);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Download Grid - 6 columns on large screens */
.download-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
}

/* Download Card */
.download-card {
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    overflow: hidden;
    cursor: pointer;
    transition: background-color var(--lm-transition);
}

.download-card:hover {
    background-color: #eeeeee;
}

/* Thumbnail */
.download-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: #e0e0e0;
}

.download-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--lm-transition);
}

.download-card:hover .download-thumb img {
    transform: scale(1.05);
}

/* Download Link */
.download-link,
.download-title-link {
    display: block;
    text-decoration: none;
}

/* Download Title */
.download-title {
    text-align: center;
    background-color: var(--lm-primary);
    color: #ffffff;
    padding: 12px 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    min-height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.3;
}

/* Download Icon (hidden by default) */
.download-icon {
    display: none;
}

/* Responsive Downloads Grid */
@media screen and (max-width: 1200px) {
    .download-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 992px) {
    .download-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .downloads-page {
        padding-top: 100px;
    }

    .downloads-page .section-title {
        font-size: 36px;
    }

    .download-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .download-section-title {
        font-size: 24px;
    }
}

@media screen and (max-width: 480px) {
    .download-grid {
        grid-template-columns: 1fr;
    }

    .download-title {
        min-height: 60px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Events Page
   ========================================================================== */

/* Hero Banner */
.events-hero {
    width: 100%;
    margin-top: 80px;
}

.events-hero-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Events Page Container */
.events-page {
    padding-top: 40px;
}

/* Events Grid - 2 columns */
.events-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

/* Event Card */
.event-card {
    display: flex;
    flex-direction: row;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.event-card:last-child {
    border-bottom: none;
}

/* Event Image */
.event-image {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    overflow: hidden;
}

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

/* Past Event Styling */
.event-card.past-event .event-image img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.past-event-badge {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--lm-error);
    font-weight: 600;
    font-size: 14px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
}

/* Event Content */
.event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--lm-primary);
    margin: 0 0 8px 0;
}

.event-date {
    font-weight: 600;
    font-size: 16px;
    margin: 4px 0;
    color: #333;
}

.event-location {
    font-style: italic;
    font-size: 16px;
    margin: 4px 0;
    color: #666;
}

.event-link {
    margin-top: 12px;
}

.event-link .btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--lm-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: background-color var(--lm-transition);
}

.event-link .btn:hover {
    background-color: var(--lm-primary-dark, #0056b3);
}

/* Responsive Events */
@media screen and (max-width: 992px) {
    .events-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media screen and (max-width: 768px) {
    .events-hero {
        margin-top: 70px;
    }

    .events-page .section-title {
        font-size: 36px;
    }

    .event-card {
        flex-direction: column;
        gap: 16px;
    }

    .event-image {
        width: 100%;
        height: 250px;
    }

    .event-name {
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) {
    .event-image {
        height: 200px;
    }

    .event-name {
        font-size: 16px;
    }

    .event-date,
    .event-location {
        font-size: 14px;
    }
}

/* ==========================================================================
   Ortho News Page
   ========================================================================== */

.ortho-news-page {
    padding-top: 120px;
}

@media screen and (max-width: 768px) {
    .ortho-news-page {
        padding-top: 100px;
    }
}

/* ==========================================================================
   Publications Page
   ========================================================================== */

.publications-page {
    padding-top: 120px;
}

/* Publication List */
.publication-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.publication-item {
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 16px;
    background-color: #f9f9f9;
    transition: background-color var(--lm-transition);
}

.publication-item:hover {
    background-color: #ffffff;
}

.publication-title {
    font-size: 1.4em;
    margin: 0 0 10px;
    color: var(--lm-primary);
    font-weight: 600;
}

.publication-authors {
    font-style: italic;
    margin-bottom: 6px;
    color: #444;
}

.publication-info {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 8px;
}

.publication-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--lm-primary);
    text-decoration: none;
    font-weight: 600;
}

.publication-link:hover {
    text-decoration: underline;
}

@media screen and (max-width: 768px) {
    .publications-page {
        padding-top: 100px;
    }

    .publication-title {
        font-size: 1.2em;
    }
}

/* ==========================================================================
   Contact Page
   ========================================================================== */

.contact-page {
    padding-top: 120px;
}

/* Contact Info */
.contact-info-row {
    margin-bottom: 40px;
}

.contact-info h3 {
    color: var(--lm-primary);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.contact-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--lm-primary);
}

.contact-info li {
    margin-bottom: 4px;
}

.contact-info a {
    color: var(--lm-primary);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Contact Form */
.contact-form {
    max-width: 700px;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    font-size: 16px;
    transition: border-color var(--lm-transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--lm-primary);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Contact form buttons use global .btn-primary */

/* Form Loading */
.form-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    color: #666;
}

/* Form Messages */
.form-message {
    margin-top: 16px;
    padding: 16px;
    font-size: 15px;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Map Container */
.map-container {
    margin-top: 60px;
}

.map-container iframe {
    display: block;
}

@media screen and (max-width: 768px) {
    .contact-page {
        padding-top: 100px;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
    }

    .map-container {
        margin-top: 40px;
    }
}

/* ==========================================================================
   Authentication Pages (Login, Register)
   ========================================================================== */

.login-page,
.register-page {
    padding-top: 120px;
    display: flex;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    background: #fff;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-container-wide {
    max-width: 650px;
}

.auth-container .section-title {
    color: var(--lm-primary) !important;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--lm-text-light);
    margin-bottom: 32px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    font-size: 16px;
    transition: border-color var(--lm-transition);
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--lm-primary);
}

.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.auth-form .form-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0;
    line-height: 1.4;
}

.auth-form .form-consent span {
    flex: 1 1 auto;
}

.auth-form .form-consent input[type="checkbox"] {
    width: auto;
    margin: 3px 0 0;
    flex: 0 0 auto;
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: color var(--lm-transition);
}

.toggle-password:hover {
    color: #666;
}

.toggle-password.active {
    color: var(--lm-primary);
}

.toggle-password .eye-icon {
    width: 20px;
    height: 20px;
}

/* Auth Links */
.auth-links {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
}

.auth-links p {
    margin: 8px 0;
}

.auth-links a {
    color: var(--lm-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

@media screen and (max-width: 768px) {

    .login-page,
    .register-page {
        padding-top: 100px;
    }

    .auth-container {
        padding: 24px;
        margin: 0 16px;
    }

    .auth-form .form-row {
        grid-template-columns: 1fr;
    }
}
   /*Utilities ========================================================================== */

/* Hide CSV download button (temporary) */
.csv-btn {
    display: none !important;
}

/* Cart Cell - Add to Cart column (riattivata per ordine da pagina prodotto) */
.product-table .cart-header {
    text-align: center;
    min-width: 120px;
}

.product-table .cart-cell {
    text-align: center;
    padding: 8px 12px;
    vertical-align: middle;
}

.product-table .cart-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Quantity Stepper */
.product-table .qty-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--lm-border);
    border-radius: 4px;
    overflow: hidden;
}

.product-table .qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--lm-gray-50);
    color: var(--lm-text);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-table .qty-btn:hover {
    background: var(--lm-gray-200);
}

.product-table .qty-btn:active {
    background: var(--lm-gray-300);
}

.product-table .qty-input {
    width: 40px;
    height: 32px;
    text-align: center;
    padding: 0;
    border: none;
    border-left: 1px solid var(--lm-border);
    border-right: 1px solid var(--lm-border);
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    -moz-appearance: textfield;
}

.product-table .qty-input::-webkit-outer-spin-button,
.product-table .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-table .add-cart-btn {
    background-color: var(--lm-primary);
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--lm-transition), transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-table .add-cart-btn:hover {
    background-color: var(--lm-primary-dark);
    transform: scale(1.05);
}

.product-table .add-cart-btn.added {
    background-color: var(--lm-success);
}

.product-table .add-cart-btn i {
    font-size: 14px;
}
