/**
 * NadoviTools Theme — Custom CSS
 *
 * Structural overrides not expressible in theme.json.
 * Block-level styles belong in theme.json styles.blocks.
 */

/* ==========================================================================
   Sticky Header — Template Part Wrapper Fix
   Source: https://claudiorimann.com/sticky-navigation-in-fse-themes/
   The FSE template-part wrapper breaks native sticky on the group block.
   This CSS makes the wrapper itself sticky when it contains a sticky child.
   ========================================================================== */

/* Sticky header: template-part wrapper sticks, promo+utility collapse on scroll */
header.wp-block-template-part {
	position: sticky;
	top: calc(0px + var(--wp-admin--admin-bar--height, 0px));
	z-index: 100;
}

/* Smooth collapse transition on promo + utility bars */
.nadovitools-promo-bar,
.nadovitools-utility-bar {
	overflow: hidden;
	max-height: 60px;
	transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

/* Collapsed bars when scrolled — !important to override inline block styles */
.nadovitools-promo-bar.is-hidden,
.nadovitools-utility-bar.is-hidden {
	max-height: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	opacity: 0;
	border-width: 0 !important;
}

/* ==========================================================================
   Promo Bar — Animated Rainbow/Gradient Background
   ========================================================================== */

.nadovitools-promo-bar {
	background: linear-gradient(-45deg, #ed1c66, #6a23d5, #23a6d5, #23d5ab, #f03e3e, #e8890c, #e73c7e);
	background-size: 400% 400%;
	animation: nadovitools-promo-gradient 15s ease infinite;
	color: #fff;
	font-size: 0.85rem;
}

@keyframes nadovitools-promo-gradient {
	0%   { background-position: 0% 50%; }
	25%  { background-position: 50% 100%; }
	50%  { background-position: 100% 50%; }
	75%  { background-position: 50% 0%; }
	100% { background-position: 0% 50%; }
}


.promo-messages {
	position: relative;
	display: inline-block;
	min-height: 1.2em;
}

.promo-message {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
	transition: opacity 0.5s ease;
	white-space: nowrap;
}

.promo-message.is-active {
	position: relative;
	opacity: 1;
}

.promo-text {
	font-weight: 600;
	letter-spacing: 0.02em;
}

.promo-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	background: rgba(255,255,255,0.25);
	border-radius: 50%;
	font-weight: 700;
	font-size: 0.75rem;
	margin-right: 0.4rem;
	vertical-align: middle;
}

.promo-countdown {
	font-size: 0.85rem;
	font-weight: 500;
}

.cd-box {
	display: inline-block;
	background: rgba(0,0,0,0.3);
	border-radius: 4px;
	padding: 0.15rem 0.4rem;
	font-weight: 700;
	font-size: 0.85rem;
	min-width: 28px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.cd-sep {
	margin: 0 0.15rem;
	font-weight: 700;
}

/* ==========================================================================
   Utility Bar — Dark Professional
   ========================================================================== */

.nadovitools-utility-bar {
	background: #ffffff;
	font-size: 0.8rem;
	color: #333333;
	border-bottom: 1px solid #e0e0e0;
}

.utility-nav a {
	color: #333333;
	text-decoration: none;
	font-size: 0.8rem;
}

.utility-nav a:hover {
	color: #BA0000;
}

.utility-nav .sep {
	margin: 0 0.5rem;
	color: #999;
}

.utility-contact {
	font-size: 0.8rem;
	color: #333333;
}

.utility-contact a {
	color: #333333;
	text-decoration: none;
	font-weight: 600;
}

.utility-contact a:hover {
	color: #BA0000;
}

/* ==========================================================================
   Header — Horizontal Spacing (96px inner padding + 15px vertical padding)
   ========================================================================== */

.nadovitools-promo-bar,
.nadovitools-utility-bar,
.nadovitools-main-header {
	padding-left: 96px !important;
	padding-right: 96px !important;
	padding-top: 15px !important;
	padding-bottom: 15px !important;
}

@media (max-width: 1200px) {
	.nadovitools-promo-bar,
	.nadovitools-utility-bar,
	.nadovitools-main-header {
		padding-left: 2rem !important;
		padding-right: 2rem !important;
	}
}

@media (max-width: 781px) {
	.nadovitools-promo-bar,
	.nadovitools-utility-bar,
	.nadovitools-main-header {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}
}

/* ==========================================================================
   Main Header
   ========================================================================== */

.nadovitools-main-header.is-scrolled {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Search box border hover/focus */
.nadovitools-main-header .wp-block-search__inside-wrapper {
	transition: border-color 0.2s ease;
}

.nadovitools-main-header .wp-block-search__inside-wrapper:hover {
	border-color: #cc0000 !important;
}

.nadovitools-main-header .wp-block-search__inside-wrapper:focus-within {
	border-color: #BA0000 !important;
}

/* Logo size reduction */
.nadovitools-main-header .wp-block-site-logo img {
	max-width: 144px;
}

.nadovitools-hamburger {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem;
	margin-right: 0.5rem;
	color: #1a1a1a;
	display: flex;
	align-items: center;
}

.nadovitools-hamburger:hover {
	color: #BA0000;
}

.header-actions {
	white-space: nowrap;
}

.header-account {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	color: #1a1a1a;
	line-height: 1.2;
}

.header-account-label {
	font-size: 0.85rem;
	font-weight: 600;
}

.header-account-label .caret {
	font-size: 0.55rem;
	vertical-align: middle;
	margin-left: 0.15rem;
}

.header-account-sub {
	font-size: 0.7rem;
	color: #888;
}

.header-account:hover {
	color: #BA0000;
}

.header-wishlist {
	color: #1a1a1a;
	display: flex;
	align-items: center;
}

.header-wishlist:hover {
	color: #BA0000;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.nadovitools-footer .footer-logo img {
	filter: brightness(0) invert(1);
}

.footer-links {
	list-style: none;
}

.footer-links li {
	margin-bottom: 0.4rem;
}

.footer-links a:hover {
	color: #ffffff !important;
}

.footer-social {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1rem;
}

.social-label {
	color: #aaa;
	font-size: 0.85rem;
	font-weight: 500;
}

.social-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #444;
	border-radius: 50%;
	color: #fff;
	text-decoration: none;
	transition: background 0.2s;
}

.social-icon:hover {
	background: #BA0000;
}

.social-icon svg {
	width: 16px;
	height: 16px;
}

/* Footer USP Bar */
.nadovitools-usp-bar {
	font-size: 0.85rem;
}

/* Footer Bottom Bar */
.footer-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
}

.footer-legal a {
	color: #999;
	text-decoration: none;
	font-size: 0.8rem;
}

.footer-legal a:hover {
	color: #fff;
}

.payment-badges {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.payment-badges img {
	height: 24px;
	width: auto;
	opacity: 0.8;
}

/* ==========================================================================
   Product View Toggle
   Base styles for the grid/list/3col/4col toggle UI.
   ========================================================================== */

.nadovitools-view-toggle {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 1rem;
}

.nadovitools-view-toggle button {
	background: none;
	border: 1px solid var(--wp--preset--color--medium-gray, #e0e0e0);
	padding: 0.4rem 0.6rem;
	cursor: pointer;
	border-radius: 4px;
}

.nadovitools-view-toggle button.is-active {
	border-color: var(--wp--preset--color--primary, #BA0000);
	color: var(--wp--preset--color--primary, #BA0000);
}

/* ==========================================================================
   WooCommerce Cart/Checkout — Container Queries
   Enables responsive layout adjustments within Cart and Checkout blocks.
   Source: https://developer.woocommerce.com/docs/theming/block-theme-development/css-styling
   ========================================================================== */

.wp-block-woocommerce-checkout,
.wp-block-woocommerce-cart {
	container-type: inline-size;
}

/* ==========================================================================
   Product Cards — Minimal Archive Styling
   No add-to-cart button on archive pages (per CONTEXT.md: minimal cards).
   ========================================================================== */

.wc-block-grid__product-add-to-cart,
.wp-block-button.wc-block-components-product-button {
	display: none;
}

/* ==========================================================================
   Sale Badge — Primary Red
   Override WooCommerce default sale badge color with theme primary red.
   ========================================================================== */

.wc-block-components-sale-badge,
.wc-block-grid__product-onsale {
	background-color: var(--wp--preset--color--primary, #BA0000) !important;
	color: var(--wp--preset--color--white, #fff) !important;
}

/* ==========================================================================
   Product Grid View Toggle Overrides
   Applied by product-view-toggle.js on the product collection container.
   ========================================================================== */

.nadovitools-grid-3 .wc-block-product-template { grid-template-columns: repeat(3, 1fr) !important; }
.nadovitools-grid-4 .wc-block-product-template { grid-template-columns: repeat(4, 1fr) !important; }
.nadovitools-grid-list .wc-block-product-template { grid-template-columns: 1fr !important; }
.nadovitools-grid-list .wc-block-product-template .wc-block-product {
	display: flex !important;
	flex-direction: row !important;
	gap: 1.5rem;
	align-items: center;
}
.nadovitools-grid-list .wc-block-product-template .wc-block-product img {
	max-width: 150px;
	height: auto;
}

/* Responsive: force 2-col on tablet, 1-col on mobile regardless of toggle */
@media (max-width: 1024px) {
	.wc-block-product-template { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
	.wc-block-product-template { grid-template-columns: 1fr !important; }
}

/* ==========================================================================
   Responsive Utilities
   ========================================================================== */

@media (max-width: 781px) {
	.nadovitools-hide-mobile {
		display: none !important;
	}
}

@media (min-width: 782px) {
	.nadovitools-hide-desktop {
		display: none !important;
	}
}

/* ==========================================================================
   Responsive Polish — Header (Mobile)
   ========================================================================== */

@media (max-width: 781px) {
	.nadovitools-promo-bar { font-size: 11px; }
	.nadovitools-promo-bar .promo-countdown { display: none; }
	.nadovitools-utility-bar { display: none !important; }
	.nadovitools-main-header .wp-block-search { max-width: 160px; font-size: 14px; }
	.nadovitools-main-header .wp-block-site-logo img { max-width: 110px; }
	.header-account { display: none; }
}

/* ==========================================================================
   Responsive Polish — Footer (Mobile: stack columns)
   ========================================================================== */

@media (max-width: 781px) {
	.nadovitools-footer .wp-block-columns { flex-direction: column !important; }
	.nadovitools-footer .wp-block-column { flex-basis: 100% !important; margin-bottom: 1.5rem; }
	.nadovitools-usp-bar { flex-direction: column !important; gap: 0.5rem; }
	.nadovitools-bottom-bar { flex-direction: column !important; gap: 0.75rem; text-align: center; }
	.footer-legal { justify-content: center; }
	.payment-badges { justify-content: center; }
}

/* ==========================================================================
   Responsive Polish — Single Product (Mobile: stack gallery + info)
   ========================================================================== */

@media (max-width: 781px) {
	.single-product .wp-block-columns { flex-direction: column !important; }
	.single-product .wp-block-column { flex-basis: 100% !important; }
}

/* ==========================================================================
   Responsive Polish — Archive Sidebar (Mobile: hide filters)
   TODO: Phase 8 follow-up — implement mobile filter drawer via Interactivity API
   ========================================================================== */

@media (max-width: 781px) {
	.wp-block-woocommerce-product-filters { display: none; }
}

/* ==========================================================================
   Responsive Polish — Typography (Mobile: scale headings)
   ========================================================================== */

@media (max-width: 781px) {
	h1 { font-size: 24px !important; }
	h2 { font-size: 20px !important; }
}

/* ==========================================================================
   Offcanvas Drawer
   ========================================================================== */

/* Overlay */
.nadovitools-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.nadovitools-drawer-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

/* Drawer */
.nadovitools-drawer {
	position: fixed;
	top: 0;
	left: 0;
	width: 320px;
	max-width: 85vw;
	height: 100vh;
	background: #fff;
	z-index: 1000;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
}
.nadovitools-drawer.is-open {
	transform: translateX(0);
}

/* Drawer scroll container */
.nadovitools-drawer-scroll {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Drawer header */
.nadovitools-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #e0e0e0;
	flex-shrink: 0;
}
.nadovitools-drawer-header .custom-logo-link img {
	max-width: 140px;
	height: auto;
}
.nadovitools-drawer-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem;
	color: #1a1a1a;
	display: flex;
	align-items: center;
}
.nadovitools-drawer-close:hover {
	color: #BA0000;
}

/* Drawer body */
.nadovitools-drawer-body {
	flex: 1;
	padding: 0.75rem 0;
	overflow-y: auto;
}

/* Section headings */
.nadovitools-drawer-heading {
	display: block;
	padding: 0.5rem 1.25rem;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #999;
	margin-top: 0.75rem;
}

/* Menu items */
.nadovitools-drawer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.nadovitools-drawer-menu .menu-item {
	position: relative;
	border-bottom: 1px solid #f0f0f0;
}
.nadovitools-drawer-menu .menu-item > a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.25rem;
	color: #1a1a1a;
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 500;
}
.nadovitools-drawer-menu .menu-item > a:hover {
	color: #BA0000;
}

/* Chevron toggle for sub-menus */
.nadovitools-drawer-menu .menu-dropdown {
	position: absolute;
	right: 0;
	top: 0;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #999;
	transition: transform 0.2s ease;
}
.nadovitools-drawer-menu .menu-dropdown.is-expanded {
	transform: rotate(180deg);
}

/* Sub-menus (collapsed by default) */
.nadovitools-drawer-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
	background: #fafafa;
}
.nadovitools-drawer-menu .sub-menu .menu-item {
	border-bottom: 1px solid #f0f0f0;
}
.nadovitools-drawer-menu .sub-menu .menu-item > a {
	padding-left: 2.5rem;
	font-size: 0.9rem;
	font-weight: 400;
	color: #555;
}
.nadovitools-drawer-menu .sub-menu .menu-item > a:hover {
	color: #BA0000;
}

/* Category menu icons */
.nadovitools-drawer-cat-menu .menu-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	color: #BA0000;
	flex-shrink: 0;
}

/* Contact section */
.nadovitools-drawer-contacts {
	padding: 0 1.25rem;
}
.nadovitools-drawer-contacts .contact-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid #f0f0f0;
}
.nadovitools-drawer-contacts .contact-icon {
	color: #BA0000;
	flex-shrink: 0;
	margin-top: 0.1rem;
}
.nadovitools-drawer-contacts .contact-detail {
	font-weight: 600;
	font-size: 0.95rem;
	margin: 0;
	color: #1a1a1a;
}
.nadovitools-drawer-contacts .contact-description {
	font-size: 0.8rem;
	color: #888;
}

/* Drawer footer */
.nadovitools-drawer-footer {
	padding: 1rem 1.25rem;
	border-top: 1px solid #e0e0e0;
	flex-shrink: 0;
}
.nadovitools-drawer-footer p {
	margin: 0;
	font-size: 0.75rem;
	color: #999;
}

/* Body scroll lock when drawer open */
body.nadovitools-drawer-active {
	overflow: hidden;
}

/* ==========================================================================
   Newsletter Section
   ========================================================================== */

.nadovitools-newsletter {
	border-bottom: 1px solid #333;
}

.newsletter-content {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.newsletter-icon {
	flex-shrink: 0;
}

.newsletter-title {
	color: #fff;
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 0.25rem;
}

.newsletter-description {
	color: #aaa;
	font-size: 0.9rem;
	margin: 0;
	line-height: 1.5;
}

.newsletter-input-group {
	display: flex;
	gap: 0;
	border-radius: 4px;
	overflow: hidden;
}

.newsletter-input {
	flex: 1;
	padding: 0.8rem 1rem;
	border: none;
	font-size: 0.95rem;
	outline: none;
	background: #fff;
	color: #1a1a1a;
	min-width: 0;
}

.newsletter-input::placeholder {
	color: #999;
}

.newsletter-btn {
	padding: 0.8rem 1.5rem;
	background: #BA0000;
	color: #fff;
	border: none;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s;
}

.newsletter-btn:hover {
	background: #8B0000;
}

.newsletter-privacy {
	margin: 0.5rem 0 0;
	font-size: 0.75rem;
	color: #888;
}

.newsletter-privacy a {
	color: #BA0000;
	text-decoration: none;
}

.newsletter-privacy a:hover {
	text-decoration: underline;
}

/* Newsletter success/hidden state */
.nadovitools-newsletter.is-subscribed {
	display: none;
}

/* Newsletter mobile responsive */
@media (max-width: 781px) {
	.newsletter-content {
		flex-direction: column;
		text-align: center;
	}
	.newsletter-input-group {
		flex-direction: column;
	}
	.newsletter-btn {
		width: 100%;
	}
	.newsletter-privacy {
		text-align: center;
	}
}
