/**
 * HoReCa Product Widgets - Frontend Styles
 */

/* Base font */
.hpw-brand-widget,
.hpw-attributes-widget,
.hpw-gallery-widget,
.hpw-documents-widget,
.hpw-articles-widget {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.hpw-brand-widget *,
.hpw-attributes-widget *,
.hpw-gallery-widget *,
.hpw-documents-widget *,
.hpw-articles-widget * {
    box-sizing: border-box;
}

/* ===== BRAND WIDGET ===== */
.hpw-brand-widget {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hpw-brand-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hpw-brand-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpw-brand-placeholder {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
}

.hpw-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hpw-brand-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.hpw-brand-subtitle {
    font-size: 13px;
    color: #999;
    line-height: 1.3;
}

/* ===== ATTRIBUTES WIDGET ===== */
.hpw-attributes-widget {
    width: 100%;
}

.hpw-attributes-table {
    width: 100%;
}

.hpw-attributes-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.hpw-attributes-row:last-child {
    border-bottom: none;
}

.hpw-attributes-header {
    font-weight: 600;
}

.hpw-attr-label {
    flex: 0 0 50%;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.hpw-attr-value {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.hpw-attributes-button-wrapper {
    margin-top: 15px;
}

.hpw-attributes-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.hpw-attributes-button:hover {
    background-color: #e8e8e8;
    text-decoration: none;
    color: #333;
}

.hpw-attributes-button svg {
    flex-shrink: 0;
}

/* ===== GALLERY WIDGET ===== */
.hpw-gallery-widget {
    width: 100%;
    display: block;
}

.hpw-gallery-main-wrapper {
    position: relative;
    width: 100%;
}

.hpw-gallery-main {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 400px;
    margin: 0 auto;
    background-color: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.hpw-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: opacity 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.hpw-gallery-placeholder {
    font-size: 14px;
    color: #999;
    text-transform: uppercase;
}

/* Back Button */
.hpw-gallery-back {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 15;
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hpw-gallery-back:hover {
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hpw-gallery-back svg {
    width: 20px;
    height: 20px;
    stroke: #333;
}

/* Labels */
.hpw-gallery-label {
    position: absolute;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
}

.hpw-gallery-label.top-left {
    top: 10px;
    left: 10px;
}

.hpw-gallery-label.top-right {
    top: 10px;
    right: 10px;
}

.hpw-gallery-label.bottom-left {
    bottom: 10px;
    left: 10px;
}

.hpw-gallery-label.bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Thumbnails Wrapper - Desktop */
.hpw-gallery-thumbs-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.hpw-gallery-thumbs {
    overflow: hidden;
    max-width: 100%;
}

.hpw-gallery-thumbs-inner {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease;
    justify-content: center;
}

.hpw-gallery-thumb {
    width: 70px;
    height: 70px;
    min-width: 70px;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hpw-gallery-thumb:hover {
    border-color: #ddd;
}

.hpw-gallery-thumb.active {
    border-color: #3498db;
}

.hpw-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.hpw-thumb-placeholder {
    font-size: 8px;
    color: #999;
    text-transform: uppercase;
}

/* Arrows */
.hpw-gallery-arrow {
    width: 30px;
    height: 30px;
    min-width: 30px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hpw-gallery-arrow:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.hpw-gallery-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile Dots - Hidden on Desktop */
.hpw-gallery-dots {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    min-height: 8px;
}

.hpw-gallery-dot {
    height: 8px;
    border-radius: 4px;
    background-color: #ccc;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                transform 0.3s ease;
    cursor: pointer;
}

.hpw-gallery-dot:not(.active) {
    width: 8px;
}

.hpw-gallery-dot.active {
    width: 24px;
    background-color: #333;
}

/* ===== DOCUMENTS WIDGET ===== */
.hpw-documents-widget {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 0;
}

.hpw-documents-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.hpw-documents-list {
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
}

.hpw-document-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hpw-document-item:hover {
    background-color: #f5f5f5;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hpw-document-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hpw-document-icon svg {
    width: 24px;
    height: 24px;
    fill: #00d4d4;
}

.hpw-document-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* ===== ARTICLES WIDGET ===== */
.hpw-articles-widget {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 0;
}

.hpw-articles-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

/* List Layout */
.hpw-articles-list {
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
}

.hpw-article-item-list {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hpw-article-item-list:hover {
    background-color: #f5f5f5;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hpw-article-item-list .hpw-article-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.hpw-article-item-list .hpw-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpw-article-item-list .hpw-article-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Grid Layout */
.hpw-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.hpw-article-item-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hpw-article-item-grid:hover {
    background-color: #f5f5f5;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hpw-article-item-grid .hpw-article-thumb {
    width: 100%;
    height: 120px;
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.hpw-article-item-grid .hpw-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpw-article-item-grid .hpw-article-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
}

/* No content messages */
.hpw-no-documents,
.hpw-no-articles {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* ===== DESCRIPTION ACCORDION WIDGET ===== */
.hpw-description-accordion {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: transparent;
    border-radius: 0;
    overflow: hidden;
}

.hpw-description-header {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 15px 0;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    border-bottom-style: solid;
    transition: opacity 0.2s ease;
    user-select: none;
}

.hpw-description-header:hover {
    opacity: 0.7;
}

.hpw-description-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 16px;
    margin: 0;
    padding: 0;
    display: inline-block;
    vertical-align: middle;
}

.hpw-description-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    line-height: 16px;
    vertical-align: middle;
}

.hpw-description-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke: #333;
    transition: transform 0.3s ease;
}

.hpw-description-accordion.is-expanded .hpw-description-icon svg {
    transform: rotate(180deg);
}

.hpw-description-content-wrapper {
    overflow: hidden;
}

.hpw-description-content {
    padding: 20px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.hpw-description-content p {
    margin: 0 0 15px 0;
}

.hpw-description-content p:last-child {
    margin-bottom: 0;
}

.hpw-description-content ul,
.hpw-description-content ol {
    margin: 0 0 15px 20px;
    padding: 0;
}

.hpw-description-content li {
    margin-bottom: 5px;
}

/* ===== STICKY CART WIDGET ===== */
.hpw-sticky-cart-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

.hpw-sticky-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 16px;
    height: 60px;
    background-color: #fff;
    box-sizing: border-box;
}

.hpw-sticky-cart.has-shadow {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.hpw-sticky-cart-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.hpw-sticky-cart-price del {
    color: #999;
    font-size: 12px;
}

.hpw-sticky-cart-price ins {
    text-decoration: none;
}

.hpw-sticky-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #00d4d4;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 400px;
    height: 44px;
    box-sizing: border-box;
}

.hpw-sticky-cart-button:hover {
    background-color: #00bfbf;
}

.hpw-sticky-cart-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hpw-sticky-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hpw-sticky-cart-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.hpw-sticky-cart-text {
    white-space: nowrap;
}

/* ===== GALLERY MOBILE VERSION ===== */
.hpw-gallery-mobile {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

.hpw-gallery-mobile .hpw-gallery-main-wrapper {
    width: 100% !important;
}

.hpw-gallery-mobile .hpw-gallery-main {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    min-height: 100vw !important;
    height: 100vw !important;
    flex-shrink: 0 !important;
}

.hpw-gallery-mobile .hpw-gallery-main img {
    max-width: 100%;
    max-height: 100%;
}

/* Hide thumbnails, show dots for mobile version */
.hpw-gallery-mobile .hpw-gallery-thumbs-wrapper {
    display: none !important;
}

.hpw-gallery-mobile .hpw-gallery-dots {
    display: flex !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Articles Grid */
    .hpw-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hpw-article-item-grid .hpw-article-thumb {
        height: 100px;
    }
}

@media (max-width: 480px) {
    /* Brand */
    .hpw-brand-image {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .hpw-brand-name {
        font-size: 14px;
    }
    
    .hpw-brand-subtitle {
        font-size: 12px;
    }
    
    /* Attributes */
    .hpw-attr-label,
    .hpw-attr-value {
        font-size: 13px;
    }
    
    .hpw-attributes-button {
        width: 100%;
        justify-content: center;
    }
    
    /* Gallery */
    .hpw-gallery-main {
        border-radius: 8px;
    }
    
    .hpw-gallery-back {
        width: 32px;
        height: 32px;
    }
    
    .hpw-gallery-back svg {
        width: 18px;
        height: 18px;
    }
    
    /* Documents */
    .hpw-documents-widget {
        padding: 15px;
    }
    
    .hpw-document-item {
        padding: 10px 12px;
        border-radius: 12px;
    }
    
    .hpw-document-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .hpw-document-name {
        font-size: 13px;
    }
    
    /* Articles */
    .hpw-articles-widget {
        padding: 15px;
    }
    
    .hpw-articles-grid {
        grid-template-columns: 1fr;
    }
    
    .hpw-article-item-list {
        padding: 10px 12px;
        border-radius: 12px;
    }
    
    .hpw-article-item-list .hpw-article-thumb {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }
    
    .hpw-article-item-list .hpw-article-name {
        font-size: 13px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .hpw-article-item-grid {
        flex-direction: row;
        align-items: center;
        padding: 12px;
    }
    
    .hpw-article-item-grid .hpw-article-thumb {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }
    
    .hpw-article-item-grid .hpw-article-name {
        font-size: 13px;
    }
    
    /* Description Accordion */
    .hpw-description-header {
        padding: 12px 0;
    }
    
    .hpw-description-title {
        font-size: 13px;
    }
    
    .hpw-description-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .hpw-description-content {
        padding: 15px 0;
        font-size: 13px;
    }
}
