/* ============================================================
   STORE CATALOG — Modern card & list styles
   Inspired by STYLE VIGNETTE (.zonedbv2) design language
   ============================================================ */

/* ---- VIGNETTES (icon view) ---- */
.storecard {
    float: left;
    width: 150px;
    height: 175px;
    margin: 6px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
}
.storecard:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Zone haute — image */
.storecard_top {
    background: #f8fafc;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 12px 12px 0 0;
    transition: background-color 0.2s ease;
}
.storecard:hover .storecard_top {
    background: #eef2ff;
}
/* Override image height from set_url_logocours() */
.storecard_top .resizeimageicon {
    max-height: 52px !important;
    height: auto !important;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.storecard_top div {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Zone basse — prix + nom */
.storecard_bottom {
    padding: 6px 8px 8px;
    text-align: center;
}
.storecard_price {
    margin-bottom: 4px;
}
.storecard_price .badge {
    font-size: 0.75em;
    padding: 3px 8px;
}
.storecard_name {
    font-weight: 600;
    font-size: 11px;
    color: #334155;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}
.storecard:hover .storecard_name {
    color: #3b82f6;
}


/* ---- LIST VIEW ---- */
.storelist_item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin: 0 4px 12px 4px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.25s ease;
    gap: 14px;
}
.storelist_item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    border-color: rgba(0, 0, 0, 0.12);
    background: #f8fafc;
}

/* Image container */
.storelist_img {
    flex-shrink: 0;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.storelist_img .resizeimageicon {
    max-height: 44px !important;
    height: auto !important;
    max-width: 52px;
    object-fit: contain;
    border-radius: 6px;
}
.storelist_img div {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Info zone — name + description */
.storelist_info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.storelist_name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.storelist_desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.storelist_item:hover .storelist_name {
    color: #3b82f6;
}

/* Price badge */
.storelist_price {
    flex-shrink: 0;
    margin-left: auto;
}
.storelist_price .badge {
    font-size: 0.8em;
    padding: 4px 10px;
    white-space: nowrap;
}


/* ---- CATEGORY RUBRIQUE CARDS (vignette view) ---- */
.storecat_card {
    float: left;
    width: 225px;
    height: 175px;
    margin: 6px;
    background: #ffffff;
    border: 1px solid rgba(8, 145, 178, 0.2);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
}
.storecat_card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(8, 145, 178, 0.18), 0 4px 10px rgba(8, 145, 178, 0.1);
    border-color: rgba(8, 145, 178, 0.4);
}

/* Zone haute — image plein cadre ou gradient teal (fallback sans image) */
.storecat_top {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 12px 12px 0 0;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}
.storecat_card:hover .storecat_top {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 100%);
}
/* Image : plein cadre, couvre toute la zone haute */
.storecat_top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    filter: none;
    opacity: 1;
    transition: transform 0.3s ease;
}
.storecat_card:hover .storecat_top img {
    transform: scale(1.05);
}
/* Description overlay on hover */
.storecat_overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    color: #fff;
    font-size: 10px;
    line-height: 1.3;
    padding: 24px 8px 6px;
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.storecat_card:hover .storecat_overlay {
    opacity: 1;
}

/* Icône fallback quand pas d'image */
.storecat_top i {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.9);
}

/* Zone basse — name + count */
.storecat_bottom {
    padding: 6px 8px 8px;
    text-align: center;
    background: #ffffff;
    border-top: 2px solid rgba(8, 145, 178, 0.15);
}
.storecat_name {
    font-weight: 700;
    font-size: 12px;
    color: #0891b2;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}
.storecat_card:hover .storecat_name {
    color: #0e7490;
}
.storecat_count {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
}


/* ---- CATEGORY RUBRIQUE LIST ITEMS ---- */
.storecat_item {
    display: flex;
    align-items: stretch;
    padding: 0;
    margin: 0 4px 12px 4px;
    background: #ffffff;
    border: 1px solid rgba(8, 145, 178, 0.2);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.25s ease;
    gap: 0;
    overflow: hidden;
    height: 80px;
}
.storecat_item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.12), 0 2px 6px rgba(8, 145, 178, 0.06);
    border-color: rgba(8, 145, 178, 0.4);
    background: rgba(8, 145, 178, 0.03);
}

