/* Inline styles for category sections, product cards, product details, cart icon, and badge */
.category-section {
    padding: 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.category-header {
    font: 700 1.8rem 'Montserrat', Arial, sans-serif;
    color: #9AB87A;
    text-shadow: 2px 2px 4px rgba(34, 49, 37, 0.8);
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    position: relative;
    display: inline-block;
}

.category-header::after {
    content: '';
    display: block;
    width: 80%;
    height: 3px;
    background: #9AB87A;
    margin: 0.5rem auto 0;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(63, 90, 68, 0.6);
}

.card-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    margin: 0 auto;
}

.card {
    background: rgba(42, 50, 42, 0.7);
    border: 2px solid #9AB87A;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 4px 4px 8px rgba(63, 90, 68, 0.6);
    filter: drop-shadow(0 4px 12px rgba(154, 184, 122, 0.4));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.card:hover {
    transform: scale(1.03);
    box-shadow: 6px 6px 12px rgba(63, 90, 68, 0.7);
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

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

.card h3 {
    font: 700 0.85rem 'Montserrat', Arial, sans-serif;
    color: #9AB87A;
    text-shadow: 2px 2px 4px rgba(34, 49, 37, 0.8);
    margin: 0.5rem 0;
    word-wrap: break-word;
}

.card .price {
    font: 700 0.8rem 'Open Sans', Arial, sans-serif;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.card .description {
    font: 400 0.55rem 'Open Sans', Arial, sans-serif;
    color: #FFFFFF;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card .coa-link {
    font: 400 0.8rem 'Open Sans', Arial, sans-serif;
    color: #9AB87A;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.card .coa-link:hover {
    color: #5A7A5A;
    text-decoration: underline;
}

.card .add-to-cart {
    background: #9AB87A;
    color: #3A4A3A;
    border: none;
    padding: 0.75rem 1.5rem;
    font: 700 1rem 'Montserrat', Arial, sans-serif;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 4px 4px 12px rgba(34, 49, 37, 0.4);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.card .add-to-cart:hover {
    background: #5A7A5A;
    box-shadow: 5px 5px 14px rgba(34, 49, 37, 0.4);
    filter: drop-shadow(0 0 8px rgba(154, 184, 122, 0.4));
    transform: translateY(-2px);
}

.card .add-to-cart:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shine 0.8s ease-out forwards;
}

.product-details {
    display: none;
    background: rgba(42, 50, 42, 0.7);
    border: 2px solid #9AB87A;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 4px 4px 8px rgba(63, 90, 68, 0.6);
    filter: drop-shadow(0 4px 12px rgba(154, 184, 122, 0.4));
    max-width: 1200px;
    margin: 2rem auto;
    box-sizing: border-box;
}

.product-details.show {
    display: block;
}

.product-details .detail-image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(154, 184, 122, 0.4));
}

.product-details h2 {
    font: 700 1.5rem 'Montserrat', Arial, sans-serif;
    color: #9AB87A;
    text-shadow: 2px 2px 4px rgba(34, 49, 37, 0.8);
    margin-bottom: 1rem;
}

.product-details .price {
    font: 700 1.2rem 'Open Sans', Arial, sans-serif;
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.product-details .quantity-container {
    margin-bottom: 1rem;
}

.product-details .quantity-input {
    width: 80px;
    padding: 0.5rem;
    font: 400 0.8rem 'Open Sans', Arial, sans-serif;
    color: #FFFFFF;
    background: transparent;
    border: 2px solid #9AB87A;
    border-radius: 4px;
    box-shadow: 2px 2px 4px rgba(34, 49, 37, 0.4);
}

.product-details .quantity-input::-webkit-inner-spin-button,
.product-details .quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
    background: #9AB87A;
}

.product-details .description {
    font: 400 0.8rem 'Open Sans', Arial, sans-serif;
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.product-details .coa-link {
    font: 400 0.8rem 'Open Sans', Arial, sans-serif;
    color: #9AB87A;
    text-decoration: none;
    margin-bottom: 1rem;
    display: inline-block;
}

.product-details .coa-link:hover {
    color: #5A7A5A;
    text-decoration: underline;
}

.product-details .compliance-notice {
    font: 400 0.8rem 'Open Sans', Arial, sans-serif;
    color: #FFFFFF;
    margin-top: 1rem;
}

.product-details .add-to-cart,
.product-details .back-to-store {
    background: #9AB87A;
    color: #3A4A3A;
    border: none;
    padding: 0.75rem 1.5rem;
    font: 700 1rem 'Montserrat', Arial, sans-serif;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 4px 4px 12px rgba(34, 49, 37, 0.4);
    position: relative;
    overflow: hidden;
    margin: 0.5rem auto;
    display: block;
}

.product-details .back-to-store {
    background: transparent;
    border: 2px solid #9AB87A;
}

.product-details .add-to-cart:hover,
.product-details .back-to-store:hover {
    background: #5A7A5A;
    box-shadow: 5px 5px 14px rgba(34, 49, 37, 0.4);
    filter: drop-shadow(0 0 8px rgba(154, 184, 122, 0.4));
    transform: translateY(-2px);
}

.product-details .back-to-store:hover {
    background: #9AB87A;
}

.product-details .add-to-cart:hover::before,
.product-details .back-to-store:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shine 0.8s ease-out forwards;
}

.cart-fab {
    position: fixed;
    width: 48px;
    height: 48px;
    background: #9AB87A;
    border-radius: 50%;
    box-shadow: 4px 4px 12px rgba(34, 49, 37, 0.4);
    z-index: 200000; /* High z-index to stay above all elements */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, top 0.3s ease, right 0.3s ease;
    text-align: center;
    line-height: 48px;
    display: block; /* Always visible in store */
}

.cart-fab svg {
    width: 24px;
    height: 24px;
    fill: #3A4A3A;
    vertical-align: middle;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #5A7A5A;
    color: #FFFFFF;
    font: 700 0.7rem 'Montserrat', Arial, sans-serif;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: none; /* Hidden when cartCount = 0 */
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.cart-badge.show {
    display: flex;
}

.cart-fab:hover {
    transform: scale(1.1);
    box-shadow: 5px 5px 14px rgba(34, 49, 37, 0.4);
    filter: drop-shadow(0 0 8px rgba(154, 184, 122, 0.4));
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Responsive styles */
@media (orientation: portrait) and (max-width: 767px) {
    .category-header {
        font-size: 1.6rem;
        padding: 0.3rem;
    }
    .card-grid {
        padding: 0;
    }
    .card {
        width: 85%;
        margin: 0 auto;
        padding: 1.25rem;
    }
    .card img {
        height: 120px;
    }
    .card h3 {
        font-size: 1.6rem;
    }
    .card .price, .card .description, .card .coa-link {
        font-size: 1.1rem;
    }
    .product-details {
        padding: 1rem;
        margin: 1rem auto;
    }
    .product-details h2 {
        font-size: 1.5rem;
    }
    .product-details .detail-image {
        height: 250px;
    }
    .product-details .price,
    .product-details .description,
    .product-details .coa-link,
    .product-details .compliance-notice {
        font-size: 0.8rem;
    }
    .product-details .quantity-input {
        width: 100%;
        max-width: 80px;
    }
    .cart-fab {
        width: 58px; /* 48px * 1.2 */
        height: 58px;
        line-height: 58px;
        z-index: 200000;
    }
    .cart-fab svg {
        width: 29px; /* 24px * 1.2 */
        height: 29px;
    }
    .cart-badge {
        width: 14px; /* 12px * 1.2 */
        height: 14px;
        font-size: 0.7rem;
        top: -6px; /* Adjusted for larger FAB (5px * 1.2) */
        right: -6px;
    }
}

@media (orientation: landscape) and (max-width: 767px) {
    .category-header {
        font-size: 1.4rem;
        padding: 0.3rem;
    }
    .card {
        width: 90%;
        padding: 0.6rem;
    }
    .card img {
        height: 55px;
    }
    .card h3 {
        font-size: 1rem;
    }
    .card .price, .card .description, .card .coa-link {
        font-size: 0.9rem;
    }
    .product-details {
        padding: 0.75rem;
        margin: 0.75rem auto;
    }
    .product-details h2 {
        font-size: 1.2rem;
    }
    .product-details .detail-image {
        height: 150px;
    }
    .product-details .price,
    .product-details .description,
    .product-details .coa-link,
    .product-details .compliance-notice {
        font-size: 0.7rem;
    }
    .cart-fab {
        width: 53px; /* 44px * 1.2 */
        height: 53px;
        line-height: 53px;
        z-index: 200000;
    }
    .cart-fab svg {
        width: 26px; /* 22px * 1.2 */
        height: 26px;
    }
    .cart-badge {
        width: 12px; /* 10px * 1.2 */
        height: 12px;
        font-size: 0.6rem;
        top: -6px; /* Adjusted for larger FAB (5px * 1.2) */
        right: -6px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .category-header {
        font-size: 1.8rem;
    }
    .card-grid {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    .card {
        flex: 0 0 calc(50% - 1rem);
        width: calc(50% - 1rem);
        padding: 0.8rem;
    }
    .card img {
        height: 80px;
    }
    .card h3 {
        font-size: 1.1rem;
    }
    .card .price, .card .description, .card .coa-link {
        font-size: 0.85rem;
    }
    .product-details {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
    }
    .product-details .detail-image {
        flex: 0 0 300px;
        height: 300px;
    }
    .product-details .detail-content {
        flex: 1;
        min-width: 300px;
    }
    .cart-fab {
        width: 67px; /* 56px * 1.2 */
        height: 67px;
        line-height: 67px;
        z-index: 200000;
    }
    .cart-fab svg {
        width: 34px; /* 28px * 1.2 */
        height: 34px;
    }
    .cart-badge {
        width: 17px; /* 14px * 1.2 */
        height: 17px;
        font-size: 0.8rem;
        top: -6px; /* Adjusted for larger FAB (5px * 1.2) */
        right: -6px;
    }
}

@media (min-width: 1024px) {
    .category-header {
        font-size: 2.2rem;
        padding: 1rem;
    }
    .card-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    .card {
        flex: 0 0 calc(33.333% - 1rem);
        width: calc(33.333% - 1rem);
        padding: 2rem;
    }
    .card img {
        height: 180px;
    }
    .card h3 {
        font-size: 1.5rem;
    }
    .card .price, .card .description, .card .coa-link {
        font-size: 1.2rem;
    }
    .product-details {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
    }
    .product-details .detail-image {
        flex: 0 0 500px;
        height: 500px;
    }
    .product-details .detail-content {
        flex: 1;
        min-width: 400px;
    }
    .product-details h2 {
        font-size: 2rem;
    }
    .product-details .price,
    .product-details .description,
    .product-details .coa-link,
    .product-details .compliance-notice {
        font-size: 1rem;
    }
    .cart-fab {
        width: 64px;
        height: 64px;
        line-height: 64px;
        z-index: 200000;
    }
    .cart-fab svg {
        width: 32px;
        height: 32px;
    }
    .cart-badge {
        width: 16px;
        height: 16px;
        font-size: 0.9rem;
        top: -5px;
        right: -5px;
    }
}