/* Wholesale Display - Neutral Grey Theme */

/* Category List */
.wholesale-category-list {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.category-list-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
}

.category-list-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-list-content {
    padding: 10px 0;
}

.category-item {
    margin-bottom: 2px;
}

.parent-category {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.parent-category a {
    flex: 1;
    display: block;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

.parent-category a:hover {
    background: #e9ecef;
    color: #212529;
}

.parent-category.has-children a {
    padding-right: 35px;
}

.category-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.category-toggle:hover {
    color: #495057;
}

.category-item.collapsed .category-toggle {
    transform: translateY(-50%) rotate(-90deg);
}

.child-categories {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-item.collapsed .child-categories {
    max-height: 0;
}

.child-categories li {
    margin: 0;
}

.child-categories a {
    display: block;
    padding: 8px 15px 8px 30px;
    font-size: 12px;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s ease;
}

.child-categories a:hover {
    background: #f8f9fa;
    color: #495057;
    padding-left: 35px;
}

/* Product Section */
.wholesale-product-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 30px 20px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 0;
    border-bottom: 2px solid #dee2e6;
}

.product-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #212529;
}

.subcategory-group {
    margin: 30px 0;
}

.subcategory-name {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 15px;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

/* Product Table */
.wholesale-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #dee2e6;
    table-layout: auto;
}

.wholesale-table thead {
    background: #f8f9fa;
}

.wholesale-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
}

.wholesale-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.wholesale-table tbody tr:hover {
    background: #f8f9fa;
}

.wholesale-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Image */
.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #dee2e6;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.product-thumbnail:hover {
    opacity: 0.8;
}

/* Info */
.product-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 13px;
}

.product-title:hover {
    text-decoration: underline;
    color: #495057;
}

.product-variant {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 3px;
}

.product-sku {
    font-size: 10px;
    color: #adb5bd;
    font-family: monospace;
    margin-bottom: 4px;
}

.product-in-cart {
    margin-top: 4px;
}

.in-cart-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Quantity Controls */
.qty-controls {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ced4da;
    background: white;
    border-radius: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: background 0.2s ease;
}

.qty-minus {
    border-right: 1px solid #ced4da;
    border-radius: 3px 0 0 3px;
}

.qty-plus {
    border-left: 1px solid #ced4da;
    border-radius: 0 3px 3px 0;
}

.qty-btn:hover {
    background: #e9ecef;
}

.qty-input {
    width: 45px;
    height: 28px;
    text-align: center;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: #212529;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input:focus {
    outline: none;
    background: #f8f9fa;
}

.qty-error {
    display: none;
    font-size: 9px;
    color: #6c757d;
    margin-top: 4px;
}

/* Prices */
.col-price,
.col-total {
    font-size: 13px;
    color: #212529;
}

.col-total {
    font-weight: 600;
}

