/* ============================================================
   mod_caw_se — Styles complets
   Reproduction J3.10 + corrections J6.1
   ============================================================ */

/* ============================================================
   1. TABLEAUX (task 1 : Stock Exchange)
   ============================================================ */

#caw-se {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
}

#caw-se table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 20px;
}

#caw-se th,
#caw-se td {
    padding: 8px 10px;
    border: 1px solid #4fc7bf;
    vertical-align: middle;
    font-size: 22px;
    height: 1.5em;
    line-height: 1.5em;
}

#caw-se table td {
    text-align: center;
    color: #009688;
}

#caw-se table th {
    text-align: center;
    background: #e0f7fa;
    font-weight: bold;
}

#caw-se .se_title {
    font-size: 26px !important;
    font-weight: bold !important;
    color: #FF9800 !important;
}

#caw-se table td img,
form#caw-se-2 table td img {
    width: -webkit-fill-available;
}

#caw-se input[type="text"],
#caw-se1 input[type="text"] {
    width: 70%;
    padding: 5px 0;
    border: 1px solid #4fc7bf;
    background: #e7fff2;
}

/* ============================================================
   2. FORMULAIRE DE RECHERCHE
   ============================================================ */

#caw-se form table,
#caw-se1 form table {
    margin-top: 15px;
}

form select,
form input[type="date"] {
    width: 100% !important;
    margin: 5px !important;
    padding: 5px 0 !important;
}

form select,
form input {
    font-size: 16px !important;
    height: auto !important;
}

#caw-se form input.button,
#caw-se1 form input.button {
    background: #2a69b8;
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 4px;
}

#caw-se form input.button:hover,
#caw-se1 form input.button:hover {
    background: #1f518f;
}

/* Couleurs des catégories dans les <select> */
form select .cat_g1 { background: rgba(243, 255, 179, 0.5); } /* fruit */
form select .cat_g2 { background: rgba(107, 150, 56, 0.5); }  /* plant */
form select .cat_g3 { background: rgba(3, 169, 244, 0.5); }   /* sea   */
form select .cat_g4 { background: rgba(255, 193, 7, 0.5); }   /* milk  */
form select .cat_g5 { background: rgba(255, 87, 34, 0.5); }   /* meat  */

/* ============================================================
   3. GRAPHIQUE (Chart.js — task 1)
   ============================================================ */

.cse_canvas {
    width: 100%;
    max-width: 1200px;                 /* ⬆️ Agrandi de 900 à 1200px */
    display: block;
    
    /* ✅ Filigrane CAW centré */
    background-image: url('./../../../images/caw_se/caw18logo2019bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: auto;       /* Taille du filigrane */
}

canvas {
    background-image: url('./../../../images/caw_se/caw18logo2019bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: auto;
}

/* ============================================================
   4. TEXTES DE PAGE (task 1 & 2)
   ============================================================ */

[class*="se_page_l"] {
    text-align: center !important;
    font-weight: bold;
}

.se_page_l1 { font-size: 1.3em; margin-top: 20px; }
.se_page_l2 { font-size: 1.1em; color: #2a69b8; }
.se_page_l3 { color: #4CAF50; }
.se_page_l4 { color: #F44336; }

.se_page_date {
    font-weight: bold;
    margin: 10px 0;
}

.se_page_date span {
    border-bottom: 1px solid #000;
    font-weight: bold;
}

/* ============================================================
   5. LIENS DES DATES (task 2)
   ============================================================ */

.se_pages_list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

span.se_p2 {
    position: relative;
    display: inline-block;
    width: 100px;
    line-height: initial;
    float: left;
    padding: 5px;
    text-align: center;
    font-size: 16px;
    background: #1e2f1e;
    border-radius: 4px;
}

span.se_p2 > a,
span.se_p2 > a:hover {
    text-decoration: none !important;
    background: transparent !important;
    color: #fffefd;
}

/* ============================================================
   6. CARTES PRODUITS (task 2)
   ============================================================ */

.caw-se-row {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.1);
    margin: 15px;
    padding: 20px;
    width: calc(25% - 30px);
    display: inline-block;
    position: relative;
    background: white;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out;
}

.caw-se-row:hover {
    transform: translateY(-5px);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1);
}

.caw-se-row .caw-se-col {
    text-align: center;
}

.caw-se-row img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.caw-se-row .name {
    font-size: 1em;
    font-weight: 600;
    color: navy;
}

.caw-se-row .price {
    font-size: 1em;
    font-weight: 600;
    color: green;
    position: absolute;
    left: 5px;
    top: 5px;
}

.caw-se-row .price-b {
    font-size: 1em;
    font-weight: 600;
    color: red;
    position: absolute;
    right: 5px;
    top: 5px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   7. CAROUSEL MINIATURE (task 3) — Version image agrandie
   ============================================================ */

#cse-bl {
    display: block;
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100%;
    /* margin: 15px auto; */
    padding: 5px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

#cse-bl .carousel-inner {
    position: relative;
    width: 100%;
}

#cse-bl .carousel-item {
    position: relative;
    width: 100%;
    text-align: center;
}

#cse-bl .cse-el {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

#cse-bl .carousel-inner,
#cse-bl .carousel-item,
#cse-bl .cse-el {
    height: 290px;              /* ⬇️ Réduit */
}

/* Image agrandie */
.cse-el img {
    /* max-height: 220px; */
    /* max-width: 220px; */
    width: 100% !important;
    height: 200px;
    margin: 0 auto;
    display: block !important;
    transition: transform 0.3s ease;
    /* object-fit: fill; */
}

.cse-el img:hover {
    transform: scale(1.05);
}

.cse_name {
    font-size: 1.5em;
    color: #2c3e50;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 400;
    padding: 8px 0 4px;
    margin: 0;
    border-bottom: 1px solid #eee;
    width: 80%;
    text-align: center;
    position: absolute;
    bottom: 10px;
    background: #ffffff7a;
}

.cse_pw,
.cse_pr {
    position: absolute;
    font-size: 1.15em;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    line-height: 1.4;
    text-align: center;
    top: 15px;
}

.cse_pw {
    color: #e74c3c;
    left: 0;
}

.cse_pr {
    color: #27ae60;
    right: 0;
}

.cse_pw span,
.cse_pr span {
    display: block;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.5;
    font-weight: 400;
    margin-bottom: 3px;
}

.cse_num {
    position: absolute;
    bottom: 8px;
    left: 15px;
    font-size: 0.8em;
    color: #95a5a6;
    font-weight: 400;
    letter-spacing: 1px;
    background: none;
    padding: 0;
}

.cse_dt {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85em;
    color: #7f8c8d;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 1px;
    white-space: nowrap;
    background: none;
    padding: 0;
}

/* Flèches */
.carousel-ctrl {
    width: 40px;
    height: 40px;
    z-index: 10;
    display: block;
    position: absolute;
    top: 50%;
    opacity: 0.3;
    transition: opacity 0.3s;
    background: none;
    border: none;
}

.carousel-ctrl:hover {
    opacity: 0.8;
}

.left.carousel-ctrl::before,
.right.carousel-ctrl::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-top: 2px solid #2c3e50;
    border-right: 2px solid #2c3e50;
    position: absolute;
    top: 50%;
    left: 50%;
}

