/*
Theme Name: TAMANE STORE
Description: Thème WooCommerce de la boutique TAMANE STORE : header orange, grille produits 5 colonnes, panier coulissant, paiement à la livraison.
Version: 1.5.0
Author: TAMANE STORE
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tamane-store
*/

:root {
	--orange: #FF5722;
	--orange-dark: #E64A19;
	--orange-light: #FFF1EC;
	--black: #111111;
	--gray: #6b7280;
	--bg: #f9fafb;
}

* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--black);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	line-height: 1.5;
}
body.tamane-drawer-open { overflow: hidden; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
.tamane-container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Barre supérieure */
.tamane-topbar { background: #000; color: #fff; font-size: 13px; }
.tamane-topbar .tamane-container { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.tamane-topbar strong { color: #4ade80; }

/* Header */
.tamane-header { background: var(--orange); color: #fff; position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.tamane-header .tamane-container { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.tamane-logo { background: #fff; color: var(--orange); border-radius: 12px; padding: 6px 10px; font-weight: 900; text-align: center; line-height: 1; text-decoration: none; flex-shrink: 0; }
.tamane-logo span { display: block; font-size: 14px; letter-spacing: .03em; }
.tamane-logo small { display: block; font-size: 10px; letter-spacing: .25em; margin-top: 2px; }
.tamane-logo img { display: block; max-height: 44px; width: auto; }
.tamane-nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tamane-nav a { text-decoration: none; }
.tamane-nav a:hover { text-decoration: underline; }
.tamane-nav > ul > li { position: relative; }
.tamane-nav > ul > li > a { display: block; padding: 8px 12px; border-radius: 999px; }
.tamane-nav > ul > li > a:hover { background: rgba(0,0,0,.25); text-decoration: none; }
.tamane-nav > ul > li.is-active > a,
.tamane-nav .tamane-sub li.is-active > a,
.tamane-nav li.current-menu-item > a { background: rgba(0,0,0,.6); color: #fff; }
.tamane-nav ul { gap: 4px; }
.tamane-nav .tamane-sub,
.tamane-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; color: var(--black); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 8px 0; z-index: 40; font-weight: 500; }
.tamane-nav li:hover > .tamane-sub,
.tamane-nav li:focus-within > .tamane-sub,
.tamane-nav li:hover > .sub-menu,
.tamane-nav li:focus-within > .sub-menu { display: block; }
.tamane-nav .tamane-sub a,
.tamane-nav .sub-menu a { display: block; padding: 9px 16px; }
.tamane-nav .tamane-sub a:hover,
.tamane-nav .sub-menu a:hover { background: var(--orange-light); color: var(--orange-dark); text-decoration: none; }
.tamane-account { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.2; flex-shrink: 0; }
.tamane-account svg { width: 26px; height: 26px; }
.tamane-search { flex: 1; position: relative; }
.tamane-search input[type="search"] { width: 100%; border: 0; border-radius: 999px; padding: 11px 48px 11px 16px; font-size: 14px; outline: none; }
.tamane-search button { position: absolute; right: 4px; top: 4px; bottom: 4px; aspect-ratio: 1; border: 0; border-radius: 50%; background: #000; color: #fff; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; min-height: 0; }
.tamane-cart-btn { position: relative; background: none; border: 0; color: #fff; cursor: pointer; padding: 8px; flex-shrink: 0; }
.tamane-cart-btn svg { width: 28px; height: 28px; display: block; }
.tamane-cart-count { position: absolute; top: 0; right: 0; background: #000; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }

/* Bandeau de confiance */
.tamane-trust { margin-top: 16px; border: 1px solid #15803d; border-radius: 8px; overflow: hidden; font-size: 14px; }
.tamane-trust-head { background: #15803d; color: #fff; font-weight: 700; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 4px 32px; justify-content: space-between; }
.tamane-trust p { margin: 0; background: #fff; color: #166534; padding: 8px 16px; }

.tamane-main { padding-bottom: 64px; }
.tamane-section-title { text-align: center; font-weight: 900; font-size: 24px; margin: 40px 0 16px; }
.tamane-section-title span { display: block; color: var(--orange); font-size: 20px; }
.tamane-page-title { font-size: 26px; font-weight: 900; margin: 28px 0 16px; }

/* Boutons */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #place_order,
.wc-block-components-button.contained,
.tamane-btn {
	background: var(--orange);
	color: #fff;
	border: 0;
	border-radius: 999px;
	font-weight: 700;
	padding: 12px 20px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s ease;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce #place_order:hover,
.wc-block-components-button.contained:hover,
.tamane-btn:hover { background: var(--orange-dark); color: #fff; }

/* Grille produits */
.woocommerce ul.products { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 16px; list-style: none; margin: 16px 0 0; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product,
.woocommerce ul.products[class*="columns-"] li.product,
.woocommerce-page ul.products[class*="columns-"] li.product { width: 100% !important; float: none !important; clear: none !important; margin: 0 !important; padding: 0; position: relative; }
.woocommerce ul.products li.product a img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 8px; margin: 0 0 8px; background: #eee; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 14px; font-weight: 400; color: #374151; padding: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.woocommerce ul.products li.product .price { display: block; color: var(--black); font-weight: 900; font-size: 18px; margin: 4px 0 8px; }
.woocommerce ul.products li.product .price del { color: #9ca3af; font-size: 12px; font-weight: 400; }
.woocommerce ul.products li.product .price ins { color: var(--orange); text-decoration: none; }
/* Bouton d'ajout : icône panier à droite du prix */
.woocommerce ul.products li.product .price { min-height: 30px; padding-right: 52px; margin-bottom: 0; }
.woocommerce ul.products li.product .button {
	position: absolute; right: 0; bottom: 0; width: 44px; height: 30px; padding: 0; margin: 0;
	font-size: 0; line-height: 0; border: 1.5px solid var(--black); border-radius: 999px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23111' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2 4h13M12 7v4m-2-2h4'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.woocommerce ul.products li.product .button:hover { background-color: var(--orange-light); border-color: var(--orange); }
.woocommerce ul.products li.product .button.loading { opacity: .5; }
.woocommerce ul.products li.product .button::after { display: none; }
.woocommerce ul.products li.product a.added_to_cart { display: none; }
.woocommerce span.onsale,
.tamane-badge { position: absolute; top: 8px; left: 8px; z-index: 2; min-height: 0; min-width: 0; line-height: 1.4; margin: 0; border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 700; color: #fff; }
.woocommerce span.onsale { background: #dc2626; }
.tamane-badge { background: var(--orange); }
.woocommerce ul.products li.product .tamane-badge + .onsale,
.woocommerce ul.products li.product .onsale + .tamane-badge { top: 34px; }
.woocommerce .star-rating span::before { color: var(--black); }

/* Fiche produit */
.woocommerce div.product { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 24px; position: relative; }
.woocommerce div.product div.images, .woocommerce div.product div.summary { width: 100%; float: none; margin: 0; }
.woocommerce div.product .woocommerce-tabs, .woocommerce div.product .related, .woocommerce div.product .upsells { grid-column: 1 / -1; }
.woocommerce div.product .product_title { font-size: 26px; font-weight: 900; margin: 0 0 8px; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--orange); font-size: 28px; font-weight: 900; }
.woocommerce div.product form.cart { display: flex; gap: 12px; margin: 20px 0; }
.woocommerce div.product form.cart .single_add_to_cart_button { flex: 1; padding: 14px; font-size: 16px; }
.woocommerce .quantity .qty { width: 72px; padding: 12px 8px; font-size: 16px; border: 1px solid #d1d5db; border-radius: 8px; text-align: center; }

/* Panier, commande, formulaires */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select { font-size: 16px; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 8px; width: 100%; }
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 1px var(--orange); }
.woocommerce-checkout #place_order { width: 100%; padding: 16px; font-size: 17px; }
.woocommerce-info, .woocommerce-message { border-top-color: var(--orange); }
.woocommerce-info::before, .woocommerce-message::before { color: var(--orange); }
.woocommerce table.shop_table { background: #fff; border-radius: 8px; }

/* Panier coulissant */
.tamane-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .3s; }
.tamane-drawer { position: fixed; top: 0; right: 0; height: 100%; width: 100%; max-width: 420px; background: #fff; z-index: 50; box-shadow: -4px 0 24px rgba(0,0,0,.2); transform: translateX(100%); transition: transform .3s; display: flex; flex-direction: column; }
.tamane-drawer-open .tamane-overlay { opacity: 1; pointer-events: auto; }
.tamane-drawer-open .tamane-drawer { transform: translateX(0); }
.tamane-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e5e7eb; }
.tamane-drawer-head h2 { margin: 0; font-size: 18px; font-weight: 900; }
.tamane-drawer-close { background: none; border: 0; font-size: 20px; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.tamane-drawer-close:hover { background: #f3f4f6; }
.tamane-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.tamane-drawer .woocommerce-mini-cart { list-style: none; margin: 0; padding: 0; }
.tamane-drawer .woocommerce-mini-cart-item { position: relative; padding: 12px 28px 12px 76px; min-height: 88px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
.tamane-drawer .woocommerce-mini-cart-item img { position: absolute; left: 0; top: 12px; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; margin: 0; float: none; }
.tamane-drawer .woocommerce-mini-cart-item a { text-decoration: none; font-weight: 600; display: block; }
.tamane-drawer .woocommerce-mini-cart-item a.remove { position: absolute; right: 0; top: 12px; color: #9ca3af !important; font-size: 20px; line-height: 1; }
.tamane-drawer .woocommerce-mini-cart-item .quantity { color: var(--orange); font-weight: 800; display: block; margin-top: 4px; }
.tamane-drawer .woocommerce-mini-cart__total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 900; margin: 16px 0; }
.tamane-drawer .woocommerce-mini-cart__total .amount { color: var(--orange); }
.tamane-drawer .woocommerce-mini-cart__buttons { display: grid; gap: 8px; margin: 0; }
.tamane-drawer .woocommerce-mini-cart__buttons a { display: block; text-align: center; }
.tamane-drawer .woocommerce-mini-cart__buttons a:not(.checkout) { background: #fff; color: var(--black); border: 1px solid var(--black); }
.tamane-drawer .woocommerce-mini-cart__empty-message { text-align: center; color: var(--gray); padding: 64px 0; }

/* Footer */
.tamane-footer { background: #171717; color: #d1d5db; font-size: 14px; }
.tamane-footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding-top: 40px; padding-bottom: 40px; }
.tamane-footer h3 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.tamane-footer ul { list-style: none; margin: 0; padding: 0; }
.tamane-footer li { margin-bottom: 8px; }
.tamane-footer a { text-decoration: none; }
.tamane-footer a:hover { text-decoration: underline; }
.tamane-cod { display: inline-block; background: #fff; color: var(--black); font-weight: 700; border-radius: 4px; padding: 6px 12px; }
.tamane-copy { border-top: 1px solid rgba(255,255,255,.1); text-align: center; padding: 16px; font-size: 12px; color: #9ca3af; }

@media (max-width: 1024px) {
	/* Menu sur une ligne défilante sous la recherche ; les catégories y sont dépliées. */
	.tamane-header .tamane-container { flex-wrap: wrap; row-gap: 8px; }
	.tamane-nav { order: 5; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.tamane-nav::-webkit-scrollbar { display: none; }
	.tamane-nav ul { flex-wrap: nowrap; }
	.tamane-nav > ul > li > a { padding: 6px 12px; background: rgba(0,0,0,.18); }
	.tamane-nav > ul > li.tamane-has-sub,
	.tamane-nav > ul > li.menu-item-has-children,
	.tamane-nav .tamane-sub,
	.tamane-nav .sub-menu,
	.tamane-nav li:hover > .tamane-sub,
	.tamane-nav li:focus-within > .tamane-sub,
	.tamane-nav li:hover > .sub-menu,
	.tamane-nav li:focus-within > .sub-menu { display: contents; }
	.tamane-nav > ul > li.tamane-has-sub > a,
	.tamane-nav > ul > li.menu-item-has-children > a { display: none; }
	.tamane-nav .tamane-sub a,
	.tamane-nav .sub-menu a { color: #fff; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.18); }
	.tamane-account span { display: none; }
	.woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tamane-footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	.woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 8px; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 12px; }
	.woocommerce ul.products li.product .price { font-size: 16px; }
	.woocommerce div.product { grid-template-columns: 1fr; gap: 16px; }
	.woocommerce div.product .product_title { font-size: 20px; }
	.woocommerce div.product form.cart:not(.variations_form):not(.grouped_form),
	.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
		display: flex; gap: 10px;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
		background: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,.12);
	}
	body.single-product { padding-bottom: 76px; }
	.woocommerce-checkout .col2-set .col-1, .woocommerce-checkout .col2-set .col-2,
	.woocommerce form .form-row-first, .woocommerce form .form-row-last { float: none; width: 100%; }
	.tamane-footer-grid { grid-template-columns: 1fr; }
}