/* Cart Button */
.cart-btn {
    background: #495057;
    color: white;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.cart-btn:hover {
    background: #343a40;
}

.cart-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

/* Variant Carousel */
.variant-carousel-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.variant-carousel {
    flex: 1;
    overflow: hidden;
}

.variant-slides {
    display: flex;
    transition: transform 0.3s ease;
    flex: 1;
}

.variant-slide {
    min-width: 100%;
    display: none;
    grid-template-columns: 90px 1fr 80px 140px 100px 100px 120px;
    gap: 15px;
    align-items: center;
    padding: 8px 0;
}

.variant-slide.active {
    display: grid;
}

.variant-col {
    display: flex;
    align-items: center;
}

.variant-col-image {
    justify-content: center;
}

.variant-col-info {
    flex-direction: column;
    align-items: flex-start;
}

.variant-col-min {
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.variant-col-qty {
    justify-content: center;
    flex-direction: column;
}

.variant-col-price {
    justify-content: flex-end;
}

.variant-col-total {
    justify-content: flex-end;
    font-weight: 600;
}

.variant-col-action {
    justify-content: center;
    position: relative;
}

.variant-nav {
    background: transparent;
    color: #6c757d;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.variant-nav:hover {
    color: #212529;
}

.variant-nav:disabled {
    color: #dee2e6;
    cursor: not-allowed;
}

.product-row:not(.has-variants) .variant-nav {
    display: none;
}

/* Fixed variant indicator position */
.variant-indicator {
    position: static;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.variant-count {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.variant-hint {
    font-size: 11px;
    color: #6c757d;
    white-space: nowrap;
}

.variant-indicator .variant-nav {
    font-size: 18px;
    width: 24px;
    height: 24px;
}

/* Instructions Footer */
.wholesale-instructions-footer {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px 25px;
    margin: 40px 0 30px;
}

.wholesale-instructions-footer h4 {
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.instructions-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.instruction-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #495057;
}

.step-number {
    background: #495057;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.mobile-notice {
    display: none;
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 11px;
    color: #6c757d;
    align-items: center;
    gap: 8px;
}

.mobile-notice svg {
    flex-shrink: 0;
}

/* Modals */
.image-modal,
.product-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 35px;
    cursor: pointer;
}

.modal-close:hover {
    color: #ccc;
}

.product-modal-content {
    background: white;
    padding: 25px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border-radius: 8px;
}

.product-modal-content .modal-close {
    color: #495057;
    top: 10px;
    right: 15px;
}

.product-modal h3 {
    margin: 0 25px 15px 0;
    color: #212529;
    font-size: 18px;
}

.product-modal .description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #495057;
    font-size: 13px;
}

.product-modal .dimensions {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.product-modal .dimensions h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #495057;
}

.product-modal .dimensions p {
    margin: 5px 0;
    font-size: 12px;
    color: #6c757d;
}

.no-products {
    text-align: center;
    padding: 40px;
    color: #adb5bd;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .mobile-notice {
        display: flex;
    }

    .instructions-steps {
        grid-template-columns: 1fr 1fr;
    }

    .variant-nav {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .wholesale-instructions-footer {
        padding: 15px;
        margin: 30px 0 20px;
    }

    .wholesale-instructions-footer h4 {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .instructions-steps {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .instruction-step {
        font-size: 11px;
    }

    .step-number {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    /* Product table becomes card-like */
    .wholesale-table {
        border: none;
    }

    .wholesale-table thead {
        display: none;
    }

    .wholesale-table tbody {
        display: block;
    }

    .wholesale-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        overflow: hidden;
        background: white;
    }

    .wholesale-table tbody tr:hover {
        background: white;
    }

    .wholesale-table td {
        display: block;
        padding: 0;
    }

    /* Mobile: Stack variant columns */
    .variant-carousel-wrapper {
        padding-right: 0;
    }

    .variant-slide {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .variant-col {
        width: 100%;
    }

    .variant-col-image {
        justify-content: center;
    }

    .variant-col-image .product-thumbnail {
        width: 100px;
        height: 100px;
    }

    .variant-col-info {
        text-align: center;
        align-items: center;
    }

    .variant-col-min,
    .variant-col-price,
    .variant-col-total {
        justify-content: center;
    }

    .variant-col-min::before {
        content: "Min Qty: ";
        font-weight: normal;
        color: #6c757d;
        font-size: 11px;
    }

    .variant-col-price::before {
        content: "Price: ";
        font-weight: normal;
        color: #6c757d;
        margin-right: 5px;
        font-size: 11px;
    }

    .variant-col-total::before {
        content: "Total: ";
        font-weight: normal;
        color: #6c757d;
        margin-right: 5px;
        font-size: 11px;
    }

    .variant-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        width: 34px;
        height: 34px;
        font-size: 20px;
        background: rgba(108, 117, 125, 0.9);
    }

    .variant-prev {
        left: 5px;
    }

    .variant-next {
        right: 5px;
    }

    .variant-indicator {
        position: static;
        margin-top: 10px;
        transform: none;
    }

    .variant-carousel-wrapper {
        flex-direction: column;
    }

    .product-header h2 {
        font-size: 18px;
    }

    .subcategory-name {
        font-size: 15px;
    }
}