/**
 * Frontend Styles
 */

.wc-howto-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.wc-howto-header {
    text-align: center;
    margin-bottom: 40px;
}

.wc-howto-title {
    font-size: 32px;
    font-weight: 400;
    margin: 0 0 24px 0;
    color: #2c2c2c;
    letter-spacing: -0.5px;
}

.wc-howto-search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.wc-howto-search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafafa;
    color: #333;
}

.wc-howto-search-input:focus {
    border-color: #000;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 20px 20px 0 0;
}

.wc-howto-search-wrapper.has-dropdown .wc-howto-search-input {
    border-radius: 20px 20px 0 0;
}

.wc-howto-search-input::placeholder {
    color: #999;
}

.wc-howto-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    z-index: 2;
}

.wc-howto-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #000;
    border-top: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.wc-howto-search-results {
    padding: 8px 0;
}

.wc-howto-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 12px;
}

.wc-howto-search-result-item:hover {
    background: #f5f5f5;
}

.wc-howto-search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.wc-howto-search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wc-howto-search-result-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.wc-howto-search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.wc-howto-products-heading {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-howto-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.wc-howto-product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
}

.wc-howto-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #000;
}

.wc-howto-product-card:active {
    transform: translateY(-2px);
}

.wc-howto-product-card.hidden {
    display: none;
}

.wc-howto-product-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wc-howto-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-howto-product-card:hover .wc-howto-product-image img {
    transform: scale(1.05);
}

.wc-howto-product-title {
    padding: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
    text-align: center;
    line-height: 1.4;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-howto-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.wc-howto-no-results p {
    font-size: 16px;
    margin: 0;
}

.wc-howto-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-howto-modal.active {
    display: block;
    opacity: 1;
}

.wc-howto-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.wc-howto-modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-howto-modal.active .wc-howto-modal-content {
    transform: translateY(0);
}

.wc-howto-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wc-howto-modal-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.wc-howto-modal-close svg {
    color: #333;
}

.wc-howto-modal-inner {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
}

.wc-howto-modal-header {
    margin-bottom: 24px;
}

.wc-howto-modal-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.wc-howto-modal-image img {
    width: 100%;
    height: auto;
    display: block;
}

.wc-howto-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c2c2c;
    margin: 0 0 20px 0;
    text-align: center;
}

.wc-howto-modal-body {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

.wc-howto-modal-body h1,
.wc-howto-modal-body h2,
.wc-howto-modal-body h3,
.wc-howto-modal-body h4 {
    margin: 24px 0 12px;
    color: #2c2c2c;
}

.wc-howto-modal-body h1 { font-size: 28px; }
.wc-howto-modal-body h2 { font-size: 24px; }
.wc-howto-modal-body h3 { font-size: 20px; }
.wc-howto-modal-body h4 { font-size: 18px; }

.wc-howto-modal-body p {
    margin: 0 0 16px;
}

.wc-howto-modal-body ul,
.wc-howto-modal-body ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.wc-howto-modal-body li {
    margin-bottom: 8px;
}

.wc-howto-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.wc-howto-modal-body a {
    color: #000;
    text-decoration: underline;
}

.wc-howto-modal-body a:hover {
    text-decoration: none;
}

@media (min-width: 768px) {
    .wc-howto-container {
        padding: 0 40px;
    }
    
    .wc-howto-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    
    .wc-howto-title {
        font-size: 40px;
    }
    
    .wc-howto-modal-content {
        left: 50%;
        transform: translate(-50%, 100%);
        max-width: 700px;
        border-radius: 24px;
    }
    
    .wc-howto-modal.active .wc-howto-modal-content {
        transform: translate(-50%, 0);
    }
    
    .wc-howto-modal-inner {
        padding: 40px;
    }
    
    .wc-howto-modal-close {
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

@media (min-width: 1024px) {
    .wc-howto-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 28px;
    }
    
    .wc-howto-modal-content {
        max-width: 800px;
    }
}

@media (max-width: 767px) {
    .wc-howto-container[data-mobile-cols="1"] .wc-howto-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .wc-howto-container[data-mobile-cols="3"] .wc-howto-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .wc-howto-container[data-tablet-cols="2"] .wc-howto-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .wc-howto-container[data-tablet-cols="3"] .wc-howto-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .wc-howto-container[data-tablet-cols="5"] .wc-howto-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .wc-howto-container[data-tablet-cols="6"] .wc-howto-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1024px) {
    .wc-howto-container[data-desktop-cols="2"] .wc-howto-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .wc-howto-container[data-desktop-cols="3"] .wc-howto-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .wc-howto-container[data-desktop-cols="4"] .wc-howto-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .wc-howto-container[data-desktop-cols="5"] .wc-howto-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .wc-howto-container[data-desktop-cols="8"] .wc-howto-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.wc-howto-modal-inner.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.wc-howto-modal-inner.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: wc-howto-spin 1s linear infinite;
}

@keyframes wc-howto-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
