/**
 * Frontend styles for WooCommerce Compatible Accessories
 * Fully scoped under .wca-accessories-section to prevent style leaking.
 */

.wca-accessories-section {
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.wca-accessories-section .wca-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

/* Slider Controls */
.wca-accessories-section .wca-slider-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.wca-accessories-section .wca-accessories-slider {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    padding: 10px 2px;
    width: 100%;
    scroll-snap-type: x mandatory;
}

.wca-accessories-section .wca-accessories-slider::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.wca-accessories-section .wca-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #4a5568;
    transition: all 0.2s ease;
}

.wca-accessories-section .wca-slider-btn:hover {
    background: #f7fafc;
    color: #1a202c;
    border-color: #cbd5e0;
    transform: translateY(-50%) scale(1.05);
}

.wca-accessories-section .wca-prev-btn {
    left: -12px;
}

.wca-accessories-section .wca-next-btn {
    right: -12px;
}

/* Accessory Card */
.wca-accessories-section .wca-accessory-card {
    flex: 0 0 145px;
    background: #ffffff;
    border: 1px solid #f1f1f1;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
}

.wca-accessories-section .wca-accessory-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f3f4f6;
    color: #000000;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    z-index: 5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.wca-accessories-section .wca-accessory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border-color: #e2e8f0;
}

.wca-accessories-section .wca-accessory-card:hover .wca-accessory-badge {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.wca-accessories-section .wca-accessory-card.selected {
    border-color: #27ae60;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.08);
}

/* Card Image Area */
.wca-accessories-section .wca-card-image {
    width: 100%;
    height: 85px;
    background: #fafafa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 6px;
}

.wca-accessories-section .wca-card-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.wca-accessories-section .wca-accessory-card:hover .wca-card-image img {
    transform: scale(1.04);
}

.wca-accessories-section .wca-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Card Body */
.wca-accessories-section .wca-card-content {
    flex-grow: 1;
    margin-bottom: 8px;
}

.wca-accessories-section .wca-card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.25;
}

.wca-accessories-section .wca-card-desc {
    font-size: 10px;
    color: #718096;
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.wca-accessories-section .wca-stock-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.wca-accessories-section .wca-low-stock {
    background: #fff5f5;
    color: #e53e3e;
}

.wca-accessories-section .wca-no-stock {
    background: #edf2f7;
    color: #4a5568;
}

/* Out of Stock Card */
.wca-accessories-section .wca-card-out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

.wca-accessories-section .wca-card-out-of-stock:hover {
    transform: none;
    box-shadow: none;
    border-color: #f1f1f1;
}

/* Card Footer */
.wca-accessories-section .wca-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f7fafc;
}

.wca-accessories-section .wca-card-price,
.wca-accessories-section .wca-card-price .amount,
.wca-accessories-section .wca-card-price bdi {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #5f5f5f !important;
}

.wca-accessories-section .wca-no-stock-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #a0aec0;
}

.wca-accessories-section .wca-no-stock-css-trick::after {
    content: attr(data-text);
    color: #a0aec0 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Add Button */
.wca-accessories-section .wca-add-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #5f5f5f;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
    outline: none;
}

.wca-accessories-section .wca-add-button:hover:not(:disabled) {
    transform: scale(1.08);
}

.wca-accessories-section .wca-add-button:disabled {
    color: #a0aec0;
    cursor: not-allowed;
}

.wca-accessories-section .wca-plus-icon, 
.wca-accessories-section .wca-check-icon {
    display: block;
}

/* Accessory Summary Panel */
.wca-accessories-section .wca-summary-panel {
    margin-top: 20px;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    display: flex;
    justify-content: flex-start;
    gap: 40px;
    align-items: center;
}

.wca-accessories-section .wca-summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
}

.wca-accessories-section .wca-summary-label {
    font-weight: 500;
}

.wca-accessories-section .wca-summary-val {
    font-weight: 700;
    color: #1a1a1a;
}

.wca-accessories-section .wca-summary-row.wca-grand-row {
    font-size: 15px;
    color: #1a1a1a;
    border-left: 2px solid #edf2f7;
    padding-left: 40px;
}

.wca-accessories-section .wca-summary-row.wca-grand-row .wca-summary-val {
    color: #11a4d0;
    font-weight: 700;
    font-size: 19px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wca-accessories-section .wca-summary-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .wca-accessories-section .wca-summary-row.wca-grand-row {
        border-left: none;
        border-top: 1px solid #edf2f7;
        padding-left: 0;
        padding-top: 12px;
        width: 100%;
    }
}

/* Category Grouping Styles */
.wca-accessories-section .wca-category-group {
    margin-bottom: 24px;
}

.wca-accessories-section .wca-category-group:last-of-type {
    margin-bottom: 0;
}

.wca-accessories-section .wca-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.wca-accessories-section .wca-category-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #000000;
}

.wca-accessories-section .wca-select-all-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.wca-accessories-section .wca-select-all-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
}

.wca-accessories-section .wca-select-all-btn.wca-btn-active {
    background: #ebf8ff;
    border-color: #bee3f8;
    color: #2b6cb0;
}