.left.carousel-ctrl::before {
    transform: translate(-30%, -50%) rotate(-135deg);
}

.right.carousel-ctrl::before {
    transform: translate(-70%, -50%) rotate(45deg);
}

.left.carousel-ctrl {
    left: 5px;
}

.right.carousel-ctrl {
    right: 5px;
}

/* ============================================================
   8. ANIMATION
   ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   9. RTL (Arabe)
   ============================================================ */

[dir="rtl"] #caw-se table td,
[dir="rtl"] #caw-se table th {
    text-align: right;
}

[dir="rtl"] #cse-bl .cse_pw {
    left: auto;
    right: 0;
    text-align: right;
}

[dir="rtl"] #cse-bl .cse_pr {
    right: auto;
    left: 0;
    text-align: left;
}

[dir="rtl"] #cse-bl .cse_num {
    left: auto;
    right: 15px;
}

[dir="rtl"] #cse-bl .carousel-ctrl.left {
    left: auto;
    right: 5px;
}

[dir="rtl"] #cse-bl .carousel-ctrl.right {
    right: auto;
    left: 5px;
}

[dir="rtl"] #cse-bl .left.carousel-ctrl::before {
    transform: translate(-70%, -50%) rotate(45deg);
}

[dir="rtl"] #cse-bl .right.carousel-ctrl::before {
    transform: translate(-30%, -50%) rotate(-135deg);
}

/* ============================================================
   10. RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .caw-se-row {
        width: calc(33.333% - 30px);
    }
}

@media (max-width: 768px) {
    #caw-se form select,
    #caw-se form input[type="date"] {
        max-width: 100%;
    }

    #cse-bl {
        max-width: 100%;
        height: 340px;
        padding: 15px 40px;
    }

    #cse-bl .carousel-inner,
    #cse-bl .carousel-item,
    #cse-bl .cse-el {
        height: 310px;
    }

    .cse-el img {
        max-height: 180px;
        max-width: 180px;
    }

    .cse_name {
        font-size: 1.3em;
    }

    .cse_pw,
    .cse_pr {
        font-size: 1em;
    }

    .cse_dt {
        font-size: 0.75em;
    }

    .caw-se-row {
        width: calc(50% - 30px);
    }

    .cse_canvas {
        height: 300px;
    }
}

@media (max-width: 480px) {
    #cse-bl {
        height: 300px;
        padding: 10px 30px;
    }

    #cse-bl .carousel-inner,
    #cse-bl .carousel-item,
    #cse-bl .cse-el {
        height: 270px;
    }

    .cse-el img {
        max-height: 140px;
        max-width: 140px;
    }

    .cse_name {
        font-size: 1.1em;
        letter-spacing: 2px;
    }

    .cse_pw,
    .cse_pr {
        font-size: 0.9em;
        top: 5px;
    }

    .caw-se-row {
        width: calc(100% - 30px);
        margin: 10px 0;
    }
}

/* ✅ Champ désactivé (catégorie) */
select[disabled] {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ✅ Hauteur du formulaire plus compacte */
#caw-se-2 table td {
    padding: 8px 10px;
    vertical-align: middle;
}

#caw-se-2 table td select,
#caw-se-2 table td input[type="date"] {
    width: 100%;
    padding: 6px 10px;
    font-size: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
}

#caw-se-2 table td select:focus,
#caw-se-2 table td input[type="date"]:focus {
    border-color: #4fc7bf;
    box-shadow: 0 0 0 2px rgba(79, 199, 191, 0.25);
}