/* =========================================================
   General Styles
   ========================================================= */

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* Page Layout */
.pagebody {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    /* IMPORTANT: do not centre-align everything globally */
    align-items: stretch;
}

/* Banner Section */
.banner-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.banner-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 10px 20px;
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumbs ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 5px;
}

.breadcrumbs a {
    text-decoration: none;
    color: #0073e6;
    font-weight: bold;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Navigation Bar */
.navbar {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 10px 0;
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.navbar a {
    text-decoration: none;
    color: white;
    padding: 10px 20px;
    transition: background-color 0.3s ease;
}

.navbar a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* =========================================================
   Products Grid (also used for categories)
   ========================================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    padding: 20px;
}

@media (max-width: 768px) {
    .products-grid {
        gap: 10px;
        padding: 10px;
    }
}

.product-card {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    height: 300px;
    padding: 10px;
}


.product-card:hover {
    transform: translateY(-5px);
}

/* Placeholder card (used in index to pad layout) */
.product-card.placeholder {
    border: 0;
    box-shadow: none;
    background: transparent;
}

.product-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.product-info {
    padding: 10px 0;
    text-align: center;
}

.product-info h3 {
    font-size: 1rem;
    margin: 5px 0;
    color: #333;
}

.product-info p {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0;
}

/* Hover description */
.hover-description {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    width: 90%;
    text-align: center;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease-in-out;
}

.product-card:hover .hover-description {
    opacity: 1;
    visibility: visible;
}

/* =========================================================
   Content section (static pages: about/contact/privacy/blog)
   ========================================================= */

.content-section {
    padding: 20px;
    max-width: 800px;
    margin: 20px auto;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.content-section h1,
.content-section h2 {
    color: #333;
}

.content-section p {
    color: #555;
    line-height: 1.6;
}

.content-section ul {
    margin-left: 20px;
    list-style-type: disc;
}

.content-section ul li {
    margin-bottom: 10px;
    color: #555;
}

.content-section a {
    color: #0073e6;
    text-decoration: none;
}

.content-section a:hover {
    text-decoration: underline;
}

/* =========================================================
   Blog pages
   ========================================================= */

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-summary {
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.blog-summary h2 {
    margin: 0 0 10px;
}

.blog-summary .read-more {
    color: #0073e6;
    text-decoration: none;
    font-weight: bold;
}

.blog-summary .read-more:hover {
    text-decoration: underline;
}

.blog-content {
    margin-top: 20px;
    line-height: 1.6;
    color: #555;
}

/* =========================================================
   Expand/Collapse (category + product descriptions)
   ========================================================= */

.subcategory-description {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 6em;
    transition: max-height 0.5s ease-in-out;
}

.subcategory-description.expanded {
    -webkit-line-clamp: unset;
    max-height: 1000px;
}

.expand-btn {
    background: white;
    color: black;
    border: 1px solid grey;
    padding: 5px 10px;
    cursor: pointer;
    margin-top: 5px;
    border-radius: 5px;
    display: inline-block;
}

.expand-btn:hover {
    background: #f1f1f1;
}

/* =========================================================
   Cart / Checkout
   ========================================================= */

.cart-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 5px;
    margin: 10px auto 15px;
    max-width: 1200px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

.cart-table th,
.cart-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.cart-table th {
    background-color: #f9f9f9;
}

.quantity-input,
.cart-table input[type="number"] {
    width: 70px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-summary {
    text-align: right;
    margin-top: 20px;
}

.cart-summary strong {
    font-size: 1.2rem;
}

.update-button,
.remove-button,
.checkout-button {
    background-color: #04AA6D;
    color: white;
    padding: 10px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.update-button:hover,
.checkout-button:hover {
    background-color: #037a50;
}

.remove-button {
    background-color: #d9534f;
}

.remove-button:hover {
    background-color: #c9302c;
}

/* =========================================================
   Product Detail Page
   ========================================================= */

.product-detail .pagebody {
    align-items: stretch;
}

.product-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .product-overview {
        grid-template-columns: 1fr;
    }
}

.product-images .main-image img,
#main-view {
    width: 100%;
    max-width: 520px;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: block;
}

.thumbnails {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 520px;
}

.thumbnail {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

.product-specifications ul,
.product-key-features ul {
    padding-left: 20px;
}

.product-key-features .price {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 10px;
}

.product-key-features .price span {
    font-size: 1em;
    color: darkred;
    text-decoration: line-through;
    margin-left: 10px;
}

/* Buttons on product page */
.add-to-cart,
.buy-now {
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-to-cart {
    background-color: #04AA6D;
}

.add-to-cart:hover {
    background-color: #037a50;
}

.buy-now {
    background-color: #d9534f;
    margin-left: 10px;
}

.buy-now:hover {
    background-color: #c9302c;
}

/* =========================================================
   Contact page
   ========================================================= */

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form label {
    font-weight: bold;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.contact-form textarea {
    min-width: 100%;
    max-width: 100%;
    font-family: inherit;
    font-size: 1rem;
}

.contact-form .submit-button {
    background-color: #04AA6D;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.contact-form .submit-button:hover {
    background-color: #037a50;
}

.call-us {
    margin-top: 20px;
    text-align: center;
}

.call-button {
    display: inline-block;
    background-color: #0073e6;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
}

.call-button:hover {
    background-color: #005bb5;
}

.success { color: green; }
.error { color: red; }

/* =========================================================
   Footer
   ========================================================= */

footer {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0;
    margin: 0;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: rgba(255, 255, 255, 0.8);
}
