/* Category Collections & Switch Styling */

/* View Switcher: Товар / Коллекции */
.collection-view-switch-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 12px;
    margin-left: auto;
}

.collection-view-switch {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 4px 10px;
    user-select: none;
}

.collection-view-switch__label {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0 6px;
}

.collection-view-switch__label.active {
    color: #0f172a;
    font-weight: 700;
}

.collection-switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0 4px;
}

.collection-switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.collection-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.collection-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.collection-switch-toggle input:checked + .collection-switch-slider {
    background-color: #0f172a;
}

.collection-switch-toggle input:checked + .collection-switch-slider:before {
    transform: translateX(20px);
}

/* Collection Cards Grid */
.collection-cards-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.collection-card-item {
    padding: 0 10px;
    margin-bottom: 24px;
}

.pcoll-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.pcoll-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* Main Product (First product from category) */
.pcoll-main {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.pcoll-main__image {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.pcoll-main__image img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pcoll-card:hover .pcoll-main__image img {
    transform: scale(1.03);
}

.pcoll-main__name {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 8px;
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}

.pcoll-main__name:hover {
    color: #0284c7;
    text-decoration: none;
}

.pcoll-main__rating {
    font-size: 13px;
    color: #eab308;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pcoll-main__reviews {
    color: #64748b;
    font-size: 13px;
    text-decoration: underline;
    margin-left: 4px;
}

.pcoll-main__price-row {
    margin-top: auto;
    margin-bottom: 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.pcoll-main__price {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.pcoll-main__price-old {
    font-size: 16px;
    color: #94a3b8;
    text-decoration: line-through;
}

.pcoll-main__cart-btn {
    width: 100%;
    background-color: #111827;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pcoll-main__cart-btn:hover {
    background-color: #374151;
    color: #ffffff;
}

/* Divider & Collection Title */
.pcoll-divider {
    border-top: 1px solid #e2e8f0;
    margin: 18px 0 14px 0;
}

.pcoll-header-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #0f172a;
    text-decoration: underline;
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.pcoll-header-link:hover {
    color: #0284c7;
}

/* Thumbnail Slider */
.pcoll-slider-wrap {
    position: relative;
    width: 100%;
}

.pcoll-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 2px 8px 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.pcoll-track::-webkit-scrollbar {
    height: 5px;
}

.pcoll-track::-webkit-scrollbar-track {
    background: transparent;
}

.pcoll-track::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.pcoll-thumb-item {
    flex: 0 0 100px;
    width: 100px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px;
    background: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.pcoll-thumb-item:hover {
    transform: translateY(-2px);
    border-color: #94a3b8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    text-decoration: none;
}

.pcoll-thumb-img {
    width: 86px;
    height: 86px;
    object-fit: contain;
    margin-bottom: 4px;
}

.pcoll-thumb-price {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

/* Slider Arrow Buttons */
.pcoll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    color: #334155;
    font-size: 12px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.pcoll-arrow:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    transform: translateY(-50%) scale(1.1);
}

.pcoll-arrow.pcoll-prev {
    left: -10px;
}

.pcoll-arrow.pcoll-next {
    right: -10px;
}

@media (max-width: 767px) {
    .pcoll-main__image {
        height: 200px;
    }
    .pcoll-arrow {
        display: none; /* Mobile uses native touch swipe */
    }
    .collection-view-switch-wrap {
        justify-content: center;
        width: 100%;
        margin-bottom: 16px;
    }
}

/* Hide regular products block and show-more when in collection mode */
.collection-cards-grid ~ .products-block,
.collection-cards-grid + .products-block,
.collection-cards-grid ~ .show-more,
.collection-cards-grid + .show-more {
    display: none !important;
}