/* Image zone — bandeau vertical gauche pleine hauteur */
.storecat_icon {
    flex-shrink: 0;
    width: 160px;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0;
}
.storecat_icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
    opacity: 1;
    transition: transform 0.3s ease;
}
.storecat_item:hover .storecat_icon img {
    transform: scale(1.05);
}
.storecat_icon i {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
}

/* Info zone */
.storecat_info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 10px 0 10px 14px;
}
.storecat_item .storecat_name {
    font-weight: 700;
    font-size: 13px;
    color: #0891b2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}
.storecat_item:hover .storecat_name {
    color: #0e7490;
}
.storecat_item .storecat_count {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}
.storecat_desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Arrow zone */
.storecat_arrow {
    flex-shrink: 0;
    margin-left: auto;
    color: #0891b2;
    opacity: 0.6;
    font-size: 13px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.storecat_item:hover .storecat_arrow {
    opacity: 1;
    transform: translateX(2px);
}


/* ---- STORE MODAL — condensed course info ---- */
.smc_wrap {
    margin-bottom: 10px !important;
}
.smc_wrap .list-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.smc_wrap .list-group-item {
    padding: 4px 10px;
    border-color: rgba(0,0,0,0.06);
    font-size: 12px;
    line-height: 1.4;
}
/* Reduce icon size from fa-2x to compact */
.smc_wrap .fa-2x {
    font-size: 1.15em !important;
    vertical-align: middle;
}
/* Icon color refined */
.smc_wrap .float-left i.fal {
    color: #0891b2;
    width: 18px;
    text-align: center;
}
/* Labels */
.smc_wrap .float-left {
    font-size: 12px;
    color: #64748b;
}
/* Values */
.smc_wrap .carac_scorequiz {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}
/* Image container */
.smc_wrap .list-group-item:first-child {
    padding: 8px;
    background: #f8fafc;
    text-align: center;
}
.smc_wrap .list-group-item:first-child img,
.smc_wrap .resizeimageicon {
    border-radius: 8px;
    max-height: 85px !important;
}
/* Tooltip badges */
.smc_wrap .badge.color_tooltip {
    font-size: 9px;
    padding: 1px 5px;
    vertical-align: middle;
}
/* More info button — compact */
.smc_wrap .btn.btn-primary {
    font-size: 12px;
    padding: 5px 16px;
    border-radius: 6px;
}
.smc_wrap .list-group-item.text-center.mt-4 {
    margin-top: 8px !important;
    padding: 8px;
}


/* ---- BREADCRUMB NAVIGATION ---- */
.store_breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 8px 4px;
    font-size: 13px;
    margin-bottom: 6px;
}
.store_bc_item {
    color: #0891b2;
    cursor: pointer;
    transition: color 0.15s ease;
    text-decoration: none;
}
.store_bc_item:hover {
    color: #0e7490;
    text-decoration: underline;
}
.store_bc_sep {
    color: #94a3b8;
    font-size: 10px;
}
.store_bc_current {
    color: #334155;
    font-weight: 600;
    cursor: default;
}


/* ---- RESPONSIVE ---- */

/* -- Toolbar: flexbox wrap on small screens -- */
@media (max-width: 768px) {
    #store_catalog_toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 8px;
        padding-bottom: 10px !important;
    }
    #store_catalog_toolbar > p { display: none; }
    #store_catalog_toolbar > .catFilterWrap {
        float: none !important;
        order: 1;
    }
    #store_catalog_toolbar > .btn-group-toggle {
        float: none !important;
    }
    /* Sort buttons: order 2, shrink text */
    #store_catalog_toolbar > div:has(#f_name) {
        order: 3;
        margin-right: 0 !important;
    }
    /* View toggle: order 3 */
    #store_catalog_toolbar > div:has(#arrayButtoncat) {
        order: 2;
        margin-left: auto;
    }
    /* CGV button */
    #store_catalog_toolbar > div:has(#viewcgv) {
        float: none !important;
        order: 4;
        margin-left: 0 !important;
    }
    /* Reduce view toggle icon size */
    #arrayButtoncat i.fa-2x,
    #iconeButtoncat i.fa-2x {
        font-size: 1.4em !important;
    }
    /* Reduce sort button size */
    #f_name, #f_date, #f_price {
        font-size: 11px;
        padding: 3px 8px !important;
    }
}

