/* Base Styles */
.products-main {
    font-size: 1.05rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #222;
    background-color: var(--color-white);
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
}

.products-header {
    background-color: var(--color-light-gray);
    width: 80%;
    height: 300px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.products-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary-blue);
}

.products-header h3 {
    font-size: 1rem;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
    font-weight: 400;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

.products-header .categories {
    font-size: 1rem;
    color: var(--text-color-dark);
    text-decoration: none;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.products-header .categories a {
    color: #1a237e;
    text-decoration: none;
    transition: color 0.3s ease;
}

.products-header .categories a:hover {
    color: #0d47a1;
}

.products-header .categories a:focus,
.products-header .categories a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.products-header .categories a:active {
    color: var(--primary-color);
}

.products-header .categories a:visited {
    color: var(--text-color-dark);
}

.products-header .categories a:visited:hover {
    color: var(--primary-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 90%;
    margin: 2rem auto;
}

.product-card {
    background: #fff;
    border-radius: var(--corner-radius-medium);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    max-width: 180px;
    aspect-ratio: 3 / 2;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.2rem;
}

.product-card h2 {
    font-size: 1.35rem;
    color: var(--primary-color, #1a237e);
    font-weight: 700;
    margin-bottom: 0.7rem;
    margin-top: 0;
}

.product-card ul {
    list-style: disc inside;
    color: #222;
    font-size: 1.05rem;
    margin: 0 0 0.7rem 0;
    padding: 0;
    text-align: left;
}

.product-card p,
.pack-sizes {
    color: #222;
    font-size: 1.05rem;
    margin: 0 0 0.7rem 0;
}

.pack-sizes {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Comparison Table */
.products-table-container {
    width: 90%;
    margin: 2rem auto;
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 1rem;
}

.products-table th,
.products-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.products-table th {
    background: var(--background-color-gray, #f5f5f5);
    color: var(--primary-color, #1a237e);
    font-weight: bold;
}

.products-table tr:last-child td {
    border-bottom: none;
}

/* Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
}

.product-detail-main {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    background: var(--background-color-gray, #F5F5F5);
    padding: 40px 0;
}

.product-detail-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(76, 89, 134, 0.10);
    display: flex;
    flex-wrap: wrap;
    max-width: 700px;
    /* width: 100%; */
    padding: 32px;
    gap: 32px;
    animation: fadeIn 0.7s;
}

.product-detail-img {
    width: 260px;
    height: 260px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(76, 89, 134, 0.08);
    background: #f8f9fa;
}

.product-detail-info {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-detail-info h1 {
    font-size: 2.2rem;
    color: var(--background-color-main, #4C5986);
    margin-bottom: 12px;
}

.product-detail-desc {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 10px;
}

.product-detail-packs {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
}

.product-detail-price {
    font-size: 1.2rem;
    color: #1a7e23;
    font-weight: bold;
    margin-bottom: 18px;
}

.back-to-products {
    display: inline-block;
    margin-top: 18px;
    color: #fff;
    background: var(--background-color-main, #4C5986);
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.back-to-products:hover {
    background: var(--background-color-light-blue, #A1AAC9);
    color: #222;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    color: var(--color-text);
    font-family: var(--font-body-family);
    font-size: var(--font-size-body);
}

main.product-detail-main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

.highlight-product {
    outline: 3px solid #ff9800;
    box-shadow: 0 0 10px 2px #ff9800;
    transition: outline 0.3s, box-shadow 0.3s;
}

/* === Enhanced Responsive Media Queries === */

/* 1. Mobile Devices – 320px to 480px */
@media (max-width: 480px) {
    .products-header {
        width: 80%;
        padding: 1rem;
        height: auto;
        border-radius: 4px;
        box-shadow: none;
    }

    .products-header h1 {
        font-size: 1.3rem;
    }

    .products-header h3 {
        font-size: 0.95rem;
        max-width: 95vw;
    }

    .products-header .categories {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.95rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 98%;
    }

    .product-card {
        padding: 1rem 0.5rem;
        border-radius: 6px;
    }

    .product-card img {
        max-width: 120px;
        border-radius: 6px;
    }

    .products-table th,
    .products-table td {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .modal-content {
        padding: 1.2rem;
        max-width: 98vw;
    }

    .product-detail-card {
        flex-direction: column;
        align-items: center;
        padding: 1.5rem;
        gap: 1rem;
    }

    .product-detail-img {
        width: 100%;
        max-width: 200px;
        height: auto;
    }

    .product-detail-info {
        text-align: center;
        padding: 0 0.5rem;
    }

    .back-to-products {
        width: 100%;
        padding: 10px 0;
        font-size: 1rem;
    }

    body {
        font-size: 15px;
    }
}

/* 2. iPads and Tablets – 481px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
    .products-header {
        width: 95%;
        padding: 1.5rem;
        border-radius: 6px;
    }

    .products-header h1 {
        font-size: 1.7rem;
    }

    .products-header h3 {
        font-size: 1rem;
    }

    .products-header .categories {
        font-size: 1rem;
        gap: 0.7rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
        width: 96%;
    }

    .product-card {
        padding: 1.2rem 0.7rem;
        border-radius: 8px;
    }

    .product-card img {
        max-width: 140px;
        border-radius: 8px;
    }

    .products-table th,
    .products-table td {
        font-size: 1rem;
        padding: 0.7rem;
    }

    .modal-content {
        padding: 1.5rem;
        max-width: 95vw;
    }

    .product-detail-card {
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        gap: 1.5rem;
    }

    .product-detail_img {
        width: 100%;
        max-width: 220px;
        height: auto;
    }

    .product-detail-info {
        text-align: center;
        padding: 0 1rem;
    }

    .back-to-products {
        width: 80%;
        font-size: 1.05rem;
    }

    body {
        font-size: 16px;
    }
}

/* 3. Laptops and small screens – 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .products-header {
        width: 90%;
        padding: 2rem;
        height: auto;
        border-radius: 8px;
    }

    .products-header h1 {
        font-size: 2rem;
    }

    .products-header h3 {
        font-size: 1.05rem;
    }

    .products-header .categories {
        font-size: 1.05rem;
        gap: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        width: 94%;
    }

    .product-card {
        padding: 1.5rem 1rem;
        border-radius: 10px;
    }

    .product-card img {
        max-width: 160px;
        border-radius: 10px;
    }

    .products-table th,
    .products-table td {
        font-size: 1.05rem;
        padding: 0.8rem;
    }

    .modal-content {
        padding: 2rem;
        max-width: 80vw;
    }

    .product-detail-card {
        flex-direction: row;
        padding: 2.5rem;
        gap: 2rem;
    }

    .product-detail-img {
        width: 180px;
        height: 180px;
    }

    .product-detail-info {
        text-align: left;
        padding: 0 1.5rem;
    }

    .back-to-products {
        width: auto;
        font-size: 1.1rem;
    }

    body {
        font-size: 17px;
    }
}

/* 4. Large screens and Desktops – 1025px to 1200px */
@media (min-width: 1025px) and (max-width: 1200px) {
    .products-header {
        width: 80%;
        height: 300px;
        padding: 2rem;
        border-radius: 10px;
    }

    .products-header h1 {
        font-size: 2.5rem;
    }

    .products-header h3 {
        font-size: 1.1rem;
    }

    .products-header .categories {
        font-size: 1.1rem;
        gap: 1.2rem;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
        width: 90%;
    }

    .product-card {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: 12px;
    }

    .product-card img {
        max-width: 180px;
        border-radius: 12px;
    }

    .products-table th,
    .products-table td {
        font-size: 1.1rem;
        padding: 1rem;
    }

    .modal-content {
        max-width: 400px;
        padding: 2.5rem;
    }

    .product-detail-card {
        max-width: 700px;
        padding: 3rem;
        gap: 2.5rem;
    }

    .product-detail-img {
        width: 220px;
        height: 220px;
    }

    .product-detail-info {
        text-align: left;
        padding: 0 2rem;
    }

    .back-to-products {
        font-size: 1.15rem;
    }

    body {
        font-size: 18px;
    }
}

/* 5. TV and Extra-Large Screens – 1201px and up */
@media (min-width: 1201px) {
    .products-header {
        width: 70%;
        height: 350px;
        padding: 3rem;
        border-radius: 14px;
    }

    .products-header h1 {
        font-size: 3rem;
    }

    .products-header h3 {
        font-size: 1.2rem;
    }

    .products-header .categories {
        font-size: 1.2rem;
        gap: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2.5rem;
        width: 85%;
    }

    .product-card {
        padding: 2.5rem 2rem 2rem;
        border-radius: 16px;
    }

    .product-card img {
        max-width: 200px;
        border-radius: 16px;
    }

    .products-table th,
    .products-table td {
        font-size: 1.1rem;
        padding: 1rem 1.2rem;
    }

    .modal-content {
        max-width: 500px;
        padding: 3rem;
    }

    .product-detail-card {
        max-width: 900px;
        padding: 3rem;
        gap: 3rem;
    }

    .product-detail-img {
        width: 300px;
        height: 300px;
    }

    .product-detail-info {
        text-align: left;
        padding: 0 2.5rem;
    }

    .back-to-products {
        font-size: 1.2rem;
    }

    body {
        font-size: 19px;
    }
}