/* WC Product Documents - Frontend Styles */

/* Common Styles */
.wc-product-documents,
.wc-category-documents,
.wc-general-documents,
.wc-products-docs-table {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wc-docs-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
}

/* ========================================
   PRODUCTS TABLE (with expandable rows)
   ======================================== */
.wc-products-table {
    width: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wc-products-table-header {
    display: grid;
    grid-template-columns: 50px 1fr 100px 100px 140px 80px;
    background: #fff;
    padding: 16px 0;
    font-weight: 600;
    font-size: 11px;
    color: #888;
    border-bottom: 1px solid #e5e5e5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wc-products-table-header > div {
    padding: 0 16px;
}

.wc-products-table-header .col-expand {
    padding: 0;
}

.wc-products-table-header .col-m2,
.wc-products-table-header .col-nobb {
    line-height: 1.3;
}

.wc-products-table-header .col-m2 small,
.wc-products-table-header .col-nobb small {
    font-weight: 400;
    opacity: 0.8;
}

.wc-products-table-row {
    display: grid;
    grid-template-columns: 50px 1fr 100px 100px 140px 80px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: background 0.15s ease;
    background: #fff;
}

.wc-products-table-row:nth-child(even) {
    background: #f8f8f8;
}

.wc-products-table-row:last-of-type {
    border-bottom: none;
}

.wc-products-table-row:hover {
    background: #f2f2f2;
}

.wc-products-table-row > div {
    padding: 0 16px;
    font-size: 14px;
    color: #333;
}

.wc-products-table-row .col-expand {
    padding: 0 0 0 16px;
}

.wc-products-table-row .col-name {
    font-weight: 500;
    color: #1a1a1a;
}

.wc-products-table-row .col-sku,
.wc-products-table-row .col-nobb,
.wc-products-table-row .col-dimensions,
.wc-products-table-row .col-m2 {
    color: #555;
    font-size: 13px;
}

/* Expand Button */
.wc-expand-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.wc-expand-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.wc-expand-btn svg {
    width: 16px;
    height: 16px;
    fill: #666;
    transition: fill 0.15s ease;
}

.wc-expand-btn .icon-minus {
    display: none;
}

.wc-expand-btn[aria-expanded="true"] .icon-plus {
    display: none;
}

.wc-expand-btn[aria-expanded="true"] .icon-minus {
    display: block;
}

.wc-expand-btn[aria-expanded="true"] {
    background: #333;
    border-color: #333;
}

.wc-expand-btn[aria-expanded="true"] svg {
    fill: #fff;
}

/* Expandable Documents Section */
.wc-products-table-documents {
    display: none;
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
}

.wc-products-table-documents.is-open {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wc-docs-inner {
    padding: 16px 20px;
}

.wc-docs-inner .wc-docs-table {
    border: none;
    background: transparent;
}

.wc-docs-inner .wc-docs-row {
    grid-template-columns: auto 1fr auto;
    padding: 12px 0;
    background: transparent !important;
    border-bottom: 1px solid #e5e5e5;
    gap: 12px;
}

.wc-docs-inner .wc-docs-row:last-child {
    border-bottom: none;
}

.wc-docs-inner .wc-docs-abbr {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    background: #ffd650 !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

/* ========================================
   DOCUMENTS TABLE (simple list)
   ======================================== */
.wc-docs-table {
    width: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wc-docs-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
    background: #fff;
}

.wc-docs-row:nth-child(even) {
    background: #f8f8f8;
}

.wc-docs-row:last-child {
    border-bottom: none;
}

.wc-docs-row:hover {
    background: #f2f2f2;
}

.wc-docs-abbr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1a1a1a;
    background: #ffd650;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wc-docs-label {
    font-size: 14px;
    color: #333;
}

.wc-docs-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #212121;
    color: #ffd650;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.wc-docs-download:hover {
    background: #000;
    color: #ffd650;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wc-docs-download:active {
    transform: translateY(0);
}

.wc-docs-download svg {
    width: 14px;
    height: 14px;
    fill: #ffd650;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 900px) {
    .wc-products-table-header {
        display: none;
    }
    
    .wc-products-table-row {
        grid-template-columns: 40px 1fr;
        gap: 4px;
        padding: 14px 10px;
    }
    
    .wc-products-table-row .col-name {
        grid-column: 2;
        font-weight: 600;
        margin-bottom: 4px;
    }
    
    .wc-products-table-row .col-sku,
    .wc-products-table-row .col-nobb,
    .wc-products-table-row .col-dimensions,
    .wc-products-table-row .col-m2 {
        grid-column: 2;
        padding-left: 0;
        font-size: 12px;
        color: #666;
    }
    
    .wc-products-table-row .col-sku:not(:empty)::before {
        content: "Art.nr: ";
        font-weight: 500;
    }
    
    .wc-products-table-row .col-nobb:not(:empty)::before {
        content: "NOBB/GTIN: ";
        font-weight: 500;
    }
    
    .wc-products-table-row .col-dimensions:not(:empty)::before {
        content: "Dim: ";
        font-weight: 500;
    }
    
    .wc-products-table-row .col-m2:not(:empty)::before {
        content: "M²/pakke: ";
        font-weight: 500;
    }
    
    .wc-docs-inner {
        padding: 12px 14px;
    }
}

@media (max-width: 600px) {
    .wc-docs-row {
        grid-template-columns: 60px 1fr;
        gap: 8px;
        padding: 12px 16px;
    }
    
    .wc-docs-download {
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 8px;
        padding: 8px 16px;
    }
}