/* -- Cards & list: tablet -- */
@media (max-width: 600px) {
    .storecard {
        width: 140px;
        height: 168px;
        margin: 5px;
    }
    .storecard_top { height: 85px; }
    .storelist_item {
        padding: 8px 10px;
        gap: 10px;
    }
    .storelist_img { width: 44px; }
    .storelist_img .resizeimageicon {
        max-height: 38px !important;
        max-width: 44px;
    }
    .storelist_desc {
        font-size: 11px;
    }
    .storecat_card {
        width: 200px;
        height: 168px;
        margin: 5px;
    }
    .storecat_top { height: 100px; }
    .storecat_icon {
        width: 120px;
    }
    .storecat_desc { font-size: 11px; }
}

/* -- Cards & list: phone -- */
@media (max-width: 480px) {
    #store_catalog_toolbar {
        gap: 4px 6px;
    }
    /* Filter takes full row */
    #store_catalog_toolbar > .catFilterWrap {
        flex: 1 1 100%;
    }
    .storecard {
        width: calc(50% - 12px);
        height: 160px;
        margin: 4px 6px;
    }
    .storecard_top {
        height: 80px;
    }
    .storecard_top .resizeimageicon {
        max-height: 44px !important;
    }
    .storecard_name { font-size: 10px; }
    .storelist_item {
        flex-wrap: wrap;
        padding: 8px 10px;
        gap: 6px;
    }
    .storelist_img {
        width: 40px;
        flex-shrink: 0;
    }
    .storelist_img .resizeimageicon {
        max-height: 36px !important;
        max-width: 40px;
    }
    .storelist_info {
        flex: 1 1 0;
        min-width: calc(100% - 120px);
    }
    .storelist_name { font-size: 12px; }
    .storelist_desc { font-size: 11px; }
    .storelist_price .badge {
        font-size: 0.7em;
        padding: 3px 7px;
    }
    .storecat_card {
        width: calc(50% - 12px);
        height: 160px;
        margin: 4px 6px;
    }
    .storecat_top { height: 95px; }
    .storecat_top i { font-size: 24px; }
    .storecat_card .storecat_name { font-size: 10px; }
    .storecat_icon {
        width: 100px;
    }
    .storecat_icon i { font-size: 18px; }
    .storecat_item .storecat_name { font-size: 12px; }
    .storecat_info { padding: 8px 0 8px 10px; }
    .storecat_desc { font-size: 11px; }
    .storecat_arrow { padding: 0 10px; }
    .store_breadcrumb { font-size: 12px; padding: 6px 4px; }
}

/* -- Very small phone -- */
@media (max-width: 360px) {
    .storecard {
        width: calc(50% - 10px);
        height: 150px;
        margin: 3px 5px;
    }
    .storecard_top { height: 72px; }
    .storecard_name { font-size: 10px; }
    .storelist_item { gap: 6px; padding: 6px 8px; }
    .storelist_img { width: 36px; }
    .storelist_name { font-size: 11px; }
    .storelist_desc { display: none; }
    .storecat_card {
        width: calc(50% - 10px);
        height: 150px;
        margin: 3px 5px;
    }
    .storecat_top { height: 72px; }
    .storecat_card .storecat_name { font-size: 10px; }
    .storecat_icon { width: 80px; }
    .storecat_icon i { font-size: 16px; }
    .storecat_item .storecat_name { font-size: 11px; }
    .storecat_info { padding: 6px 0 6px 8px; }
    .storecat_desc { display: none; }
    .storecat_arrow { padding: 0 8px; }
    .store_breadcrumb { font-size: 11px; }
}
