/* Minimal Warehouse Manager Styles */

#ss-warehouse-manager {
    margin: 25px 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    overflow: hidden;
}

.warehouse-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
}

.size-chart-link {
    font-size: 14px;
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #007cba;
}

.size-chart-link:hover {
    background: #007cba;
    color: #fff;
}

/* Warehouse Table */
#warehouse-table-container {
    margin: 0;
    padding: 0 20px 20px 20px;
}

.warehouse-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 14px;
}

.error-message {
    color: #dc3545;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
}

.warehouse-table-wrapper {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    padding-top: 20px;
}

.warehouse-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    font-family: inherit;
    table-layout: fixed;
}

.warehouse-table th,
.warehouse-table td {
    padding: 10px 0px !important;
    text-align: center;
    vertical-align: middle;
    border: none;
}

/* Header styling */
.warehouse-header {
    background: #f8f9fa;
    width: 160px;
    border-right: 1px solid #e5e5e5;
}

.size-header {
    background: #f8f9fa;
    padding: 16px 12px;
    width: calc((100% - 160px) / 7);
    border-right: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    box-sizing: border-box;
}

.size-header:last-child {
    border-right: none;
}

.size-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.size-price {
    color: #007cba;
    font-weight: 600;
    font-size: 13px;
}

/* Warehouse name column */
.warehouse-name {
    background: #f8f9fa;
    padding: 16px;
    text-align: left;
    width: 160px;
    border-right: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    box-sizing: border-box;
}

.warehouse-name strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.warehouse-label {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

/* Individual warehouse/size cells */
.warehouse-size-cell {
    padding: 12px 8px;
    background: #fff;
    width: calc((100% - 160px) / 7);
    border-right: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

.warehouse-size-cell:last-child {
    border-right: none;
}

.warehouse-size-cell:hover {
    background: #f8f9fa;
}

.stock-number {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
    text-align: center;
    width: 100%;
}

.stock-number.low-stock {
    color: #dc3545;
}

.warehouse-qty-input {
    width: 60px;
    max-width: calc(100% - 16px);
    padding: 6px !important;
    border: 1px solid #ddd;
    border-radius: 4px !important;
    text-align: center;
    font-size: 13px !important;
    font-weight: 500;
    transition: border-color 0.2s ease !important;
    background: #fff;
    margin: 0 auto;
    display: block;
}

.warehouse-qty-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.warehouse-qty-input:not([value="0"]):not([value=""]) {
    background: #f8f9fa;
    border-color: #007cba;
}

.out-of-stock-text {
    color: #999;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 400;
    text-align: center;
}

.notify-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    margin: 0 auto;
}

.notify-btn:hover {
    background: #e9ecef;
    border-color: #bbb;
}

/* Add to Cart Section */
.warehouse-add-to-cart {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

#add-warehouse-to-cart {
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#add-warehouse-to-cart:hover:not(:disabled) {
    background: #222;
    transform: translateY(-1px);
}

#add-warehouse-to-cart:disabled,
#add-warehouse-to-cart.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Success Message */
.woocommerce-message {
    margin: 0 0 15px 0;
    padding: 15px 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    font-weight: 500;
    font-size: 14px;
}

/* Integration with WooCommerce variations */
.variations {
    margin-bottom: 15px;
}

/* Hide original add to cart when warehouse manager is active */
.single_add_to_cart_button {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ss-warehouse-manager {
        margin: 15px 0;
        border-radius: 6px;
    }

    .warehouse-section h3 {
        font-size: 16px;
        padding: 15px 15px 0 15px;
    }

    #warehouse-table-container {
        padding: 0 15px 15px 15px;
    }

    .size-chart-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    .warehouse-table {
        font-size: 13px;
    }

    .warehouse-header {
        width: 120px;
    }

    .size-header {
        padding: 12px 8px;
        width: calc((100% - 120px) / 7);
    }

    .warehouse-name {
        width: 120px;
        padding: 12px;
    }

    .warehouse-name strong {
        font-size: 13px;
    }

    .warehouse-size-cell {
        width: calc((100% - 120px) / 7);
        padding: 10px 4px;
    }

    .warehouse-qty-input {
        width: 50px;
        padding: 5px;
        font-size: 12px;
    }

    #add-warehouse-to-cart {
        padding: 10px 25px;
        font-size: 13px;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .warehouse-table-wrapper {
        border-radius: 4px;
        overflow-x: auto;
    }

    .warehouse-table {
        min-width: 600px;
    }

    .warehouse-header {
        width: 100px;
    }

    .size-header {
        width: calc((600px - 100px) / 7);
        padding: 10px 6px;
    }

    .warehouse-name {
        width: 100px;
        padding: 10px 8px;
    }

    .warehouse-size-cell {
        width: calc((600px - 100px) / 7);
        padding: 8px 4px;
    }

    .warehouse-qty-input {
        width: 45px;
        font-size: 11px;
    }

    .stock-number {
        font-size: 14px;
    }

    .size-name {
        font-size: 13px;
    }

    .size-price {
        font-size: 12px;
    }

    .warehouse-add-to-cart {
        padding: 15px;
    }
}

.rey-cartBtnQty.--atc-normal-hover.--style-default {
    display: none;
}

/* Size Chart Modal Styles */
#ss-size-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ss-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 800px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.ss-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.ss-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.ss-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.ss-modal-close:hover {
    background: #e5e5e5;
    color: #333;
}

.ss-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Size Chart Table Styles */
.ss-size-chart-container {
    width: 100%;
}

.size-chart-product-info {
    margin-bottom: 20px;
    text-align: center;
}

.size-chart-product-info h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.size-chart-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.size-chart-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e5;
    background: #fff;
    font-size: 14px;
}

.size-chart-table th,
.size-chart-table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e5e5e5;
}

.size-chart-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.size-chart-table .spec-header {
    background: #007cba;
    color: #fff;
    text-align: left;
    font-weight: 600;
}

.size-chart-table .spec-name {
    background: #f8f9fa;
    text-align: left;
    font-weight: 500;
    color: #333;
}

.size-chart-table .spec-value {
    background: #fff;
    color: #666;
}

.size-chart-table tbody tr:nth-child(even) .spec-value {
    background: #fafafa;
}

.size-chart-note {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 3px solid #007cba;
    border-radius: 4px;
}

.size-chart-note p {
    margin: 0;
    color: #666;
    font-style: italic;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #ss-size-chart-modal {
        padding: 10px;
    }
    
    .ss-modal-content {
        max-height: 95vh;
    }
    
    .ss-modal-header,
    .ss-modal-body {
        padding: 15px;
    }
    
    .size-chart-table {
        font-size: 12px;
    }
    
    .size-chart-table th,
    .size-chart-table td {
        padding: 8px 4px;
    }
}