/**
 * WePresta ACF - Advanced Custom Fields for PrestaShop
 *
 * @author    WePresta
 * @copyright 2024-2025 WePresta
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

/**
 * ACF Front-Office Styles
 *
 * Base styles for ACF fields rendered on the front-office.
 * These can be overridden in your theme's CSS.
 *
 * @author Bruno Studer
 * @copyright 2024 WeCode
 */

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

.acf-field-wrapper {
    margin-bottom: 1rem;
}

.acf-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: inherit;
}

.acf-field-instructions {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ==========================================================================
   TEXT FIELDS
   ========================================================================== */

.acf-text,
.acf-number,
.acf-email,
.acf-select,
.acf-radio {
    display: inline;
}

.acf-textarea {
    white-space: pre-wrap;
}

.acf-richtext {
    line-height: 1.6;
}

.acf-richtext p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   LINK & EMAIL
   ========================================================================== */

.acf-link,
.acf-email {
    color: var(--acf-link-color, #007bff);
    text-decoration: none;
}

.acf-link:hover,
.acf-email:hover {
    text-decoration: underline;
}

/* ==========================================================================
   IMAGE
   ========================================================================== */

.acf-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */

.acf-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.acf-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.acf-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 1;
}

/* ==========================================================================
   VIDEO
   ========================================================================== */

.acf-video {
    position: relative;
    max-width: 100%;
}

.acf-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.acf-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.acf-video video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   FILE
   ========================================================================== */

.acf-file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s;
}

.acf-file:hover {
    background: #e9ecef;
    text-decoration: none;
}

.acf-file-icon {
    font-size: 1.25rem;
}

/* ==========================================================================
   BOOLEAN
   ========================================================================== */

.acf-boolean {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.875rem;
}

.acf-boolean--true {
    background: #28a745;
    color: white;
}

.acf-boolean--false {
    background: #dc3545;
    color: white;
}

/* ==========================================================================
   DATE & TIME
   ========================================================================== */

.acf-date,
.acf-datetime,
.acf-time {
    display: inline;
}

/* ==========================================================================
   COLOR
   ========================================================================== */

.acf-color {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    vertical-align: middle;
}

/* ==========================================================================
   STAR RATING
   ========================================================================== */

.acf-star-rating {
    display: inline-flex;
    gap: 0.125rem;
}

.acf-star {
    font-size: 1.25rem;
    line-height: 1;
}

.acf-star--filled {
    color: #ffc107;
}

.acf-star--empty {
    color: #dee2e6;
}

/* ==========================================================================
   LIST & CHECKBOX
   ========================================================================== */

.acf-list,
.acf-checkbox,
.acf-relations {
    list-style: none;
    padding: 0;
    margin: 0;
}

.acf-list-item,
.acf-checkbox-item,
.acf-relation-item {
    padding: 0.25rem 0;
}

.acf-list-item::before {
    content: "•";
    margin-right: 0.5rem;
    color: #6c757d;
}

/* ==========================================================================
   RELATION
   ========================================================================== */

.acf-relation a,
.acf-relation-item a {
    color: var(--acf-link-color, #007bff);
    text-decoration: none;
}

.acf-relation a:hover,
.acf-relation-item a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   GROUP
   ========================================================================== */

.acf-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.acf-group-field {
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.acf-group-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ==========================================================================
   REPEATER (Notice)
   ========================================================================== */

.acf-repeater-notice {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.acf-hidden {
    display: none !important;
}

.acf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
