/**
 * DigiCart responsive styles.
 *
 * This file contains only breakpoint/layout rules.
 */

/* --------------------------------------------------------------
# Large tablets / smaller desktops
-------------------------------------------------------------- */

@media (max-width: 1180px) {
	.woocommerce ul.products,
	.dgc-posts,
	.dgc-search-products {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

/* --------------------------------------------------------------
# Tablet product/search grids
-------------------------------------------------------------- */

@media (min-width: 641px) and (max-width: 1024px) {
	body.woocommerce ul.products,
	body.woocommerce-page ul.products,
	body .woocommerce ul.products,
	.dgc-shop-content ul.products,
	.woocommerce-page .dgc-shop-content ul.products,
	.woocommerce .dgc-shop-content ul.products {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 18px !important;
	}

	body.woocommerce ul.products li.product,
	body.woocommerce-page ul.products li.product,
	body .woocommerce ul.products li.product,
	.dgc-shop-content ul.products li.product,
	.woocommerce-page .dgc-shop-content ul.products li.product,
	.woocommerce .dgc-shop-content ul.products li.product {
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		float: none !important;
		clear: none !important;
		margin: 0 !important;
	}

	.dgc-search-products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

/* --------------------------------------------------------------
# Header / navigation
-------------------------------------------------------------- */

@media (max-width: 820px) {
	.dgc-header__inner {
		display: grid;
		grid-template-columns: 42px 1fr;
		align-items: center;
		gap: 14px;
		padding-block: 14px;
	}

	.dgc-menu-toggle {
		display: inline-flex;
	}

	.dgc-header__brand {
		min-width: 0;
	}

	.dgc-header__nav {
		grid-column: 1 / -1;
		display: none;
		width: 100%;
		padding: 14px;
		border: 1px solid var(--dgc-color-border);
		border-radius: 22px;
		background: #ffffff;
		box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
	}

	.dgc-header.is-menu-open .dgc-header__nav {
		display: block;
	}

	.dgc-header__nav ul {
		display: grid;
		gap: 8px;
	}

	.dgc-header__nav a {
		display: flex;
		padding: 12px 14px;
		border-radius: 14px;
		background: var(--dgc-color-surface);
	}

	.dgc-header-search {
		grid-column: 1 / -1;
		width: 100%;
		max-width: none;
	}

	.dgc-header-search input[type="search"] {
		min-height: 42px;
	}

	.dgc-header__actions {
		grid-column: 1 / -1;
		display: flex;
		width: 100%;
	}

	.dgc-header__account,
	.dgc-header__cart {
		flex: 1;
	}

	.dgc-slim-nav__inner {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.dgc-slim-nav ul {
		flex-wrap: nowrap;
		white-space: nowrap;
	}
}

/* --------------------------------------------------------------
# Single product layout
-------------------------------------------------------------- */

@media (max-width: 960px) {
	.dgc-product-hero {
		grid-template-columns: 1fr;
	}

	.dgc-product-hero__media,
	.dgc-product-hero__summary {
		position: static;
	}
}

/* --------------------------------------------------------------
# Product sections
-------------------------------------------------------------- */

@media (max-width: 820px) {
	.dgc-product-sections {
		grid-template-columns: 1fr;
	}
}

/* --------------------------------------------------------------
# Checkout block layout
-------------------------------------------------------------- */

@media (min-width: 901px) {
	body.woocommerce-checkout .wc-block-checkout {
		display: flex !important;
		flex-direction: column !important;
		gap: 28px !important;
	}

	body.woocommerce-checkout .wc-block-components-main,
	body.woocommerce-checkout .wc-block-components-sidebar {
		width: 100% !important;
		max-width: 980px !important;
		margin-inline: auto !important;
		position: static !important;
	}

	body.woocommerce-checkout .wc-block-components-sidebar {
		order: -1 !important;
	}
}

@media (max-width: 900px) {
	.woocommerce-checkout form.checkout {
		grid-template-columns: 1fr;
	}

	.woocommerce-checkout #order_review {
		position: static;
	}
}

/* --------------------------------------------------------------
# Cart layout
-------------------------------------------------------------- */

@media (max-width: 900px) {
	.woocommerce-cart .cart-collaterals .cart_totals,
	body.woocommerce-cart .cart-collaterals .cart_totals {
		width: 100% !important;
		float: none !important;
	}
}

/* --------------------------------------------------------------
# Account
-------------------------------------------------------------- */

@media (max-width: 820px) {
	.woocommerce-account .woocommerce {
		grid-template-columns: 1fr;
	}

	.woocommerce-account .woocommerce-MyAccount-navigation,
	.woocommerce-account .woocommerce-MyAccount-content {
		padding: 22px;
		border-radius: 22px;
	}
}

/* --------------------------------------------------------------
# Mobile
-------------------------------------------------------------- */

@media (max-width: 640px) {
	html,
	body {
		overflow-x: hidden;
	}

	.dgc-site,
	.dgc-main,
	.dgc-single-product,
	.dgc-product-hero,
	.dgc-product-hero__media {
		max-width: 100%;
		overflow-x: hidden;
	}

	.dgc-container,
	.dgc-shop-content {
		width: min(100% - 28px, var(--dgc-container));
	}

	.woocommerce ul.products,
	.dgc-posts,
	.dgc-search-products {
		grid-template-columns: 1fr !important;
	}

	.woocommerce ul.products li.product .woocommerce-loop-product__title {
		font-size: 16px !important;
	}

	.dgc-single-product {
		padding-block: 36px;
	}

	.dgc-product-hero {
		gap: 28px;
	}

	.dgc-product-hero__card {
		padding: 18px;
	}

	.dgc-product-hero__cart .cart {
		align-items: stretch;
		flex-direction: column;
	}

	.dgc-product-hero__cart .single_add_to_cart_button {
		width: 100%;
	}

	.dgc-buy-card__top {
		align-items: flex-start;
		flex-direction: column;
	}

	.dgc-buy-card__info,
	.dgc-buy-card__cart .cart {
		grid-template-columns: 1fr;
	}

	.dgc-product-sections {
		margin-top: 46px;
		gap: 22px;
	}

	.dgc-product-section {
		padding: 22px;
		border-radius: 22px;
	}

	.dgc-feature-list {
		grid-template-columns: 1fr;
	}

	.dgc-product-reviews {
		margin-top: 46px;
		padding: 22px;
		border-radius: 22px;
	}

	.dgc-product-reviews .comment_container {
		grid-template-columns: 1fr;
	}

	.dgc-product-reviews .avatar {
		width: 42px !important;
		height: 42px !important;
	}

	.woocommerce-checkout #customer_details,
	.woocommerce-checkout #order_review,
	.woocommerce-cart .woocommerce-cart-form,
	.woocommerce-cart .cart-collaterals .cart_totals {
		padding: 20px;
		border-radius: 22px;
	}
}

/* --------------------------------------------------------------
# Mobile horizontal scroll areas
-------------------------------------------------------------- */

@media (max-width: 640px) {
	.dgc-product-hero__media .flex-control-nav.flex-control-thumbs {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: 10px !important;
		width: 100% !important;
		max-width: 100% !important;
		overflow-x: auto !important;
		overflow-y: hidden !important;
		margin: 14px 0 0 !important;
		padding: 0 2px 8px !important;
		list-style: none !important;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
	}

	.dgc-product-hero__media .flex-control-nav.flex-control-thumbs li {
		flex: 0 0 72px !important;
		width: 72px !important;
		min-width: 72px !important;
		max-width: 72px !important;
		float: none !important;
		margin: 0 !important;
		padding: 0 !important;
		scroll-snap-align: start;
	}

	.dgc-product-hero__media .flex-control-nav.flex-control-thumbs img {
		display: block;
		width: 72px !important;
		height: 58px !important;
		object-fit: cover !important;
		border-radius: 12px !important;
	}

	.dgc-fbt {
		max-width: 100%;
		overflow: hidden;
	}

	.dgc-fbt__items {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: 10px !important;
		max-width: 100%;
		overflow-x: auto !important;
		overflow-y: hidden !important;
		padding-bottom: 6px !important;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
	}

	.dgc-fbt__item {
		flex: 0 0 148px !important;
		width: 148px !important;
		min-width: 148px !important;
		box-sizing: border-box;
		scroll-snap-align: start;
	}

	.dgc-fbt__thumb {
		aspect-ratio: 16 / 10;
		margin-bottom: 8px;
	}

	.dgc-fbt__body strong {
		font-size: 12px;
	}

	.dgc-fbt__body span,
	.dgc-fbt__cta {
		font-size: 11px;
	}
}

/* Final mobile menu fix */
@media (max-width: 820px) {
	.dgc-menu-toggle {
		display: inline-flex !important;
	}

	.dgc-header__nav {
		display: none !important;
		grid-column: 1 / -1;
		width: 100%;
		padding: 14px;
		border: 1px solid var(--dgc-color-border);
		border-radius: 22px;
		background: #ffffff;
		box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
	}

	.dgc-header.is-menu-open .dgc-header__nav {
		display: block !important;
	}

	.dgc-header__nav ul {
		display: grid !important;
		gap: 8px;
	}

	.dgc-header__nav a {
		display: flex;
		padding: 12px 14px;
		border-radius: 14px;
		background: var(--dgc-color-surface);
	}
}

/* Mobile: hide separate slim nav bar, show slim menu inside mobile panel */
@media (max-width: 820px) {
	.dgc-slim-nav {
		display: none !important;
	}

	.dgc-header__mobile-slim-nav {
		display: block;
		margin-top: 12px;
		padding-top: 12px;
		border-top: 1px solid var(--dgc-color-border);
	}

	.dgc-header__mobile-slim-nav ul {
		display: grid !important;
		gap: 8px;
		margin: 0 !important;
		padding: 0 !important;
		list-style: none !important;
	}

	.dgc-header__mobile-slim-nav a {
		display: flex;
		padding: 12px 14px;
		border-radius: 14px;
		background: #ffffff;
		color: var(--dgc-color-text);
		font-weight: 800;
	}
}

@media (max-width: 820px) {
	.dgc-footer__grid {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	.dgc-footer__bottom {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (max-width: 820px) {
	.dgc-footer__widgets {
		grid-template-columns: 1fr;
	}
}

/* Final sticky buy bar visibility */
@media (min-width: 821px) {
	.dgc-sticky-buy:not(.dgc-sticky-buy--desktop) {
		display: none !important;
	}
}

@media (max-width: 820px) {
	.dgc-sticky-buy:not(.dgc-sticky-buy--mobile) {
		display: none !important;
	}
}

/* Slim nav dropdown mobile fallback */
@media (max-width: 820px) {
	.dgc-slim-nav .sub-menu,
	.dgc-header__mobile-slim-nav .sub-menu {
		position: static;
		display: grid !important;
		gap: 6px;
		margin: 8px 0 0 26px;
		padding: 0;
		min-width: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		pointer-events: auto;
	}

	.dgc-header__mobile-slim-nav .sub-menu a {
		background: var(--dgc-color-surface);
	}
}

/* Final real-tablet catalog grid fix */
@media (min-width: 561px) and (max-width: 900px) {
	.woocommerce ul.products,
	.dgc-search-products,
	.dgc-posts {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 560px) {
	.woocommerce ul.products,
	.dgc-search-products,
	.dgc-posts {
		grid-template-columns: 1fr !important;
	}
}