/*
Theme Name: Magali Bardos
Theme URI: https://magalibardos.com
Author: Cédric Bidet
Author URI: https://magalibardos.com
Description: Custom theme for author-illustrator Magali Bardos - Elementor and WooCommerce compatible
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: magalibardos
Tags: elementor, woocommerce, custom-menu, custom-logo, featured-images
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: black;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Full width container for Elementor full-width templates */
body.elementor-template-full-width .site-content .container {
    max-width: 100%;
    width: 100%;
    padding: 0;
}

/* Header & Sticky Menu */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    height: 120px;
    transition: height 0.3s ease, padding 0.3s ease;
    display: flex;
    align-items: center;
}

.site-header .container {
    max-width: 1140px;
    width: 100%;
    height: 100%;
}

.site-header.scrolled {
    height: 55px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

.site-logo {
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.site-logo a {
    color: #333;
    display: flex;
    align-items: center;
    height: 100%;
}

.site-logo img {
    height: 100%;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Navigation */
.main-navigation {
    margin-left: auto;
    font-size: 14px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-navigation a {
    color: #878787;
}

.main-navigation a:hover {
    color: #333;
}

.main-navigation .current-menu-item > a {
    color: #000;
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current-menu-parent > a {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

/* Header Cart Button */
.header-cart {
    margin-left: 20px;
    flex-shrink: 0;
}

.cart-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #333;
    transition: color 0.3s ease;
}

.cart-button:hover {
    color: #000;
    opacity: 1;
}

.cart-button svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.cart-button:hover svg {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #333;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.cart-count:empty {
    display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: #fff !important;
    color: #333 !important;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.menu-toggle:hover {
    background: #fff !important;
    color: #000 !important;
}

/* Content */
.site-content {
    min-height: calc(100vh - 200px);
    padding: 120px 0 40px 0;
}

/* Page Full Width */
.page-full-width {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

.page-full-width .page-body {
    width: 100%;
}

.page-full-width .page-thumbnail {
    width: 100%;
}

.page-full-width .page-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Footer */
.site-footer {
    background: #f4f4f4;
    padding: 40px 0;
    text-align: center;
    font-size: 10px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-menu ul {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-info {
    font-size: 14px;
    color: #666;
}

/* Archive Grid (Custom Post Types) */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

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

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

.archive-item {
    position: relative;
    overflow: hidden;
}

.archive-item-image {
    height: 300px;
    overflow: hidden;
}

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

.archive-item:hover .archive-item-image img {
    filter: brightness(0.3);
}
.archive-item:hover .archive-item-title {
    opacity: 1;
}

.archive-item-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.archive-item-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin: 0;
    opacity: 0;
}

/* WooCommerce - Category Grid */
.woocommerce-shop-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.category-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
}

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

.category-title {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6); /* fond blanc semi-transparent */
    color: #000000;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.category-item:hover .category-title {
    opacity: 1;
}

/* Page Templates */
.full-width-content {
    max-width: 100%;
    padding: 0;
}

.full-width-content .page-body {
    margin: 0;
}

/* Search Results */
.search-results-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.search-result-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.search-result-thumbnail {
    flex-shrink: 0;
    width: 200px;
}

.search-result-thumbnail img {
    border-radius: 4px;
}

.search-result-content {
    flex-grow: 1;
}

.search-result-title a {
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.search-result-excerpt {
    margin: 15px 0;
    color: #666;
}

.read-more {
    display: inline-block;
    color: #333;
    font-weight: 600;
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

/* 404 Error Page */
.error-404-content {
    text-align: center;
    padding: 80px 20px;
}

.error-404-content .page-title {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-404-content .page-content {
    max-width: 600px;
    margin: 0 auto;
}

.error-404-content .button {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    margin-top: 20px;
}

.error-404-content .button:hover {
    background: #000;
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 40px 0;
    padding: 30px 0;
    border-top: 1px solid #e0e0e0;
}

.post-navigation a {
    color: #333;
    font-weight: 600;
}

.nav-previous,
.nav-next {
    max-width: 45%;
}

/* Pagination */
.pagination {
    margin: 40px 0;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 10px;
}

.pagination a,
.pagination span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.pagination .current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Buttons */
.button,
button[type="submit"] {
    background: black;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.button:hover,
button[type="submit"]:hover {
    background: #000;
    opacity: 1;
}

/* Contact Form 7 */
.wpcf7 form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wpcf7 form p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wpcf7 form label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #000;
}

.wpcf7 form input[type="text"],
.wpcf7 form input[type="email"],
.wpcf7 form input[type="tel"],
.wpcf7 form input[type="url"],
.wpcf7 form input[type="number"],
.wpcf7 form input[type="search"],
.wpcf7 form input[type="date"],
.wpcf7 form select,
.wpcf7 form textarea {
    width: 100%;
    border: 1.5px solid #000;
    border-radius: 0;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    color: #000;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.wpcf7 form textarea {
    min-height: 180px;
    resize: vertical;
}

.wpcf7 form input[type="text"]:focus,
.wpcf7 form input[type="email"]:focus,
.wpcf7 form input[type="tel"]:focus,
.wpcf7 form input[type="url"]:focus,
.wpcf7 form input[type="number"]:focus,
.wpcf7 form input[type="search"]:focus,
.wpcf7 form input[type="date"]:focus,
.wpcf7 form select:focus,
.wpcf7 form textarea:focus {
    outline: none;
    box-shadow: 3px 3px 0 #000;
}

.wpcf7 form input[type="submit"],
.wpcf7 form button[type="submit"] {
    align-self: flex-start;
    background: #000;
    color: #fff;
    padding: 14px 36px;
    border: 1.5px solid #000;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease;
}

.wpcf7 form input[type="submit"]:hover,
.wpcf7 form button[type="submit"]:hover {
    background: #fff;
    color: #000;
    opacity: 1;
}

.wpcf7-response-output {
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 1.5px solid #000 !important;
    border-radius: 0 !important;
    font-size: 14px;
}

/* Title and text style for Creations */
.creation-template h1 {
    font-size:24px;
}
.creation-template h2 {
    font-size:10px;
    margin-top: 10px;
    margin-bottom: 10px;
}
.creation-template .elementor-widget-text-editor {
    font-size: 14px;
}

/* Post Navigation for Creations */
.creation-navigation.e-con {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 40px 20px;
    display: block;
}

.creation-navigation.e-con .e-con-inner {
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

/* Lateral navigation buttons for single creation */
.creation-lateral-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
}

.creation-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.creation-nav-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    color: #000;
}

.creation-nav-prev {
    left: 16px;
}

.creation-nav-next {
    right: 16px;
}

.creation-nav-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .header-inner {
        position: relative;
    }

    /* Cart button en mobile - position fixe en bas à droite */
    .header-cart {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1001;
        margin-left: 0;
    }

    .cart-button {
        background: #333;
        color: #fff;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        padding: 12px;
    }

    .cart-button:hover {
        color: #fff;
        background: #000;
    }

    .cart-button svg {
        width: 32px;
        height: 32px;
    }

    .cart-count {
        top: -4px;
        right: -4px;
        width: 22px;
        height: 22px;
        font-size: 12px;
        border: 2px solid #fff;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .main-navigation.is-active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        padding: 20px;
    }
    
    .archive-grid.columns-2,
    .archive-grid.columns-3 {
        grid-template-columns: 1fr;
    }
    
    .search-result-item {
        flex-direction: column;
    }
    
    .search-result-thumbnail {
        width: 100%;
    }
    
    .post-navigation {
        flex-direction: column;
    }
    
    .nav-previous,
    .nav-next {
        max-width: 100%;
    }

    .creation-nav-btn {
        width: 36px;
        height: 36px;
        /* Remonte légèrement pour éviter le bouton panier fixe en bas à droite */
        top: 42%;
    }

    .creation-nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .creation-nav-prev {
        left: 8px;
    }

    .creation-nav-next {
        right: 8px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .archive-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}



/* Carousel Lightbox */
.elementor-widget-media-carousel .elementor-carousel-image {
    cursor: zoom-in;
}

#carousel-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
}

#carousel-lightbox.is-active {
    display: flex;
}

.lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
    background: none;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 48px;
    line-height: 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-prev.is-hidden,
.lightbox-next.is-hidden {
    display: none;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 38px;
        height: 38px;
        font-size: 32px;
    }

    .lightbox-prev {
        left: 6px;
    }

    .lightbox-next {
        right: 6px;
    }
}

/* Carte */
.creation-card .elementor-post {
  position: relative;
  overflow: hidden;
}

/* Zone titre (overlay) */
.elementor-posts-container .elementor-post{
    position: relative;
}
.creation-template .elementor-portfolio-item:hover a .elementor-portfolio-item__overlay {
    opacity: 1;
    color: black;
}
.creation-template .elementor-portfolio-item:hover a .elementor-portfolio-item__overlay .elementor-portfolio-item__title {
    color: black;
}
.creation-template .elementor-portfolio-item a .elementor-portfolio-item__overlay,
.elementor-posts-container .elementor-post__text,
.creation-card .elementor-post__text {
  position: absolute;
  inset: 0;
  display: flex !important;
  align-items: center;      /* centrage vertical */
  justify-content: center;  /* centrage horizontal */
  background: rgba(255, 255, 255, 0.9); /* fond blanc semi-transparent */
  color: #000000;
  font-size: 1.2rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
  pointer-events: none;
  flex-direction: row;
}
.elementor-posts-container.elementor-posts .elementor-post__meta-data,
.elementor-posts-container.elementor-posts .elementor-post__excerpt * {
    color: black;
}
.elementor-posts-container.elementor-posts .elementor-post__meta-data {
    font-size: 12px;
}
.elementor-grid-3 .elementor-posts .elementor-post__title {
    font-size:14px;
}

/* Apparition au hover */
.elementor-posts-container .elementor-post:hover .elementor-post__text,
.creation-card .elementor-post:hover .elementor-post__text {
  opacity: 1;
  color: black;
}
.elementor-widget-posts .elementor-post__title, .elementor-widget-posts .elementor-post__title a {
    color: black !important;
}
.elementor-posts-container .elementor-post__thumbnail__link,
.creation-card .elementor-post__thumbnail__link {
    margin-bottom: 0 !important;
}


/* sliders */
.elementor-widget-slides .swiper-slide-inner {
    max-width: 1200px;
}

/* default text display */
.elementor .elementor-widget-text-editor a {
    text-decoration: underline;
}
