/**
 * Public styles for OptiSud Suppliers plugin.
 *
 * @package OptiSud_Suppliers
 */

/* CSS Variables */
:root {
    --osf-text-light: #ffffff;
    --osf-box-padding: 20px;
    --osf-box-radius: 15px;
}

/* Match Flatsome font family */
.osf-suppliers-wrapper,
.osf-suppliers-wrapper * {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Suppliers Wrapper - Match Flatsome page-wrapper width */
.osf-suppliers-wrapper {
    max-width: 1365px;
    margin: 0 auto;
    padding-top: 0px;
    padding-bottom: 20px;
}

/* Extra bottom padding for category pages */
.osf-suppliers-wrapper.osf-category-page {
    padding-bottom: 30px;
}

/* Page Header - Full width blue banner */
.osf-page-header {
    margin: 0;
    padding: 20px 15px 20px 15px;
    background-color: #0052a1;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
    border-radius: 0 0 10px 10px;
    margin-bottom: 40px;
}

.osf-page-title {
    font-size: 22px;
    margin: 0;
    color: #ffffff;
    text-align: left;
    font-family: Inter, sans-serif;
    font-weight: 300;
    line-height: 1.2;
}

/* Categories Grid - Main page */
.osf-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 20px;
}

/* Category Card */
.osf-category-card {
    position: relative;
    display: block;
    padding: 40px 30px;
    border-radius: var(--osf-box-radius);
    color: var(--osf-text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;

    /* Same background texture as supplier boxes */
    background-image: url('https://optisud.fr/wp-content/uploads/2025/11/bg.png');
    background-repeat: repeat;
    background-size: auto;
    background-position: 0 0;
    background-blend-mode: overlay;
}

.osf-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--osf-text-light);
}

.osf-category-card-title {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 12px;
    color: #ffffff;
}

.osf-category-card-description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    opacity: 0.9;
}

.osf-category-card-count {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.osf-category-card-arrow {
    position: absolute;
    right: 25px;
    bottom: 25px;
    font-size: 28px;
    font-weight: 300;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.osf-category-card:hover .osf-category-card-arrow {
    transform: translateX(5px);
    opacity: 1;
}

/* Category Header - Individual category pages */
.osf-category-header {
    margin: 0;
    padding: 20px 15px 20px 15px;
    background-color: #0052a1;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
    border-radius: 0 0 10px 10px;
    margin-bottom: 30px;
}

.osf-back-link {
    display: inline-block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.osf-back-link:hover {
    color: #ffffff;
}

/* Category Section */
.osf-category-section {
    margin-bottom: 50px;
}

.osf-category-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: left;
    color: #333333;
    line-height: 1.3;
}

/* Category title on category archive pages (in blue header) */
.osf-category-header .osf-category-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 300;
    margin: 0;
    line-height: 1.2;
}

/* Category description in header */
.osf-category-header .osf-category-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Suppliers Grid - Single column full-width layout like Flatsome */
.osf-suppliers-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Supplier Box - Full width with texture background */
.osf-supplier-box {
    padding: var(--osf-box-padding);
    border-radius: var(--osf-box-radius);
    color: var(--osf-text-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    width: 100%;

    /* Same background texture as the original Flatsome page */
    background-image: url('https://optisud.fr/wp-content/uploads/2025/11/bg.png');
    background-repeat: repeat;
    background-size: auto;
    background-position: 0 0;
    background-blend-mode: overlay;

    line-height: 1.6;
}

.osf-supplier-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Supplier Box with Logo - Flexbox layout for image on left */
.osf-supplier-box.has-logo {
    display: flex;
    align-items: stretch;
    gap: 25px;
}

/* Supplier Logo - Left side */
.osf-supplier-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.osf-supplier-logo img {
    width: 210px;
    height: 170px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Supplier Content */
.osf-supplier-content {
    flex: 1;
    min-width: 0;
}

/* Supplier Name */
.osf-supplier-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
    line-height: 1.3;
}

.osf-premium-badge {
    font-size: 18px;
    color: #ffd700;
    margin-left: 5px;
}

/* Supplier Description */
.osf-supplier-description {
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 15px;
    opacity: 0.95;
}

.osf-supplier-description p {
    margin-bottom: 8px;
}

.osf-supplier-description p:last-child {
    margin-bottom: 0;
}

/* Supplier Contact */
.osf-supplier-contact {
    margin-bottom: 15px;
    font-size: 16px;
}

.osf-contact-item {
    margin-bottom: 4px;
}

.osf-supplier-contact a {
    color: #ffffff;
    text-decoration: none;
}

.osf-supplier-contact a:hover {
    text-decoration: none;
    color: #ffffff;
}

/* Supplier Links */
.osf-supplier-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.osf-link-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 99px;
    color: #000000;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    line-height: 1.4;
    letter-spacing: 0.02em;
}
/* 
.osf-link-button:hover {
    box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .2);
    color: #fff;
    opacity: 1;
    outline: none;
} */

/* No suppliers message */
.osf-no-suppliers {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .osf-page-title {
        font-size: 28px;
    }

    .osf-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .osf-category-card {
        padding: 30px 20px;
    }

    .osf-category-card-title {
        font-size: 20px;
    }

    .osf-category-title {
        font-size: 22px;
    }

    .osf-supplier-name {
        font-size: 16px;
    }

    /* Stack logo on top for tablet */
    .osf-supplier-box.has-logo {
        flex-direction: column;
        gap: 15px;
    }

    .osf-supplier-logo {
        justify-content: flex-start;
    }

    .osf-supplier-logo img {
        max-width: 140px;
        max-height: 100px;
    }
}

@media (max-width: 480px) {
    .osf-suppliers-wrapper {
        padding: 20px 15px;
    }

    .osf-page-title {
        font-size: 24px;
    }

    .osf-categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .osf-category-section {
        margin-bottom: 35px;
    }

    .osf-suppliers-grid {
        gap: 15px;
    }

    .osf-supplier-box {
        padding: 15px;
    }

    /* Enlarge and center supplier logos on mobile */
    .osf-supplier-logo {
        width: 100%;
        justify-content: center;
        padding: 0;
        margin-bottom: 15px;
    }

    .osf-supplier-logo img {
        width: 300px;
        height: 240px;
        max-width: none;
        max-height: none;
    }

    .osf-category-card {
        padding: 25px 20px;
    }

    /* Mobile-specific header styles */
    .osf-page-header {
        background-color: #468dcb !important;
        border-radius: 0 0 30px 30px;
        margin: -40px -30px 40px -30px;
        padding: 20px;
        padding-top: 40px;
        text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
        font-size: 1.4em;
        text-align: center;
    }

    .osf-page-header .osf-page-title {
        text-align: center;
        font-size: 20px
    }

    .osf-category-header {
        background-color: #468dcb !important;
        border-radius: 0 0 30px 30px;
        margin: -40px -30px 40px -30px;
        padding: 18px;
        text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
        text-align: center;
    }
    .osf-category-header h1 {
        text-align: center;
        font-size: 18px
    }

    .osf-category-header .osf-category-title {
        font-size: 18px
    }

    .osf-back-link {
        margin-top: 15px;
    }

    /* Adjust text sizes on mobile */
    .osf-supplier-name {
        font-size: 19px;
    }

    .osf-supplier-description {
        font-size: 15px;
        line-height: 1.65;
    }

    .osf-supplier-contact {
        font-size: 15px;
    }

    .osf-link-button {
        font-size: 13px;
        padding: 8px 18px;
    }
}
