/**
Theme Name: Astra-Caisse-Connect

Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-caisse-connect
Template: astra
*/

/* ****************************************
/*           Structure générale
*******************************************/

.ast-container{
	padding:0 !important;
}

#primary {
	margin: 0;
	padding: 0 !important;
	width: 100%;
}

.products {
	padding: 0 1em 0 1em !important;
}

@media (max-width: 768px) {
	.products {
		padding: 0 !important;
	}
}
#secondary {
	margin: 0;
	padding: 0 !important;
	width: fit-content !important;
}


/* Mobiles */
/* Pour masquer le menu Taxo de la colonne sur les mobiles (sinon s'affiche en bas de page)   */
@media (max-width: 768px) {
  #secondary {
    display: none !important;
  }
}

/* Override Astra : garder la sidebar visible en 2 colonnes entre 768px et 1200px */
@media (min-width: 769px) and (max-width: 1200px) {
    .site-content .ast-container,
    .ast-left-sidebar #content > .ast-container {
        flex-direction: row !important;
    }
}


/* ******************************************************************
/*          COLONNE LATERALE
*********************************************************************/

/******** Correction espace blanc entre header et colonne

/* Sidebar sticky */
@media (min-width: 769px) {
    .sidebar-main {
        position: sticky !important;
        top: 80px !important;
        max-height: calc(100vh - 112px) !important;
        overflow-y: auto;
    }
    .admin-bar .sidebar-main {
        top: 112px !important;
        max-height: calc(100vh - 144px) !important;
		min-width: 250px;
    }
}

/* Masquage menu "normal" de la barre latérale 
* (si pas activé dans interface astra, le menu Iks
* ne s'affiche pas. Il faut donc l'activer et le 
* mettre display:none */
#ast-hf-mobile-menu {
	display: none;
}

/******** Ascenseur *******************/

/* Firefox */
.sidebar-main {
  scrollbar-width: thin; /* thin, auto ou none */
  scrollbar-color: #CCC #f1f1f1; /* couleur thumb / couleur track */
}

/* Chrome, Edge, Safari */
.sidebar-main::-webkit-scrollbar {
  width: 4px;
}

.sidebar-main::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.sidebar-main::-webkit-scrollbar-thumb {
  background: #CCC;
  border-radius: 4px;
}

.sidebar-main::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ******************************************************************
/*           Entêtes 
*********************************************************************/
.ast-builder-grid-row.ast-grid-center-col-layout {
	grid-template-columns: auto 1fr auto !important;
}
.site-primary-header-wrap {
	padding: 0 1em 0 1em !important;
}

/* Zone de recherche Fibpsearch */
.ast-grid-section-center {
	justify-content: left;
}
.ast-grid-section-center .header-widget-area {

	flex: 1;

}
/* Max 600px, réduit si manque de place. Passage icone à 1200px (paramètres FiB) */
.dgwt-wcas-search-wrapp {
	width: 100% !important;
	max-width: 600px !important;
	margin:0; /* indispensable sinon ne s'aligne pas à gauche */
}

@media(max-width: 768px) {
	.ast-shop-toolbar-aside-wrap {
		width: 50%;
	}
}

/* TODO Taille barre menu mobile */
/* Mobiles */
@media (max-width: 768px) {
.ast-main-header-wrap {
    max-height: 100vh ;
  }
}


/* ******************************************************************
/*          Page Accueil
*********************************************************************/

/* Correction du conflit entre le plugin product-slider et astra */
/* min-width:0 permet à #primary de rétrécir dans le flex layout malgré le contenu du slider */
.home #primary {
	min-width: 0;
}
/* overflow:hidden contient le slider dans l'espace disponible */
.home .woopspro-product-slider {
	overflow: hidden;
}
.home .woopspro-product-slider ul.products {
	display: block;
}




/* ******************************************************************
/*           Pages boutique
*********************************************************************/






/* Changement du nombre de vignette par ligne en fonction de la taille de l'écran */

/* Base desktop : 4 colonnes */
@media (min-width: 768px) {
	.archive .woocommerce ul.products,
	.woocommerce-page ul.products {
		display: grid !important;
		grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr)) !important; /* Base desktop : 4 colonnes */
		gap: 20px; /* Espace entre vignettes, ajuste si besoin */
	}
}

/* Base mobile : 1 colonnes */
@media (max-width: 768px) {
	.archive .woocommerce ul.products,
	.woocommerce-page ul.products {
		display: grid !important;
		grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr)) !important; 
		gap: 20px; /* Espace entre vignettes */

	}

	.astra-shop-thumbnail-wrap {
		width: clamp(100px, 40vw, 400px);
		height: clamp(100px, 40vw, 400px);
		margin:0 !important;
		padding: 0 !important;
	}

	.woocommerce-loop-product__title {
			position: absolute;
			right: .5em;
			/* .5em pour compenser le padding de li.product, 5px pour marge */ 
			
			left: calc(clamp(100px, 40vw, 400px) + .5em + 5px);
			top: 50px;
			font-size: 1em !important;
		}

	.astra-shop-summary-wrap .price {
		padding-left: 1em;
	}
	
}


/* 6 colonnes pour écrans >= 1920px */
@media (min-width: 1920px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        --columns: 6;
    }
}

/* 5 colonnes pour écrans 1600px à 1919px */
@media (min-width: 1600px) and (max-width: 1919px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        --columns: 5;
    }
}

/* 4 colonnes pour écrans 1200px à 1599px (exemple, ajuste) */
@media (min-width: 1200px) and (max-width: 1599px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        --columns: 4;
    }
}

/* 3 colonnes pour écrans 990px à 1199px (fallback tablette si pas natif) */
@media (min-width: 768px) and (max-width: 1199px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        --columns: 3;
    }
}

/* Respecte les options natives Astra pour tablette et mobile */
	.titre_page_boutique_nb_produits_categorie {
		font-size: .5em;
	}
	.page-title.woocommerce-products-header__title {
	  margin-bottom: 0!important;
		font-size: 2em;
	}
	  
	.ast-shop-toolbar-container {
		margin-bottom: .5em !important;
	}


/* ******************************************************************
/*           Pages individuelles
*********************************************************************/
/* Respecte les options natives Astra pour tablette et mobile */
@media (min-width: 768px) {
	.single-product #primary {
		padding: 0 15em !important;
	}
}

@media (max-width: 768px) {
	.single-product #primary {
		padding: 0 1em !important;
	}
}

#cc-wrapper-haut-produit {
	display: flow-root;
	background-color: white;
	margin-top: 12px;
	padding: 1em;
}


