﻿/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Carousel */
.carousel-caption p {
    font-size: 20px;
    line-height: 1.4;
}

/* Make .svg files in the carousel display properly in older browsers */
.carousel-inner .item img[src$=".svg"] {
    width: 100%;
}

/* QR code generator */
#qrCode {
    margin: 15px;
}

/* Hide/rearrange for smaller screens */
@media screen and (max-width: 767px) {
    /* Hide captions */
    .carousel-caption {
        display: none;
    }
}

/* ===== Product Listing: Toolbar ===== */
.listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f8f5;
    border: 1px solid #e8e5de;
    border-radius: 6px;
    margin-top: 16px;
    margin-bottom: 8px;
    gap: 16px;
    flex-wrap: wrap;
}

.listing-toolbar__filters {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.listing-toolbar__control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.listing-toolbar__label {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #696763;
    white-space: nowrap;
    margin-bottom: 0;
}

.listing-toolbar__select {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    color: #363432;
    padding: 6px 28px 6px 10px;
    border: 1px solid #d4d1ca;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23696763' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 8px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 80px;
    transition: border-color 0.2s ease;
}

.listing-toolbar__select:hover {
    border-color: #fe980f;
}

.listing-toolbar__select:focus {
    outline: none;
    border-color: #fe980f;
    box-shadow: 0 0 0 2px rgba(254, 152, 15, 0.15);
}

.listing-toolbar__view-toggle {
    display: flex;
    gap: 4px;
}

/* ===== Product Listing: View Toggle ===== */
.view-toggle__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d4d1ca;
    border-radius: 4px;
    background: #fff;
    color: #696763;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.view-toggle__btn:hover {
    border-color: #fe980f;
    color: #fe980f;
    text-decoration: none;
}

.view-toggle__btn--active {
    background: #fe980f;
    border-color: #fe980f;
    color: #fff;
}

.view-toggle__btn--active:hover {
    background: #e88a0d;
    border-color: #e88a0d;
    color: #fff;
}

@media (max-width: 767px) {
    .listing-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .listing-toolbar__filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .listing-toolbar__control {
        justify-content: space-between;
    }

    .listing-toolbar__select {
        flex: 1;
    }

    .listing-toolbar__view-toggle {
        justify-content: flex-end;
    }
}

/* ===== Product Listing: Grid View ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1rem 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #f5e8d6;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card__image-link {
    display: block;
    text-decoration: none;
}

.product-card__image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
    padding: 10px;
}

.product-card__image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.product-card__scale-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: white;
    border: 1px solid slategray;
    color: gray;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 1;
}

.product-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 14px 8px;
    border-top: 1px solid #f5e8d6;
}

.product-card__name {
    color: #363432;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__name a {
    color: #363432;
    text-decoration: none;
}

.product-card__name a:hover {
    color: #fe980f;
}

.product-card__rating {
    margin-bottom: 6px;
    font-size: 13px;
}

.product-card__rating-text {
    color: #696763;
    margin-left: 3px;
    font-size: 12px;
}

.product-card__price {
    margin-bottom: 8px;
}

.product-card__price-current {
    color: #fe980f;
    font-family: Roboto, sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.product-card__price-old {
    color: #696763;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    text-decoration: line-through;
    margin-right: 8px;
}

.product-card__price-discount {
    color: white;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 700;
    margin-left: 8px;
    background: #e53935;
    padding: 3px 8px;
    border-radius: 5px;
    z-index: 1;
}

.product-card__availability {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-family: Roboto, sans-serif;
    margin-top: auto;
    margin-bottom: 4px;
}

.product-card__availability .availability-green {
    font-weight: bold;
    color: green;
}

.product-card__availability .availability-red {
    font-weight: bold;
    color: red;
}

.product-card__availability .availability-orange {
    font-weight: bold;
    color: #fb8c00;
}

.product-card__footer {
    padding: 8px 14px 14px;
}

.product-card__footer .cart {
    display: block;
    width: 100%;
    margin-left: 0;
    margin-bottom: 0;
}

.product-card__cart-message {
    font-size: 12px;
    margin-top: 4px;
}

/* ===== Product Listing: List View ===== */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
}

.product-list-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 16px 0;
    border-bottom: 1px solid #f5e8d6;
}

.product-list-item:first-child {
    border-top: 1px solid #f5e8d6;
}

.product-list-item:hover {
    background: #fefcf9;
}

.product-list-item__image-link {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
}

.product-list-item__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-list-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-list-item__name {
    color: #363432;
    font-family: Roboto, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.product-list-item__name a {
    color: #363432;
    text-decoration: none;
}

.product-list-item__name a:hover {
    color: #fe980f;
    text-decoration: none;
}

.product-list-item__rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 14px;
    margin-top: 4px;
}

.product-list-item__rating-count {
    color: #696763;
    margin-left: 4px;
    font-size: 13px;
}

.product-list-item__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 8px;
}

.product-list-item__price-current {
    color: #fe980f;
    font-family: Roboto, sans-serif;
    font-size: 26px;
    font-weight: 700;
}

.product-list-item__price-old {
    color: #696763;
    font-family: Roboto, sans-serif;
    font-size: 16px;
    text-decoration: line-through;
}

.product-list-item__sale-badge {
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
}

.product-list-item__availability {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-family: Roboto, sans-serif;
    margin-top: 6px;
}

.product-list-item__availability .availability-green {
    font-weight: bold;
    color: green;
}

.product-list-item__availability .availability-red {
    font-weight: bold;
    color: red;
}

.product-list-item__availability .availability-orange {
    font-weight: bold;
    color: #fb8c00;
}

.product-list-item__cart {
    margin-top: 10px;
}

.product-list-item__cart .cart {
    margin-left: 0;
}

/* ===== Responsive: Grid ===== */
@media (min-width: 992px) and (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card__name {
        font-size: 12px;
    }

    .product-card__price-current {
        font-size: 16px;
    }

    .product-list-item {
        gap: 0.75rem;
    }

    .product-list-item__image-link {
        width: 120px;
        height: 120px;
    }

    .product-list-item__name {
        font-size: 14px;
    }

    .product-list-item__price-current {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}
