/**
 * AmourCatho - Modern Theme
 * Design moderne et attractif pour l'application
 */

:root {
    /* Couleurs principales - Modifiables depuis l'admin */
    --primary-color: #9c2759;
    --primary-dark: #7d1e47;
    --primary-light: #b83268;
    --secondary-color: #f97316;
    --secondary-dark: #ea580c;

    /* Couleurs système */
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Espacements */
    --header-height: 80px;
    --container-max: 1320px;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--frontend-body-font, 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: var(--frontend-body-size, 16px);
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--white);
}

/* Titres */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--frontend-heading-font, 'Montserrat', sans-serif);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: var(--frontend-heading-size, 48px);
}

h2 {
    font-size: calc(var(--frontend-heading-size, 48px) * 0.75);
}

h3 {
    font-size: calc(var(--frontend-heading-size, 48px) * 0.625);
}

h4 {
    font-size: calc(var(--frontend-heading-size, 48px) * 0.5);
}

h5 {
    font-size: calc(var(--frontend-heading-size, 48px) * 0.417);
}

h6 {
    font-size: calc(var(--frontend-heading-size, 48px) * 0.375);
}

/* Header moderne */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

.modern-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

.header-logo:hover {
    opacity: 0.8;
}

.header-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

/* Mobile auth buttons (hidden on desktop) */
.mobile-auth-buttons {
    display: none;
}

/* Navigation principale */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
    position: relative;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

/* Dropdown menu */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1100;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* Actions header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-cta {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(249, 115, 22, 0.4);
    animation: pulse-cta 2s infinite;
}

.btn-cta:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(249, 115, 22, 0.5);
}

@keyframes pulse-cta {

    0%,
    100% {
        box-shadow: 0 4px 14px 0 rgba(249, 115, 22, 0.4);
    }

    50% {
        box-shadow: 0 6px 20px 0 rgba(249, 115, 22, 0.6);
    }
}

.btn-outline {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Dropdown utilisateur */
.user-dropdown {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.user-dropdown:hover .user-dropdown-menu,
.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.user-dropdown-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.user-dropdown-email {
    font-size: 13px;
    color: var(--text-muted);
}

.user-dropdown-body {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
}

.user-dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.user-dropdown-item i {
    font-size: 16px;
    width: 20px;
}

.user-dropdown-item .panier-badge {
    margin-left: auto;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Hero Section */
.hero-section {
    margin-top: var(--header-height);
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(156, 39, 89, 0.85), rgba(125, 30, 71, 0.75));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 80px 24px;
    text-align: center;
}

.hero-greeting {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 27px;
    margin-bottom: 10px;
    opacity: 0.92;
    letter-spacing: 0.3px;
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.2;
    color: #FAD093;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 48px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Box */
.hero-search {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    max-width: 1000px;
    margin: 0 auto;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.btn-search {
    white-space: nowrap;
    height: fit-content;
    margin-top: auto;
    padding: 12px 20px;
}

.btn-visit {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-visit:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-visit:disabled {
    border-color: #ccc;
    color: #aaa;
}

.search-btn-group {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    align-self: end;
}

.search-btn-group .btn-search {
    margin-top: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(156, 39, 89, 0.1);
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Autocomplete styles */
.search-autocomplete-wrapper {
    position: relative;
}

.search-autocomplete-input {
    padding-right: 40px;
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    list-style: none;
    padding: 8px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.autocomplete-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.autocomplete-item:hover {
    background: var(--bg-light);
    transform: translateX(4px);
}

.autocomplete-item:last-child {
    margin-bottom: 0;
}

.autocomplete-item-main {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    font-size: 15px;
}

.autocomplete-item-sub {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.autocomplete-item-sub i {
    font-size: 12px;
    color: var(--primary-color);
}

.btn-search {
    align-self: flex-end;
    padding: 12px 32px;
    white-space: nowrap;
}

.btn-search:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    opacity: 1;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    animation: none !important;
}

.btn-search:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: #e5e7eb !important;
}

/* Section containers */
.section {
    padding: 40px 24px;
}

.section-light {
    background: var(--bg-light);
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-muted);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.card-badge i {
    color: var(--secondary-color);
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.card-text {
    color: var(--text-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Carousel */
.carousel-container {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s ease;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: white;
}

.carousel-btn-prev {
    left: -24px;
}

.carousel-btn-next {
    right: -24px;
}

/* Footer */
.modern-footer {
    background: var(--text-dark);
    color: white;
    padding: 60px 24px 24px;
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .main-nav.active {
        max-height: 500px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-top: 8px;
        margin-left: 16px;
        display: none;
    }

    .nav-dropdown.active .dropdown-menu {
        display: block;
    }

    .mobile-auth-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
    }

    .mobile-auth-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Réduire le logo en mobile */
    .header-logo {
        font-size: 18px;
        gap: 8px;
    }

    .header-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Garder le bouton CTA visible mais masquer les boutons auth et user dropdown */
    .header-actions .btn-outline,
    .header-actions .btn-primary,
    .header-actions .user-dropdown {
        display: none;
    }

    .header-actions {
        gap: 8px;
    }

    .header-actions .btn-cta {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .header-actions .btn-cta i {
        font-size: 14px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .btn-search {
        width: 100%;
        justify-content: center;
    }

    .autocomplete-results {
        max-height: 250px;
    }

    .hero-search {
        padding: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .hero-title {
        font-size: 40px;
    }
}

@media (max-width: 768px) {
    .hero-search {
        padding: 24px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}