/* ========================================
   ICECAT PRO - FRONTEND STYLES
   Version: 2.0.6
   For product page display
   ======================================== */

/* ========== TAB CONTENT WRAPPER ========== */

.icecat-tab-content {
    padding: 0;
    margin: 0;
}

/* ========== IMPORTED CONTENT DISPLAY ========== */

.icecat-imported-content {
    margin: 30px 0;
    clear: both;
}

/* Specifications */
.icecat-specifications {
    margin: 0;
    padding: 0;
    background: #fff;
}

.icecat-specifications .shop_attributes {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    margin: 0;
    table-layout: fixed;
}

.icecat-specifications .shop_attributes th,
.icecat-specifications .shop_attributes td {
    padding: 14px 18px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

.icecat-specifications .shop_attributes th {
    font-weight: 600;
    color: #1d2327;
    width: 40%;
    background: #f8f9fa;
    font-size: 15px;
}

.icecat-specifications .shop_attributes td {
    color: #646970;
    font-size: 15px;
    line-height: 1.6;
    width: 60%;
}

.icecat-specifications .shop_attributes tr:hover {
    background: #fafbfc;
}

.icecat-specifications .shop_attributes tr:last-child th,
.icecat-specifications .shop_attributes tr:last-child td {
    border-bottom: none;
}

/* PDF Manuals */
.icecat-pdf-manuals {
    margin: 0;
    padding: 0;
}

.icecat-pdf-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.icecat-pdf-list li {
    margin: 0;
}

.icecat-pdf-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    color: #1d2327;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

.icecat-pdf-link:hover {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-color: #2271b1;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.icecat-pdf-link::before {
    content: "📄";
    font-size: 24px;
}

/* Videos */
.icecat-videos {
    margin: 0;
    padding: 0;
}

.icecat-video {
    margin: 25px 0;
}

.icecat-video h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.icecat-video video {
    width: 100%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.icecat-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.icecat-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Reasons to Buy */
.icecat-reasons-to-buy {
    margin: 0;
    padding: 0;
}

.icecat-reasons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.icecat-reasons-list li {
    margin: 10px 0;
    padding-left: 30px;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
}

.icecat-reasons-list li strong {
    position: absolute;
    left: 0;
    color: #4caf50;
    font-size: 18px;
}

/* Bullet Points */
.icecat-bullet-points {
    margin: 0;
    padding: 0;
}

.icecat-bullets-list {
    list-style: disc;
    padding-left: 25px;
    margin: 0;
}

.icecat-bullets-list li {
    margin: 8px 0;
    font-size: 16px;
    line-height: 1.6;
}

/* ========== LIVE CONTAINER (NO UGLY CYAN!) ========== */

.icecat-live-container {
    margin: 0;
    padding: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
}

.icecat-live-container::before {
    display: none !important;
}

/* Ensure Icecat Live content fits in container */
.icecat-live-container * {
    max-width: 100%;
    box-sizing: border-box;
}

.icecat-live-container iframe,
.icecat-live-container img {
    max-width: 100% !important;
    height: auto !important;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .icecat-specifications,
    .icecat-pdf-manuals,
    .icecat-videos,
    .icecat-reasons-to-buy,
    .icecat-bullet-points,
    .icecat-live-container {
        padding: 20px;
    }
    
    .icecat-specifications h2,
    .icecat-pdf-manuals h2,
    .icecat-videos h2,
    .icecat-specifications .shop_attributes th {
        width: 40%;
        font-size: 14px;
    }
    
    .icecat-specifications .shop_attributes td {
        font-size: 14px;
    }
    
    .icecat-pdf-list {
        grid-template-columns: 1fr;
    }
    
    .icecat-reasons-list li {
        font-size: 15px;
        padding-left: 45px;
    }
}

/* ========== ICECAT NOTICES ========== */

.icecat-notice,
.icecat-error {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.icecat-error {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.icecat-notice p,
.icecat-error p {
    margin: 0;
    color: #856404;
    font-size: 15px;
}

.icecat-error p {
    color: #721c24;
}

/* Product Story */
.icecat-product-story {
    line-height: 1.7;
}

/* Icecat Live button — inline, fixed size */
.icp-live-btn {
    display: block !important;
    width: 100% !important;
    transition: all 0.15s;
    margin: 10px 0 !important;
    font-size: 15px !important;
    padding: 12px 20px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

.icp-live-btn:hover {
    opacity: 0.85;
}

/* Buy Together checkbox (targets input directly) */
.icp-bt-checkbox {
    accent-color: #2271b1;
}

/* ========== BUY TOGETHER ========== */

/* Buy Together — strictly contained inside summary column */
.icp-buy-together {
    margin: 15px 0;
    padding: 10px;
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    box-sizing: border-box !important;
    font-size: 12px;
    line-height: 1.4;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    clear: both;
    word-break: break-word;
}

/* Force summary column to contain all children */
.woocommerce div.product div.summary,
.woocommerce div.product .entry-summary {
    overflow: hidden !important;
    max-width: 100%;
}

/* Images inside Buy Together — small thumbnails */
.icp-buy-together .icp-bt-item-image {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    flex-shrink: 0;
}

/* Product names — always truncate */
.icp-buy-together .icp-bt-item-name {
    font-size: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Price — compact */
.icp-buy-together .icp-bt-item-price {
    font-size: 11px !important;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 70px;
    text-align: right;
    overflow: hidden;
}

/* Items row — prevent overflow */
.icp-buy-together .icp-bt-item {
    min-width: 0;
    overflow: hidden;
}

/* Footer — stack on narrow columns */
.icp-buy-together .icp-bt-footer {
    flex-wrap: wrap;
}

/* Group titles — compact */
.icp-buy-together .icp-bt-group-title {
    font-size: 12px;
}

/* Title — compact */
.icp-buy-together .icp-bt-title {
    font-size: 14px;
}

/* Prevent product gallery image from being oversized */
.woocommerce div.product div.images img {
    max-width: 100%;
    height: auto;
}

/* Truncate long product names */
.icp-buy-together .icp-bt-item-name,
.icp-buy-together .icp-bt-item-name a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    text-decoration: none;
    color: #333;
    line-height: 1.4;
}

.icp-buy-together .icp-bt-item-name a:hover {
    color: #2271b1;
}

.icp-buy-together .icp-bt-item-meta {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
}

.icp-bt-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}

/* Main product */
.icp-bt-main-product {
    margin-bottom: 8px;
}

.icp-bt-item-main {
    background: #f7f7f7 !important;
    border-color: #ddd !important;
}

.icp-bt-item-main input[type="checkbox"] {
    accent-color: #2271b1;
}

/* Groups */
.icp-bt-group {
    margin-bottom: 10px;
}

.icp-bt-group-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}

.icp-bt-toggle {
    display: inline-block;
    font-size: 10px;
    margin-right: 4px;
    transition: transform 0.2s;
}

.icp-bt-group-title.open .icp-bt-toggle {
    transform: rotate(90deg);
}

.icp-bt-items {
    display: none;
}

.icp-bt-items.open {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.icp-bt-group-count {
    font-weight: 400;
    color: #999;
    font-size: 12px;
}

.icp-bt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    margin: 0;
    font-size: 13px;
}

.icp-bt-item:last-child {
    border-bottom: none;
}

.icp-bt-item:hover {
    background: #f9f9f9;
}

.icp-bt-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #2271b1;
    margin: 0;
}

.icp-bt-item input[type="checkbox"]:checked ~ .icp-bt-item-info .icp-bt-item-name {
    color: #2271b1;
}

/* Quantity input */
.icp-bt-qty {
    width: 42px !important;
    height: 28px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    padding: 2px 4px;
    flex-shrink: 0;
    margin: 0;
    -moz-appearance: textfield;
}

.icp-bt-qty::-webkit-outer-spin-button,
.icp-bt-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.icp-bt-item-image {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    overflow: hidden;
}

.icp-bt-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icp-bt-item-info {
    flex: 1;
    min-width: 0;
}

.icp-bt-item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icp-bt-item-meta {
    display: block;
    font-size: 12px;
    color: #646970;
    margin-top: 2px;
}

.icp-bt-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* Footer */
.icp-bt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

.icp-bt-total {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icp-bt-total-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.icp-bt-total-price {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.icp-bt-add-all {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
}

.icp-bt-add-all.icp-bt-success {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #fff !important;
}

.icp-bt-add-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .icp-buy-together {
        padding: 12px;
    }

    .icp-bt-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .icp-bt-total {
        justify-content: center;
    }

    .icp-bt-add-all {
        width: 100%;
    }
}

/* ========== CONFIGURATOR BUTTON ========== */

a.icp-configurator-btn,
a.icp-configurator-btn:link,
a.icp-configurator-btn:visited,
button.icp-configurator-btn {
    display: inline-block !important;
    width: auto !important;
    margin: 10px 0 !important;
    font-size: 13px !important;
    padding: 8px 20px !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    text-decoration: none !important;
    text-align: center !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    font-weight: 600 !important;
    border: none !important;
}

a.icp-configurator-btn:hover,
button.icp-configurator-btn:hover {
    opacity: 0.85;
}

/* Inside modal — allow wider items, no truncation needed */
#icp-cfg-modal .icp-buy-together {
    max-width: none;
    width: 100%;
}

#icp-cfg-modal .icp-bt-item-name {
    white-space: normal;
}

#icp-cfg-modal .icp-bt-items.open {
    max-height: none;
}

