/* Sale page container */
.sale-page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* Header styling */
.sale-header {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-height: 50px;
}

.sale-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sale-header h1 {
    color: var(--primary-color);
    font-size: 20px;
    margin: 0;
    font-weight: 600;
}

.sale-info {
    font-size: 13px;
    color: #666;
    display: flex;
    gap: 20px;
}

.sale-info p {
    margin: 0;
    display: flex;
    align-items: center;
}

.sale-info p::before {
    content: "•";
    color: var(--primary-color);
    margin-right: 6px;
}

.sale-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.products-count {
    font-size: 14px;
    color: var(--primary-color);
    white-space: nowrap;
}

#sort-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    min-width: 180px;
}

/* Table styling */
.sale-table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sale-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
}

.sale-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
}

.sale-table td {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

/* Product image column */
.product-image {
    width: 195px;
}

.image-container {
    position: relative;
    margin-bottom: 8px;
    cursor: pointer;
}

.image-container img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.photo-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Product state badges */
.product-state {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 8px;
    text-align: left;
    width: auto;  /* Reset width */
}

.product-state.nieuw {
    background-color: #d4edda;
    color: #155724;
}

.product-state.gebruikt {
    background-color: #fff3cd;
    color: #856404;
}

.product-state.zo-goed-als-nieuw {
    background-color: #cce5ff;
    color: #004085;
}

/* Product description */
.product-title {
    font-size: 16px;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-weight: 600;
}

.description-content {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.description-content p {
    margin: 0 0 8px 0;
}

.description-content ul {
    margin: 0 0 8px 0;
    padding-left: 20px;
}

/* Read more/less buttons */
.read-more,
.read-less {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 0;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
}

/* Price column */
.product-price-col {
    width: 130px;
}

.price-wrapper {
    text-align: right;
}

.main-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.shipping-price {
    font-size: 13px;
    color: #666;
}

/* Lightbox */
.simple-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: pointer;
}

.simple-lightbox.active {
    display: block;
}

.lightbox-outer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 75px;
    touch-action: pan-x;
    user-select: none;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: default;
}

.lightbox-image-container {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: scroll;
    -webkit-overflow-scrolling: touch;
}

.lightbox-image {
    max-height: 80vh;
    max-width: 70vw;
    object-fit: contain;
}

/* Lightbox controls */
.prev-btn,
.next-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 24px;
}

.prev-btn:disabled,
.next-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.close-btn {
    position: fixed;
    top: 80px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    z-index: 10000;
}

.image-counter {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .sale-header {
        flex-direction: column;
        max-height: none;
        padding: 15px;
        gap: 15px;
    }

    .sale-header-left,
    .sale-header-right {
        width: 100%;
    }

    .sale-info {
        flex-direction: column;
        gap: 5px;
    }

    .sale-header-right {
        flex-direction: column;
        align-items: stretch;
    }

    #sort-select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sale-table thead {
        display: none;
    }
    
    .sale-table-wrapper {
        background: #f5f5f5;
        padding: 6px;
    }
    
    .sale-table tr {
        display: block;
        padding: 10px;
        background: white;
        margin-bottom: 10px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        width: 100%;
    }
    
    .sale-table td {
        display: block;
        width: 100% !important;
        padding: 10px 0;
        border: none;
    }
    
    .product-image {
        width: auto;
        text-align: center;
    }
    
   
    .product-state {
        text-align: left;
        width: auto;
        display: inline-block;
    }
    
    .image-container {
        display: inline-block;
        max-width: 375px;
        width: 100%;
    }
    
    .price-wrapper {
        text-align: left;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }

    .lightbox-content {
        flex-direction: column;
        gap: 10px;
    }

    .prev-btn,
    .next-btn {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

/* Print styles */
@media print {
    .sale-header,
    .simple-lightbox {
        display: none !important;
    }

    .sale-table-wrapper {
        box-shadow: none;
    }

    .sale-table td {
        padding: 10px;
    }

    .image-container img {
        max-width: 100px;
    }
}