@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: clamp(60px, 8vh, 80px) 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;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

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;
}

/* Content with Sidebar Layout */
.content-with-sidebar {
    display: block;
}

/* Modern Responsive Grid Layout - IMPORTANT OVERRIDE */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 30px;
    width: 100%;
    padding: 0;
}

/* 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: var(--secondary-color);
    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 */
.category-item {
    position: relative;
    display: block;
}

.category-item > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

body.dark .category-item > a {
    color: #f5f5f5;
}

.category-item > a::after {
    content: '›';
    font-size: 18px;
    transform: rotate(90deg);
    margin-left: 5px;
}

.category-item:hover > a {
    background: #f5f5f5;
}

body.dark .category-item:hover > a {
    background: #333;
}

.sub-menu {
    position: absolute;
    top: 0;
    left: 100%;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    width: 180px;
    z-index: 101;
    display: none;
}

body.dark .sub-menu {
    background: #2a2a2a;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.sub-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

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

.sub-menu a:hover {
    background: #f5f5f5;
}

body.dark .sub-menu a:hover {
    background: #333;
}

.category-item:hover .sub-menu {
    display: block;
}

/* Fix submenu positioning */
.dropdown .category-item .sub-menu {
    top: 0;
    left: 100%;
    margin-top: -5px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark .dropdown .category-item .sub-menu {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

/* Fix for last menu item */
.category-item:last-child .sub-menu {
    top: auto;
    bottom: 0;
}

/* 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: var(--secondary-color);
}

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;
}

/* Compatibility and Connection options styling */
.product-detail-compatibility,
.product-detail-connection {
    margin-bottom: 20px;
}

.product-detail-compatibility h3,
.product-detail-connection h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.compatibility-options,
.connection-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.compatibility-option,
.connection-option {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.compatibility-option:hover,
.connection-option:hover {
    border-color: #673ab7; /* Purple to match accessory theme */
    background-color: rgba(103, 58, 183, 0.05);
}

.compatibility-option.selected,
.connection-option.selected {
    background-color: #673ab7; /* Purple for accessory theme */
    color: white;
    border-color: #673ab7;
}

/* Dark mode styles for accessory options */
body.dark .product-detail-compatibility h3,
body.dark .product-detail-connection h3 {
    color: #e0e0e0;
}

body.dark .compatibility-option,
body.dark .connection-option {
    background-color: #1a1e2d;
    border-color: #3d4154;
    color: #e0e0e0;
}

body.dark .compatibility-option:hover,
body.dark .connection-option:hover {
    border-color: #6244af;
    background-color: #252836;
}

body.dark .compatibility-option.selected,
body.dark .connection-option.selected {
    background-color: #6244af;
    color: white;
    border-color: #6244af;
}

/* Add smooth transitions */
.product-card, 
.btn_one, 
.sidebar_menu,
.snipcart-add-item {
    transition: all 0.3s 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);
}

/* 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;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Improved visuals only - no layout changes */
body.dark .container {
    background-color: #1e1e1e;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Accessories page styling */
.accessories-page .title {
    color: #303f9f;
}

/* Fix search visibility in dark mode */
body.dark.accessories-page .search-input {
    background-color: rgba(35, 35, 66, 0.8);
    color: var(--light-text, #e0e0e0);
}

body.dark.accessories-page .search-btn {
    color: white;
}