#icp-cfg-modal .icp-bt-item-image {
    width: 48px;
    height: 48px;
}

/* ========== CONFIGURATOR PAGE (shortcode) ========== */

/* Page configurator — wider items, no truncation */
#icp-pcfg-result .icp-buy-together {
    max-width: 900px;
}

#icp-pcfg-result .icp-bt-item-name {
    white-space: normal;
}

#icp-pcfg-result .icp-bt-items.open {
    max-height: none;
}

#icp-pcfg-result .icp-bt-item-image {
    width: 48px;
    height: 48px;
}

/* ========== CARDS MODE ========== */

.icp-cfg-cards-group {
    margin-bottom: 25px;
}

.icp-cfg-cards-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e5e5;
}

.icp-cfg-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.icp-cfg-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.icp-cfg-card:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34,113,177,0.15);
}

.icp-cfg-card.checked {
    border-color: #2271b1;
    background: #f0f7ff;
}

.icp-cfg-card input[type="checkbox"] {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #2271b1;
}

.icp-cfg-card-img {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.icp-cfg-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.icp-cfg-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.icp-cfg-card-name a {
    text-decoration: none;
    color: inherit;
}

.icp-cfg-card-name a:hover {
    color: #2271b1;
}

.icp-cfg-card-meta {
    font-size: 11px;
    color: #646970;
    margin-bottom: 6px;
}

.icp-cfg-card-price {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.icp-cfg-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.icp-cfg-card .icp-bt-qty {
    width: 50px !important;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    padding: 4px;
    flex-shrink: 0;
}

/* Timbru verde info per product */
.icp-timbru-info {
    color: #166534 !important;
    font-style: italic;
}

@media (max-width: 768px) {
    .icp-cfg-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
