@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');

/* Add CSS variables for theme colors for easy maintenance */
:root {
    --primary-color: #8e24aa;
    --primary-gradient: linear-gradient(135deg, #673ab7 0%, #9c27b0 100%);
    --secondary-color: #3f51b5;
    --light-bg: #f9f9f9;
    --dark-bg: #121212;
    --light-text: #e0e0e0;
    --dark-text: #333;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Apply variables to some elements */
body {
    background-color: var(--light-bg);
    color: var(--dark-text);
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Dark Mode */
body.dark {
    background-color: var(--dark-bg);
    color: var(--light-text);
}

/* --------------------------------------------
   NAVIGATION STYLES REMOVED
   All navigation styling now comes from nav-header.css
   This eliminates conflicts between pages
   -------------------------------------------- */

/* Main Content */
.container {
    width: 100%;
    max-width: 1400px;
    padding: 0 20px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
}

body.dark .container {
    background-color: #1e1e1e;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}

body.dark header {
    border-bottom: 2px solid #333;
}

header .title {
    font-size: 32px;
    font-weight: 800;
    color: #333;
    position: relative;
    display: inline-block;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

header .title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Category Filter */
.category-group {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eaeaea;
}

body.dark .category-group {
    border-bottom: 1px solid #333;
}

.category-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.main-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    padding: 10px;
    color: #333;
    transition: all 0.3s ease;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

body.dark .main-category {
    color: #e0e0e0;
    background-color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.main-category:hover {
    color: #3f51b5;
    background-color: #f5f7ff;
}

body.dark .main-category:hover {
    color: #7986cb;
    background-color: #2c2c2c;
}

.main-category i {
    transition: transform 0.3s ease;
}

.main-category.open i {
    transform: rotate(180deg);
}

.subcategories {
    background: #fff;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
    border-radius: 0 0 8px 8px;
    margin-top: 5px;
}

body.dark .subcategories {
    background: #1e1e1e;
}

.main-category.open + .subcategories {
    max-height: 300px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

body.dark .main-category.open + .subcategories {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Category dropdown with submenu styling - ENHANCED */
.category-item {
    position: relative;
    display: block;
    margin-bottom: 2px;
    border-radius: 6px;
    overflow: hidden;
}

.category-item > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 500;
    border-radius: 6px;
    background-color: #f8f9fa;
}

body.dark .category-item > a {
    color: #f5f5f5;
    background-color: rgba(45, 45, 70, 0.5);
}

.category-item > a::after {
    content: '\f107'; /* Font Awesome chevron down */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.category-item:hover > a {
    background-color: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.dark .category-item:hover > a {
    background-color: rgba(60, 60, 90, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.category-item:hover > a::after {
    transform: rotate(180deg);
}

.sub-menu {
    position: static;
    top: auto;
    left: auto;
    background: #f9f9f9;
    box-shadow: none;
    border-radius: 0 0 8px 8px;
    width: 100%;
    z-index: 101;
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
    padding: 8px 0;
    animation: fadeDown 0.3s ease;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

body.dark .sub-menu {
    background: rgba(35, 35, 66, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: none;
}

.category-item:hover .sub-menu {
    display: block;
    max-height: 500px;
}

.dropdown .category-item .sub-menu {
    position: static;
    top: auto;
    left: auto;
    margin-top: 0;
}

.dropdown .category-item:last-child .sub-menu {
    top: auto;
    bottom: auto;
}

.category-item:last-child .sub-menu {
    top: auto;
    bottom: auto;
}

/* Fix submenu items to look like checkbox items */
.sub-menu a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
}

.sub-menu a:before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background-color: white;
    transition: all 0.2s ease;
}

.sub-menu a:hover:before {
    border-color: var(--primary-color);
}

.sub-menu a.active:before {
    content: '\f00c'; /* Font Awesome check icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

body.dark .sub-menu a {
    color: #e0e0e0;
}

body.dark .sub-menu a:before {
    border-color: #555;
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark .sub-menu a:hover:before {
    border-color: var(--primary-color);
}

body.dark .sub-menu a.active:before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Checkbox styling */
.checkbox-container {
    display: block;
    position: relative;
    padding: 12px 12px 12px 40px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    transition: background 0.2s ease;
}

.checkbox-container:hover {
    background-color: #f5f7ff;
}

body.dark .checkbox-container:hover {
    background-color: #2a2a2a;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 12px;
    left: 12px;
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 4px;
    transition: all 0.2s ease;
}

body.dark .checkmark {
    background-color: #333;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #ddd;
}

body.dark .checkbox-container:hover input ~ .checkmark {
    background-color: #444;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #3f51b5;
}

body.dark .checkbox-container input:checked ~ .checkmark {
    background-color: #5c6bc0;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ===========================================
   Product card styles are now in product-cards.css
   All pages share the same unified styles
   =========================================== */

/* Product Detail Modal */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    width: clamp(250px, 95%, 600px);
    padding: clamp(15px, 3vw, 20px);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.product-detail-image,
.product-detail-info {
    flex: 1 1 clamp(200px, 100%, 300px);
    margin: clamp(10px, 2vw, 20px);
    min-width: 250px;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.product-detail-price {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-detail-rating {
    margin-bottom: 20px;
}

.rating-stars-interactive {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
}

.rating-stars-interactive i {
    font-size: 24px;
    margin-right: 5px;
    color: #ccc;
}

.rating-stars-interactive i:hover {
    color: #ff9900;
}

.product-detail-buttons {
    margin-top: 20px;
}

.product-detail-sizes {
    margin-top: 20px;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.size-option {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 5px;
    cursor: pointer;
}

.size-option:hover {
    background-color: #f0f0f0;
}

.product-detail-colors {
    margin-top: 20px;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 5px;
    cursor: pointer;
}

.color-option:hover {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.product-reviews-section {
    margin-top: 40px;
}

.review-form-container {
    margin-top: 20px;
}

.rating-input {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.star-rating-input {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
}

.star-rating-input i {
    font-size: 24px;
    margin-right: 5px;
    color: #ccc;
}

.star-rating-input i:hover {
    color: #ff9900;
}

.reviews-list {
    margin-top: 20px;
}

/* Hover transitions only - NOT for theme switching */
.product-card:hover {
    transform: translateY(-2px);
}

.btn_one,
.snipcart-add-item,
.add-to-cart {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Ensure the product modal is properly centered */
.product-modal {
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Implement responsive design without media queries */
.sidebar_menu {
    width: clamp(280px, 100%, 100%);
    left: min(-100%, -280px);
}

.modal-content {
    width: clamp(250px, 95%, 600px);
    padding: clamp(15px, 3vw, 20px);
}

.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.product-detail-image,
.product-detail-info {
    flex: 1 1 clamp(200px, 100%, 300px);
    margin: clamp(10px, 2vw, 20px);
    min-width: 250px;
}

/* Responsive navbar without media queries */
.nav-actions {
    gap: clamp(10px, 2vw, 20px);
}

.terzon-brand {
    margin-left: clamp(15px, 3vw, 40px);
}

.filter-sort-wrapper {
    flex-wrap: wrap;
}

.filter-sort-container {
    display: flex;
    flex-direction: column;
}

.filter-content, 
.sort-content {
    width: 100%;
    right: 0;
}

/* Responsive containers */
.container {
    width: 100%;
    max-width: 1400px;
    padding: 10px clamp(10px, 2vw, 20px) clamp(20px, 4vh, 40px);
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
}

/* Improved visuals only - no layout changes */
.filter-btn, .sort-btn {
    padding: 12px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8e24aa, #9c27b0);
    color: white;
    font-weight: 500;
    border: none;
    box-shadow: 0 4px 10px rgba(142, 36, 170, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 120px;
}

.filter-btn i, .sort-btn i {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-btn:hover, .sort-btn:hover {
    box-shadow: 0 6px 15px rgba(142, 36, 170, 0.3);
    transform: translateY(-2px);
}

.filter-btn:active, .sort-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(142, 36, 170, 0.2);
}

body.dark .filter-btn, body.dark .sort-btn {
    background: linear-gradient(135deg, #5e35b1, #673ab7);
    box-shadow: 0 4px 10px rgba(94, 53, 177, 0.3);
}

body.dark .filter-btn:hover, body.dark .sort-btn:hover {
    box-shadow: 0 6px 15px rgba(94, 53, 177, 0.4);
}

/* Active state for dropdowns */
.filter-btn.active i, .sort-btn.active i {
    transform: rotate(180deg);
}

.filter-dropdown, .sort-dropdown {
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 5px;
    min-width: 220px;
    z-index: 100;
}

body.dark .filter-dropdown, body.dark .sort-dropdown {
    background-color: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

/* Price filter input styling */
.price-filter-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.price-filter-item:last-of-type {
    margin-bottom: 5px;
}

.price-filter-item label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.price-filter-item input {
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    width: 100px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f5f5f5;
    text-align: center;
}

.price-filter-item input:focus {
    border-color: #3f51b5;
    box-shadow: 0 0 8px rgba(63, 81, 181, 0.2);
    background-color: #fff;
}

/* Dark mode styling for price filter */
body.dark .price-filter-item {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.dark .price-filter-item label {
    color: #e0e0e0;
}

body.dark .price-filter-item input {
    background-color: #222;
    border-color: #444;
    color: #e0e0e0;
}

body.dark .price-filter-item input:focus {
    border-color: #7986cb;
    box-shadow: 0 0 8px rgba(121, 134, 203, 0.3);
    background-color: #2a2a2a;
}

/* Custom styling for number input spinners */
.price-filter-item input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield; /* Standard */
}

/* Chrome, Safari, Edge, Opera */
.price-filter-item input[type="number"]::-webkit-outer-spin-button,
.price-filter-item input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

/* Custom increment/decrement buttons */
.price-filter-item {
    position: relative;
}

.price-filter-item .number-controls {
    position: absolute;
    right: 20px; /* 2px more to the left from 18px */
    top: 50%;
    transform: translateY(-23%) !important; /* 2px more up from -21% */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.price-filter-item .number-control-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.price-filter-item .number-control-btn:hover {
    color: #3f51b5;
}

body.dark .price-filter-item .number-control-btn {
    color: #777;
}

body.dark .price-filter-item .number-control-btn:hover {
    color: #7986cb;
}

body.dark .price-filter-item .number-control-btn:hover {
    color: #7986cb;
}

/* Filter action buttons */
.filter-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
    padding: 0 5px;
}

.apply-filter-btn, .reset-filter-btn {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-filter-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    flex: 1;
}

.reset-filter-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    flex: 0 0 auto;
}

.apply-filter-btn:hover {
    background: #7b1fa2;
    transform: translateY(-1px);
}

.reset-filter-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

body.dark .apply-filter-btn {
    background: var(--primary-color);
}

body.dark .reset-filter-btn {
    color: #ddd;
    border-color: #555;
}

body.dark .apply-filter-btn:hover {
    background: #6a1b9a;
}

body.dark .reset-filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #777;
}

body.clothing-page .section-divider {
  width: 100%;
  border: none;
  border-top: 1px solid #ccc;
  margin: 5px 0;
}

body.clothing-page .featured-products-section {
  display: none;
}