/**
 * Dawson Moor - Additional Custom Styles
 * Supplements the main style.css with advanced features
 */

/* ============================================
   MOBILE NAVIGATION STYLES
   ============================================ */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.98);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-inner {
    text-align: center;
}

.mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu li {
    margin-bottom: var(--space-lg);
}

.mobile-menu a {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.mobile-menu a:hover {
    color: var(--dm-orange);
}

/* Mobile menu toggle animation */
.mobile-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.mobile-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.98);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    width: 100%;
    max-width: 700px;
    padding: var(--space-xl);
    position: relative;
}

.search-form {
    display: flex;
    gap: var(--space-md);
}

.search-input {
    flex: 1;
    padding: var(--space-lg) var(--space-xl);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    color: #fff;
    font-size: 1.25rem;
    font-family: var(--font-primary);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    outline: none;
    border-color: var(--dm-orange);
}

.search-submit {
    padding: var(--space-lg) var(--space-xl);
    background: var(--dm-orange);
    border: none;
    border-radius: var(--radius-xl);
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-submit:hover {
    background: #e64500;
}

.search-close {
    position: absolute;
    top: -60px;
    right: var(--space-xl);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.search-close:hover {
    color: #fff;
}

/* ============================================
   PRODUCT BRAND LABEL
   ============================================ */
ul.products li.product .product-brand {
    display: block;
    padding: 0 var(--space-lg);
    color: var(--dm-orange);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

/* ============================================
   WOOCOMMERCE SHOP PAGE HEADER
   ============================================ */
.woocommerce-products-header {
    background: var(--dm-black);
    padding: calc(52px + var(--space-4xl)) 0 var(--space-4xl);
}

/*
 * Reduce overly large section padding on WooCommerce archive pages.
 * The base .section padding (8rem top/bottom) is great for marketing sections,
 * but it makes shop/category pages feel sparse.
 */
.woocommerce-shop-content.section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
}

.woocommerce-products-header__title {
    color: #fff;
    text-align: center;
    margin-bottom: var(--space-md);
}

/* Shop toolbar */
.dm-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-xl);
}

.dm-shop-filters {
    display: flex;
    gap: var(--space-md);
}

.dm-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 16px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    color: var(--dm-text-dark);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dm-filter-btn:hover {
    border-color: var(--dm-orange);
    color: var(--dm-orange);
}

.dm-view-toggle {
    display: flex;
    gap: var(--space-xs);
}

.dm-view-toggle button {
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    color: var(--dm-text-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dm-view-toggle button.active,
.dm-view-toggle button:hover {
    background: var(--dm-charcoal);
    border-color: var(--dm-charcoal);
    color: #fff;
}

/* Shop layout: sidebar filters + product grid */
.dm-shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-3xl);
    align-items: start;
}

.dm-shop-sidebar .widget {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
}

.dm-shop-sidebar .widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dm-text-dark);
    margin-bottom: var(--space-md);
}

.dm-shop-sidebar a {
    color: var(--dm-text-dark);
}

.dm-shop-sidebar a:hover {
    color: var(--dm-orange);
}

@media (max-width: 1024px) {
    .dm-shop-layout {
        grid-template-columns: 1fr;
    }
    .dm-shop-sidebar {
        order: 2;
    }
    .dm-shop-main {
        order: 1;
    }
}

/* Category landing grids (shop + parent categories) */
.dm-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.dm-category-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.dm-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 79, 10, 0.35);
}

.dm-category-card-media {
    display: block;
    position: relative;
    background: var(--dm-light-gray);
    aspect-ratio: 4 / 3;
}

.dm-category-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay title (premium catalogue style) */
.dm-category-card-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-lg);
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72),
        rgba(0, 0, 0, 0.20) 60%,
        rgba(0, 0, 0, 0)
    );
}

.dm-category-card-title {
    display: block;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
    font-size: 1.05rem;
}

/* Category cards are links; keep the overlay title colour consistent */
.dm-category-card,
.dm-category-card:hover {
    color: inherit;
}

@media (max-width: 1024px) {
    .dm-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dm-category-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SINGLE PRODUCT STYLES
   ============================================ */
.single-product .product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    padding: var(--space-4xl) 0;
}

