
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Header Styles */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e1e5e9;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-title {
    display: inline-block;
    margin-right: 2rem;
}

.site-title a {
    color: #333;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
}

.main-nav {
    display: inline-block;
    vertical-align: middle;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    color: #0073aa;
    text-decoration: none;
    margin-right: 1.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 115, 170, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 115, 170, 0.2);
    transition: all 0.3s ease;
    font-size: 2rem;
    line-height: 1;
}

.main-nav a:hover {
    color: #005177;
    background-color: rgba(0, 81, 119, 0.15);
    border-color: rgba(0, 81, 119, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

/* Main Content */
.site-main {
    padding: 2rem 0;
    min-height: 70vh;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumbs a {
    color: #0073aa;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}



/* Product Cards Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card-image {
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.no-image {
    color: #999;
    font-size: 0.9rem;
}

.product-card-content {
    padding: 1.5rem;
}

.product-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 0.5rem;
}

.product-card-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-3px);
}

.category-card a {
    text-decoration: none;
    color: inherit;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.category-count {
    color: #666;
    font-size: 0.9rem;
}

/* Single Product Page */
.product-single {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.product-gallery-wrapper {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.product-info-block {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.product-specs-block,
.product-description-block {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0073aa;
}

.product-gallery {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.main-image {
    margin-bottom: 1rem;
}

.main-image img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 4px;
}

.thumbnails {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    border-color: #0073aa;
}

/* Product Details */
.product-details {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    overflow-wrap: break-word;  /* preferred */
    word-wrap: break-word;      /* legacy fallback */
    white-space: normal;
    max-width: 100%;
}

.product-details {
    width: 100%;
    box-sizing: border-box;
}

.product-meta {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 0.5rem;
}

.stock-status {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.in-stock {
    color: #28a745;
}

.out-of-stock {
    color: #dc3545;
}

.product-sku {
    color: #666;
    font-size: 0.9rem;
}

.product-description {
    margin-bottom: 2rem;
    line-height: 1.7;
}

.product-description h2,
.product-description h3 {
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.product-description p {
    margin-bottom: 1rem;
}

.product-description ul,
.product-description ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* Clean specification table styles */
.product-description table,
.product-description .spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-description th,
.product-description td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: top;
}

.product-description th {
    background: #0073aa;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-description td {
    background: white;
    font-size: 0.95rem;
}

.product-description td ul {
    margin: 0;
    padding-left: 1rem;
}

.product-description td li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

/* Responsive specification tables */
@media (max-width: 768px) {
    .product-description th,
    .product-description td {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .product-description th,
    .product-description td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .product-description table,
    .product-description .spec-table {
        font-size: 0.85rem;
    }
}

/* Product Attributes */
.product-attributes {
    margin-bottom: 2rem;
}

.product-attributes h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.attributes-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.attributes-table tr.even {
    background-color: #f8f9fa;
}

.attributes-table tr.odd {
    background-color: white;
}

.attributes-table td {
    padding: 0.75rem;
    border: 1px solid #e1e5e9;
    vertical-align: top;
}

.attribute-name {
    font-weight: 600;
    width: 30%;
    background-color: #f1f3f4;
}

.attribute-value {
    width: 70%;
}

/* Buy Button */
.product-actions {
    margin-top: 2rem;
}

.buy-button {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.buy-button:hover {
    background: #005177;
}

/* Section Headings */
.featured-products h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #333;
}

/* Category Pages */
.category-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.category-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1rem;
}

.products-count {
    color: #999;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Footer */
.site-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-footer a {
    color: #cccccc;
    text-decoration: underline;
}

.site-footer a:hover {
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .site-title {
        display: block;
        margin-bottom: 1rem;
        margin-right: 0;
    }

    .main-nav {
        display: block;
        margin-top: 0;
    }



    .product-single {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-gallery-wrapper {
        position: static;
    }

    .product-info-block,
    .product-specs-block,
    .product-description-block {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .attributes-table {
        font-size: 0.9rem;
    }
    
    .attribute-name {
        width: 40%;
    }
    
    .attribute-value {
        width: 60%;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-title {
        font-size: 1.5rem;
        overflow-wrap: break-word;  /* preferred */
        word-wrap: break-word;      /* legacy fallback */
        white-space: normal;
        max-width: 100%;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    .buy-button {
        width: 100%;
        text-align: center;
    }
}

/* Loading and Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Products Index Table */
.products-index {
    margin-bottom: 3rem;
}

.products-index h1 {
    color: #333;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.products-index p {
    color: #666;
    margin-bottom: 2rem;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.products-table th,
.products-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
}

.products-table tr:nth-child(even) {
    background: #f8f9fa;
}

.products-table tr:hover {
    background: #e8f4f8;
}

.products-table a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.products-table a:hover {
    text-decoration: underline;
}

.products-table img {
    max-width: 80px;
    border-radius: 4px;
}

/* Category Cards with Images */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e1e5e9;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.category-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

.category-info {
    padding: 1.5rem;
}

.category-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.category-count {
    color: #0073aa;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Mobile responsive category cards */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .category-image {
        height: 180px;
    }

    .category-info {
        padding: 1.2rem;
    }

    .category-info h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-image {
        height: 160px;
    }

    .category-info {
        padding: 1rem;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.pagination-info {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    color: #0073aa;
    text-decoration: none;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.pagination-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: 600;
}

.pagination-prev,
.pagination-next {
    font-weight: 600;
    padding: 0.5rem 1.2rem;
}

.pagination-dots {
    padding: 0.5rem 0.5rem;
    color: #666;
    font-weight: 600;
}

/* Mobile responsive pagination */
@media (max-width: 768px) {
    .pagination-links {
        gap: 0.25rem;
    }

    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        min-width: 35px;
    }

    .pagination-prev,
    .pagination-next {
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .pagination-links {
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    .pagination-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
        min-width: 30px;
    }

    .pagination-info {
        font-size: 0.85rem;
        text-align: center;
    }

    .product-info-block,
    .product-specs-block,
    .product-description-block {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    /* Ensure long text wraps on very small screens */
    .product-title {
        font-size: 1.3rem;
        overflow-wrap: break-word;  /* preferred */
        word-wrap: break-word;      /* legacy fallback */
        white-space: normal;
        max-width: 100%;
    }

    .thumbnail {
        width: 50px;
        height: 50px;
    }

    .products-table th,
    .products-table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }

.hidden { display: none; }
.visible { display: block; }
