/* Base styles */
:root {
    --primary-color: #0066cc;
    --secondary-color: #004080;
    --accent-color: #66b3ff;
    --text-color: #333;
    --light-text: #fff;
    --background-light: #f5f5f5;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: url('../images/bg.jpg') no-repeat;
    background-size: cover;
    background-attachment: fixed; /* Keep fixed */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 10px 20px;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: var(--light-text);
}

/* Header styles */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-bar {
    background-color: var(--secondary-color);
    color: var(--light-text);
    padding: 5px 0;
    font-size: 0.9em;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info span {
    margin-right: 15px;
}

.user-actions a {
    color: var(--light-text);
    margin-left: 15px;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.logo img {
    max-height: 70px;
    width: auto;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--text-color);
    font-weight: bold;
    text-transform: uppercase;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.1);
    border-radius: 5px;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 80px 0;
    background-color: rgba(255, 255, 255, 0.9);
    margin: 20px 0;
    border-radius: 10px;
}

.hero h2 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.hero p, .hero .hero-subtitle {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.hero .hero-subtitle {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Style for rich text content */
.hero-subtitle h1, .hero-subtitle h2, .hero-subtitle h3, 
.hero-subtitle h4, .hero-subtitle h5, .hero-subtitle h6 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.hero-subtitle p {
    margin-bottom: 15px;
}

.hero-subtitle ul, .hero-subtitle ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.hero-subtitle strong {
    font-weight: bold;
}

.hero-subtitle em {
    font-style: italic;
}

.hero-subtitle a {
    color: var(--primary-color);
    text-decoration: underline;
}

.hero-subtitle a:hover {
    color: var(--secondary-color);
}

/* Image styles in hero subtitle */
.hero-subtitle img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Image alignment styles for CKEditor 4 */
.hero-subtitle .image-align-left {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.hero-subtitle .image-align-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.hero-subtitle .image-align-right {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

/* Support for image captions */
.hero-subtitle .image figcaption {
    word-break: break-word;
    color: #666;
    background-color: #f7f7f7;
    padding: 0.6em;
    font-size: 0.8em;
    text-align: center;
    margin-top: 0.5em;
}

/* Support for custom image widths (from resizing) */
.hero-subtitle img[style*="width"] {
    max-width: none;
    height: auto !important;
}

/* Clear floats after image */
.hero-subtitle:after {
    content: "";
    display: table;
    clear: both;
}

/* Featured Products */
.featured-products, .categories {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 40px 20px;
    margin: 20px 0;
    border-radius: 10px;
}

.featured-products h2, .categories h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-item {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-link {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    flex: 1;
    cursor: pointer;
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-info h3 {
    margin-bottom: 10px;
}

.price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em;
    margin: 10px 0;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-to-cart:hover {
    background-color: var(--secondary-color);
}

/* Categories section */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category {
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.category:hover {
    transform: scale(1.05);
}

.category img {
    width: 100%;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Category list styles */
.category-list {
    list-style-type: none;
    padding-left: 0;
}

.category-item {
    margin-bottom: 10px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-subcategories {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
}

.subcategories-container {
    margin-top: 5px;
    padding-left: 15px;
    border-left: 1px solid #ddd;
}

.subcategory-list {
    list-style-type: none;
    padding-left: 0;
}

.subcategory-item {
    margin: 5px 0;
}

.loading {
    color: #777;
    font-style: italic;
    padding: 5px;
}

/* Active category styles */
.category-list .active > .category-header > a,
.subcategory-list .active > a {
    font-weight: bold;
    color: var(--primary-color);
}

/* Sidebar styles for product page */
.sidebar {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.category-list .category-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.category-list .category-item:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header a {
    flex-grow: 1;
    color: var(--text-color);
    font-weight: 500;
}

.toggle-subcategories {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.toggle-subcategories:hover {
    background-color: #f0f0f0;
}

.subcategory-list {
    margin-left: 15px;
    margin-top: 8px;
    padding-left: 10px;
    border-left: 2px solid #eee;
}

.subcategory-item {
    padding: 5px 0;
}

.subcategory-item a {
    color: var(--text-color);
    font-size: 0.95em;
}

.subcategory-item a:hover {
    color: var(--primary-color);
}

/* Footer styles */
footer {
    background-color: var(--secondary-color);
    color: var(--light-text);
    padding-top: 40px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    position: relative;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-section.about .contact {
    margin-top: 20px;
}

.footer-section.about .contact span {
    display: block;
    margin-bottom: 10px;
}

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

.footer-section.links ul li {
    margin-bottom: 10px;
}

.footer-section.links ul li a {
    color: var(--light-text);
}

.footer-section.newsletter form {
    margin-top: 20px;
}

.footer-section.newsletter input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
}

.newsletter-success, 
.newsletter-error {
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 0.9em;
}

.newsletter-success {
    background-color: rgba(92, 184, 92, 0.2);
    border: 1px solid rgba(92, 184, 92, 0.5);
    color: #2d6a2d;
}

.newsletter-error {
    background-color: rgba(217, 83, 79, 0.2);
    border: 1px solid rgba(217, 83, 79, 0.5);
    color: #a94442;
}

.btn-subscribe {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-subscribe:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px 0;
    text-align: center;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-icons a {
    color: var(--light-text);
    margin-left: 15px;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent-color);
}

/* Lightbox effect */
.product-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* Keep display: flex, but hide with visibility/opacity */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Keep high z-index */
    pointer-events: none; /* Ignore pointer events when hidden */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease; /* Add transition back */
}

/* Class to make the lightbox visible */
.product-lightbox.is-visible {
    pointer-events: auto; /* Allow interaction */
    visibility: visible;
    opacity: 1;
}

.lightbox-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.95); /* Optional: slight scale for effect */
    transition: transform 0.2s ease;
}

.product-lightbox.is-visible .lightbox-content {
     transform: scale(1);
}

/* Product Features Section */
.product-features-section {
    margin-top: 20px;
    margin-bottom: 20px;
}

.product-features-section h4 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

ul.features-list {
    list-style: none; /* Remove default bullet points */
    padding-left: 0;
    margin-left: 0;
}

ul.features-list li {
    margin-bottom: 8px; /* Space between feature items */
    line-height: 1.5;
    display: flex; /* Align icon and text */
    align-items: flex-start; /* Align items to the top */
}

ul.features-list .feature-icon {
    color: #007bff; /* Blue color for the icon */
    margin-right: 8px; /* Space between icon and text */
    margin-top: 4px; /* Adjust vertical alignment if needed */
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* Responsive design */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 5px 10px;
    }
    
    .footer-bottom .container {
        flex-direction: column;
    }
    
    .social-icons {
        margin-top: 10px;
    }
}