@media (max-width: 1024px) {
    .single-product .product {
        grid-template-columns: 1fr;
    }
}

.single-product .woocommerce-product-gallery {
    /* Keep the product image in the normal flow (do not follow scroll) */
    position: static;
    top: 0;
}

.single-product .woocommerce-product-gallery__wrapper {
    background: var(--dm-light-gray);
    border-radius: var(--radius-2xl);
    /* Avoid clipping the zoom icon */
    overflow: visible;
}

/* Reduce oversized top padding on single product pages */
.single-product-wrapper.section {
    padding-top: var(--space-3xl);
}

.single-product .flex-control-thumbs {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    list-style: none;
    padding: 0;
}

.single-product .flex-control-thumbs li {
    flex: 0 0 80px;
}

.single-product .flex-control-thumbs img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.single-product .flex-control-thumbs .flex-active,
.single-product .flex-control-thumbs img:hover {
    opacity: 1;
}

/* Product Meta */
.single-product .product_meta {
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.single-product .product_meta > span {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    color: var(--dm-text-gray);
}

.single-product .product_meta a {
    color: var(--dm-text-dark);
    font-weight: 500;
}

/* Product Variations */
.single-product .variations {
    width: 100%;
    margin-bottom: var(--space-xl);
}

.single-product .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-md);
}

.single-product .variations .label {
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.single-product .variations select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
}

/* Quantity & Add to Cart */
.single-product .cart {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-start;
}

.single-product .quantity {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.single-product .quantity .qty {
    width: 60px;
    padding: 14px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-family: var(--font-primary);
}

.single-product .quantity .qty:focus {
    outline: none;
}

/* ============================================
   PRODUCT TABS
   ============================================ */
.woocommerce-tabs {
    grid-column: 1 / -1;
    margin-top: var(--space-3xl);
}

.woocommerce-tabs .wc-tabs {
    display: flex;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.woocommerce-tabs .wc-tabs li {
    margin: 0;
}

.woocommerce-tabs .wc-tabs li a {
    display: block;
    padding: var(--space-md) var(--space-xl);
    color: var(--dm-text-gray);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.woocommerce-tabs .wc-tabs li.active a {
    color: var(--dm-text-dark);
    border-bottom-color: var(--dm-orange);
}

.woocommerce-tabs .panel {
    padding: var(--space-xl) 0;
}

.woocommerce-tabs .panel h2 {
    display: none;
}

/* ============================================
   RELATED PRODUCTS
   ============================================ */
.related.products,
.up-sells {
    grid-column: 1 / -1;
    margin-top: var(--space-4xl);
    padding-top: var(--space-4xl);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.related.products > h2,
.up-sells > h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

/* ============================================
   LOADING STATES
   ============================================ */
.dm-loading {
    position: relative;
    pointer-events: none;
}

.dm-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--dm-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   BREADCRUMBS ENHANCEMENT
   ============================================ */
.woocommerce-breadcrumb {
    background: var(--dm-light-gray);
}

.woocommerce-breadcrumb .container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
}

.breadcrumb-sep {
    color: var(--dm-text-gray);
    margin: 0 var(--space-xs);
}

/* ============================================
   PAGINATION
   ============================================ */
.woocommerce-pagination {
    margin-top: var(--space-4xl);
    display: flex;
    justify-content: center;
}

.woocommerce-pagination ul {
    display: flex;
    gap: var(--space-xs);
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination ul li {
    margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 var(--space-md);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    color: var(--dm-text-dark);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.woocommerce-pagination ul li a:hover {
    border-color: var(--dm-orange);
    color: var(--dm-orange);
}

.woocommerce-pagination ul li span.current {
    background: var(--dm-orange);
    border-color: var(--dm-orange);
    color: #fff;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dm-light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--dm-text-gray);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dm-charcoal);
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection {
    background: var(--dm-orange);
    color: #fff;
}

::-moz-selection {
    background: var(--dm-orange);
    color: #fff;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .mobile-nav,
    .search-overlay {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
    }
    
    .page-content {
        padding-top: 0 !important;
    }
}
