/**
 * OT Annuaire Pro - Frontend Styles
 * Version 1.0.2
 * 
 * @package OT_Annuaire_Pro
 */

:root {
    --otap-primary: #E31E24;
    --otap-secondary: #4A7C23;
    --otap-accent: #FFD700;
    --otap-dark: #1a1a1a;
    --otap-grey: #666;
    --otap-light: #f5f5f5;
    --otap-white: #fff;
    --otap-border: #e0e0e0;
    --otap-radius: 8px;
    --otap-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* ===========================================
   ARCHIVE PAGE - CONTAINER
   =========================================== */
.otap-archive {
    padding: 40px 0 80px;
    background: var(--otap-light);
    min-height: 100vh;
}

.otap-archive .ast-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===========================================
   GRILLE RESPONSIVE
   =========================================== */
.otap-grid {
    display: grid;
    gap: 25px;
}

/* Desktop XL (1400px+) */
.otap-grid-4 { 
    grid-template-columns: repeat(4, 1fr); 
}

/* Desktop Large (1200-1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .otap-grid-4 { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 20px;
    }
}

/* Desktop Standard (992-1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .otap-grid-4 { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 20px;
    }
}

/* Tablette (768-991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .otap-grid-4 { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .otap-grid-4 { 
        grid-template-columns: 1fr; 
        gap: 15px;
    }
}

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

@media (max-width: 768px) {
    .otap-grid-2, .otap-grid-3 { grid-template-columns: 1fr; }
}

/* ===========================================
   CARTES PROFESSIONNELS
   =========================================== */
.otap-card {
    background: var(--otap-white);
    border-radius: var(--otap-radius);
    box-shadow: var(--otap-shadow);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.otap-card-featured {
    border: 2px solid var(--otap-accent);
}

/* Badges */
.otap-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.otap-badge-featured {
    background: var(--otap-accent);
}

.otap-badge-verified {
    background: var(--otap-secondary);
    color: var(--otap-white);
    right: 50px;
}

/* Lien carte entière */
.otap-card-link {
    display: block;
    text-decoration: none;
}

/* Image carte */
.otap-card-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.otap-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    background: var(--otap-white);
}

/* ===========================================
   ICÔNES PAR CATÉGORIE (si pas d'image)
   =========================================== */
.otap-card-icon {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Couleurs de fond par catégorie */
.otap-card-icon[data-category="constructeur"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.otap-card-icon[data-category="concessionnaire"] {
    background: linear-gradient(135deg, #E31E24 0%, #c91a1f 100%);
}
.otap-card-icon[data-category="reparateur"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.otap-card-icon[data-category="pieces-detachees"] {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.otap-card-icon[data-category="location"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.otap-card-icon[data-category="negoce"] {
    background: linear-gradient(135deg, #4A7C23 0%, #6db33f 100%);
}
.otap-card-icon[data-category="equipementier"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.otap-card-icon[data-category="pneumaticien"] {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}
.otap-card-icon[data-category="services"] {
    background: linear-gradient(135deg, #FFD700 0%, #f0b849 100%);
}
.otap-card-icon[data-category="default"],
.otap-card-icon:not([data-category]) {
    background: linear-gradient(135deg, #bdbdbd 0%, #9e9e9e 100%);
}

.otap-icon-emoji {
    font-size: 64px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* Contenu carte */
.otap-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.otap-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.otap-card-title a {
    color: var(--otap-dark);
    text-decoration: none;
}

.otap-card-title a:hover {
    color: var(--otap-primary);
}

.otap-card-contact {
    color: var(--otap-grey);
    font-size: 13px;
    margin: 0 0 6px 0;
}

.otap-card-location {
    color: var(--otap-grey);
    font-size: 13px;
    margin: 0 0 12px 0;
}

.otap-card-categories {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    margin-top: auto;
}

.otap-card-cat {
    background: var(--otap-light);
    color: var(--otap-grey);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ===========================================
   BOUTONS
   =========================================== */
.otap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.otap-btn-primary {
    background: var(--otap-primary);
    color: var(--otap-white) !important;
}

.otap-btn-primary:hover {
    background: #c91a1f;
    color: var(--otap-white) !important;
}

.otap-btn-secondary {
    background: var(--otap-secondary);
    color: var(--otap-white);
}

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

.otap-btn-outline:hover {
    background: var(--otap-primary);
    color: var(--otap-white) !important;
}

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

.otap-btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.otap-btn-block {
    width: 100%;
    text-align: center;
}

/* ===========================================
   FORMULAIRE DE RECHERCHE
   =========================================== */
.otap-search-form {
    background: var(--otap-white);
    padding: 25px 30px;
    border-radius: var(--otap-radius);
    box-shadow: var(--otap-shadow);
    margin-bottom: 30px;
}

.otap-search-row {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.otap-search-field {
    display: flex;
    flex-direction: column;
}

.otap-search-text {
    flex: 2;
    min-width: 200px;
}

.otap-search-select {
    flex: 1;
    min-width: 160px;
}

.otap-search-form input[type="text"],
.otap-search-form select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--otap-border);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    height: 52px;
    box-sizing: border-box;
}

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

.otap-search-form .otap-btn {
    height: 52px;
    white-space: nowrap;
}

/* Responsive recherche */
@media (max-width: 1200px) {
    .otap-search-row {
        flex-wrap: wrap;
    }
    .otap-search-text {
        flex: 1 1 100%;
    }
    .otap-search-select {
        flex: 1 1 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .otap-search-form {
        padding: 20px;
    }
    .otap-search-row {
        flex-direction: column;
    }
    .otap-search-text,
    .otap-search-select {
        width: 100%;
        flex: none;
    }
    .otap-search-form .otap-btn {
        width: 100%;
    }
}

/* Filtres actifs */
.otap-active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: var(--otap-white);
    border-radius: 6px;
    font-size: 14px;
}

.otap-filter-tag {
    background: var(--otap-primary);
    color: var(--otap-white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.otap-clear-filters {
    color: var(--otap-grey);
    text-decoration: none;
    margin-left: auto;
}

.otap-clear-filters:hover {
    color: var(--otap-primary);
}

/* ===========================================
   HEADER ARCHIVE
   =========================================== */
.otap-archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.otap-archive-title {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: var(--otap-dark);
}

.otap-archive-description {
    color: var(--otap-grey);
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .otap-archive-header {
        margin-bottom: 25px;
    }
    .otap-archive-title {
        font-size: 28px;
    }
    .otap-archive-description {
        font-size: 16px;
    }
}

/* Compteur résultats */
.otap-results-count {
    color: var(--otap-grey);
    margin-bottom: 20px;
    font-size: 15px;
}

/* ===========================================
   PAGINATION
   =========================================== */
.otap-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.otap-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    background: var(--otap-white);
    border: 2px solid var(--otap-border);
    border-radius: 6px;
    color: var(--otap-dark);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.otap-pagination .page-numbers:hover,
.otap-pagination .page-numbers.current {
    background: var(--otap-primary);
    border-color: var(--otap-primary);
    color: var(--otap-white);
}

/* ===========================================
   CTA SECTION
   =========================================== */
.otap-cta-section {
    margin-top: 60px;
}

.otap-cta-box {
    background: linear-gradient(135deg, var(--otap-secondary) 0%, #3d6a1d 100%);
    padding: 50px;
    border-radius: 16px;
    text-align: center;
}

.otap-cta-box h2 {
    color: var(--otap-white);
    font-size: 28px;
    margin: 0 0 15px 0;
}

.otap-cta-box p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 17px;
    margin-bottom: 25px;
}

.otap-btn-cta {
    background: var(--otap-accent);
    color: var(--otap-dark) !important;
    font-weight: 700;
    padding: 16px 32px;
}

.otap-btn-cta:hover {
    background: #e6c200;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .otap-cta-box {
        padding: 30px 20px;
    }
    .otap-cta-box h2 {
        font-size: 22px;
    }
}

/* No results */
.otap-no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--otap-white);
    border-radius: var(--otap-radius);
}

.otap-no-results p {
    color: var(--otap-grey);
    font-size: 18px;
    margin-bottom: 20px;
}

/* ===========================================
   PAGE SINGLE
   =========================================== */
.otap-single {
    padding: 40px 0 80px;
}

.otap-single .ast-container {
    max-width: 1200px;
}

.otap-single-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 50px;
}

.otap-single-header {
    margin-bottom: 40px;
}

/* Logo / Photo entreprise */
.otap-single-logo {
    margin-bottom: 25px;
}

.otap-company-logo {
    max-width: 220px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--otap-radius);
    box-shadow: var(--otap-shadow);
    background: var(--otap-white);
    padding: 20px;
}

/* Icône par défaut single */
.otap-single-icon {
    width: 120px;
    height: 120px;
    border-radius: var(--otap-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.otap-single-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.2;
    color: var(--otap-dark);
}

.otap-single-contact {
    font-size: 18px;
    color: var(--otap-grey);
    margin: 0 0 20px 0;
}

/* Badges inline */
.otap-badge-inline {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 10px;
    margin-bottom: 15px;
}

.otap-badge-inline.otap-badge-featured {
    background: var(--otap-accent);
    color: var(--otap-dark);
}

.otap-badge-inline.otap-badge-verified {
    background: var(--otap-secondary);
    color: var(--otap-white);
}

/* Catégories inline */
.otap-categories-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.otap-category-badge {
    background: var(--otap-light);
    color: var(--otap-grey);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
}

.otap-category-badge:hover {
    background: var(--otap-primary);
    color: var(--otap-white);
}

.otap-section {
    margin-bottom: 40px;
}

.otap-section h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--otap-primary);
    color: var(--otap-dark);
}

/* Sidebar */
.otap-single-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.otap-contact-card {
    background: var(--otap-white);
    padding: 30px;
    border-radius: var(--otap-radius);
    box-shadow: var(--otap-shadow);
    margin-bottom: 20px;
}

.otap-contact-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 25px 0;
    color: var(--otap-dark);
}

.otap-contact-item {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.otap-contact-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.otap-contact-item a {
    color: var(--otap-dark);
    text-decoration: none;
    word-break: break-word;
}

.otap-contact-item a:hover {
    color: var(--otap-primary);
}

/* Premium lock */
.otap-premium-lock {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.otap-lock-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.otap-premium-lock p {
    color: var(--otap-grey);
    margin-bottom: 15px;
    font-size: 14px;
}

/* Responsive Single */
@media (max-width: 1024px) {
    .otap-single-grid {
        grid-template-columns: 1fr 320px;
        gap: 40px;
    }
}

@media (max-width: 900px) {
    .otap-single-grid {
        grid-template-columns: 1fr;
    }
    .otap-single-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .otap-single-title {
        font-size: 28px;
    }
}

/* ===========================================
   BREADCRUMB
   =========================================== */
.otap-breadcrumb {
    font-size: 14px;
    margin-bottom: 30px;
    color: var(--otap-grey);
}

.otap-breadcrumb a {
    color: var(--otap-primary);
    text-decoration: none;
}

.otap-breadcrumb a:hover {
    text-decoration: underline;
}

.otap-breadcrumb span {
    margin: 0 8px;
}

.otap-breadcrumb .current {
    color: var(--otap-dark);
}

/* ===========================================
   SHORTCODES - CATEGORIES LIST
   =========================================== */
.otap-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.otap-category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--otap-white);
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: var(--otap-shadow);
    text-decoration: none;
    color: var(--otap-dark);
    transition: all 0.3s ease;
}

.otap-category-item:hover {
    transform: translateY(-2px);
    color: var(--otap-primary);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.otap-category-count {
    background: var(--otap-primary);
    color: var(--otap-white);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Stats */
.otap-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 40px;
    background: var(--otap-white);
    border-radius: var(--otap-radius);
    box-shadow: var(--otap-shadow);
}

.otap-stat {
    text-align: center;
}

.otap-stat-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--otap-primary);
    line-height: 1;
}

.otap-stat-label {
    color: var(--otap-grey);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .otap-stats {
        flex-direction: column;
        gap: 30px;
        padding: 30px;
    }
    .otap-stat-number {
        font-size: 36px;
    }
}

/* ===========================================
   SOCIAL LINKS
   =========================================== */
.otap-social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.otap-social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--otap-light);
    border-radius: 6px;
    color: var(--otap-dark);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

.otap-social-link:hover {
    background: var(--otap-primary);
    color: var(--otap-white);
}

/* ===========================================
   MARQUES
   =========================================== */
.otap-marques-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.otap-marque-tag {
    background: var(--otap-secondary);
    color: var(--otap-white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
}

/* ===========================================
   INFO GRID
   =========================================== */
.otap-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.otap-info-item {
    background: var(--otap-light);
    padding: 15px;
    border-radius: 6px;
}

.otap-info-label {
    display: block;
    font-size: 12px;
    color: var(--otap-grey);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.otap-info-value {
    font-weight: 600;
    color: var(--otap-dark);
}

@media (max-width: 480px) {
    .otap-info-grid {
        grid-template-columns: 1fr;
    }
}
