/**
 * Pule Programmatic - Shortcodes Styles
 * Consolidated styles for all plugin shortcodes
 *
 * @package PuleProgrammatic
 */

/* ============================================
   Search Shortcode
   ============================================ */
#pule-search-container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pule-search-form h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
}

.form-group small {
    color: #666;
    font-size: 12px;
}

.button {
    background: #578fca;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-right: 10px;
}

.button:hover {
    background: #4a7bb8;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

/* ============================================
   Search Input Shortcode
   ============================================ */
.pule-search-form {
    margin: 20px 0;
}

.search-input-group {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.pule-search-input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    font-size: 16px;
    outline: none;
}

.pule-search-button {
    padding: 16px 28px;
    background: #578fca;
    color: white !important;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.pule-search-button:hover,
.pule-search-button:visited,
.pule-search-button:focus,
.pule-search-button:active {
    background: #4a7bb8;
    color: white !important;
    text-decoration: none !important;
}

/* ============================================
   Search Results Shortcode
   ============================================ */
.pule-search-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pule-search-header {
    margin-bottom: 30px;
    text-align: center;
}

.pule-search-header h1 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 2rem;
}

.pule-search-meta p {
    color: #64748b;
    margin: 0;
}

.pule-search-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.pule-search-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.pule-search-footer a:hover {
    text-decoration: underline;
}

.pule-no-search {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

/* ============================================
   Product Menu Shortcode
   ============================================ */
.pule-product-menu {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.pule-product-menu .menu-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.category-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-link {
    padding: 12px 15px;
    text-decoration: none;
    color: #555;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

.category-link.active,
.category-link.current-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    transform: translateX(5px);
    position: relative;
    font-weight: 600;
}

.category-link.active::before,
.category-link.current-page::before {
    content: '●';
    position: absolute;
    left: -15px;
    color: #ffffff;
    font-size: 12px;
}

/* ============================================
   With Sidebar Layout
   ============================================ */
.pule-sidebar {
    margin-top: 60px;
}

.pule-sticky-sidebar {
    position: sticky;
    top: 80px;
    align-self: flex-start;
    z-index: 10;
}

/* ============================================
   Category Menu Shortcode
   ============================================ */
.pule-category-menu {
    margin: 20px 0;
}

.category-menu-title {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
}

.category-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
}

.category-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    text-decoration: none;
}

.category-icon {
    font-size: 1.2rem;
}

.category-name {
    font-weight: 500;
}

.pule-category-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

/* ============================================
   Price Filters Shortcode - Compact Inline Chips
   ============================================ */
.pule-price-filters {
    margin: 16px 0 20px 0;
    padding: 0 40px; /* Match products grid padding */
    max-width: 100%;
}

.price-filters-title {
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.price-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center; /* Center the filter chips */
}

/* Sidebar Layout for Price Filters */
.pule-price-filters.layout-sidebar {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 0;
}

.pule-price-filters.layout-sidebar .price-filters-title {
    font-size: 1.2rem;
    color: #2d3748;
    margin: 0 0 16px 0;
    font-weight: 700;
}

.pule-price-filters.layout-sidebar .price-filter-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.pule-price-filters.layout-sidebar .price-filter-btn {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    min-height: 42px;
}

/* Sale button special styling */
.price-filter-btn.sale-filter-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white !important;
    border-color: #ff6b6b;
    font-weight: 600;
}

.price-filter-btn.sale-filter-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e04b5f 100%);
    border-color: #ff5252;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.price-filter-btn.sale-filter-btn.active {
    background: linear-gradient(135deg, #ff5252 0%, #e04b5f 100%);
    border-color: #ff5252;
    border-width: 2px;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.5);
}

/* Override pills style for sale button */
.style-pills .price-filter-btn.sale-filter-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white !important;
}

.style-pills .price-filter-btn.sale-filter-btn.active {
    background: linear-gradient(135deg, #ff5252 0%, #e04b5f 100%);
    color: white !important;
}

/* Override buttons style for sale button */
.style-buttons .price-filter-btn.sale-filter-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white !important;
    border-color: #ff6b6b;
}

.style-buttons .price-filter-btn.sale-filter-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e04b5f 100%);
    color: white !important;
    border-color: #ff5252;
}

.style-buttons .price-filter-btn.sale-filter-btn.active {
    background: linear-gradient(135deg, #ff5252 0%, #e04b5f 100%);
    color: white !important;
    border-color: #ff5252;
    border-width: 2px;
}

/* When filters are inside products listing */
.pule-products-listing .pule-price-filters {
    padding: 0 !important; /* Force remove padding when inline */
    margin: 8px 0 24px 0;
    max-width: 100%;
    text-align: center;
}

.pule-products-listing .price-filter-buttons {
    padding-left: 0;
    margin-left: 0;
    justify-content: center; /* Center the filter chips */
}

/* Centered alignment option */
.pule-price-filters.align-center .price-filter-buttons {
    justify-content: center;
}

.pule-price-filters.align-center .price-filters-title {
    text-align: center;
}

.pule-price-filters.align-center .pule-custom-price-inputs {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Compact chips style (default) */
.style-pills .price-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
    box-sizing: border-box;
    height: 32px;
    line-height: 1;
}

.style-pills .price-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.style-pills .price-filter-btn.active {
    background: #ffffff;
    color: #2d3748;
    border-color: #2d3748;
    border-width: 2px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(45, 55, 72, 0.15);
}

.style-pills .price-filter-btn.active:hover {
    background: #f8f9fa;
    color: #2d3748;
    border-color: #1a202c;
    border-width: 2px;
}

/* Buttons style */
.style-buttons .price-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: #ffffff;
    color: #2d3748;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.style-buttons .price-filter-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.style-buttons .price-filter-btn.active {
    background: #e6f2ff;
    color: #2d3748;
    border-color: #4a90e2;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

/* Tags style */
.style-tags .price-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: #f7fafc;
    color: #2d3748;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.style-tags .price-filter-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
    text-decoration: none;
}

.style-tags .price-filter-btn.active {
    background: #e6f2ff;
    color: #2d3748;
    border-color: #4a90e2;
    font-weight: 600;
}

/* Custom price toggle button - compact chip style */
.pule-toggle-custom-inputs.price-filter-btn {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

/* Hide toggle button on desktop by default */
.pule-toggle-custom-inputs.mobile-only-toggle {
    display: none;
}

.pule-toggle-custom-inputs .filter-icon {
    width: 20px;
    height: 20px;
    display: block;
    stroke: currentColor;
    stroke-width: 2;
}

.style-pills .pule-toggle-custom-inputs.active {
    background: #ffffff;
    border-color: #2d3748;
    border-width: 2px;
}

.style-pills .pule-toggle-custom-inputs.active .filter-icon {
    stroke: #2d3748;
}

.style-pills .pule-toggle-custom-inputs:hover .filter-icon {
    stroke: #212529;
}

/* Custom price inputs */
.pule-custom-price-inputs {
    margin-top: 20px;
    padding: 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

/* Add separator before custom inputs in sidebar */
.pule-price-filters.layout-sidebar .pule-custom-price-inputs {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    background: transparent;
}

.custom-inputs-title {
    font-size: 0.95rem;
    color: #4a5568;
    margin-bottom: 12px;
    font-weight: 500;
}

.custom-inputs-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.custom-inputs-wrapper .input-group {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
}

.custom-inputs-wrapper .input-group label {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 6px;
    font-weight: 500;
}

.custom-inputs-wrapper .input-group input {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-inputs-wrapper .input-group input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.custom-inputs-wrapper .input-group input::placeholder {
    color: #a0aec0;
}

.pule-custom-filter-btn {
    padding: 10px 24px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 44px;
    box-sizing: border-box;
}

.pule-custom-filter-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.pule-custom-filter-btn:active {
    transform: translateY(0);
}

/* ============================================
   Mobile Responsive - Global
   ============================================ */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .pule-with-sidebar {
        flex-direction: column !important;
        padding: 0 10px !important;
    }

    .pule-sidebar {
        width: 100% !important;
        order: 1;
        position: relative !important;
        top: auto !important;
    }

    .pule-main-content {
        order: 2;
    }

    /* Sidebar layout becomes horizontal on mobile */
    .pule-price-filters.layout-sidebar {
        padding: 16px;
    }

    .pule-price-filters.layout-sidebar .price-filter-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .pule-price-filters.layout-sidebar .price-filter-btn {
        width: auto;
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Hide custom inputs by default on mobile */
    .pule-custom-price-inputs {
        display: none;
    }

    /* Show when toggled */
    .pule-custom-price-inputs.show-mobile {
        display: block;
    }

    .pule-search-results-container {
        padding: 15px;
    }

    .pule-search-header h1 {
        font-size: 1.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr !important;
    }

    .pule-price-filters {
        margin: 12px 0;
        padding: 0;
    }

    .price-filters-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .price-filter-buttons {
        gap: 6px;
        /* Keep horizontal wrap on mobile for compact chips */
    }

    .style-pills .price-filter-btn {
        padding: 6px 12px;
        font-size: 12px;
        height: 30px;
        /* Compact chips stay inline on mobile */
    }

    .style-buttons .price-filter-btn,
    .style-tags .price-filter-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    /* Icon button must stay larger than text buttons - FORCE VISIBLE ON MOBILE */
    .pule-toggle-custom-inputs.price-filter-btn,
    .pule-toggle-custom-inputs.mobile-only-toggle,
    button.pule-toggle-custom-inputs {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 0 0 32px !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f8f9fa !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 20px !important;
        cursor: pointer !important;
    }

    .pule-toggle-custom-inputs.price-filter-btn:hover,
    .pule-toggle-custom-inputs.mobile-only-toggle:hover {
        background: #e9ecef !important;
        border-color: #adb5bd !important;
    }

    .pule-toggle-custom-inputs.price-filter-btn.active,
    .pule-toggle-custom-inputs.mobile-only-toggle.active {
        background: #ffffff !important;
        border-color: #2d3748 !important;
        border-width: 2px !important;
    }

    /* Icon stays the same size on mobile */
    .pule-toggle-custom-inputs .filter-icon {
        display: block !important;
        width: 20px !important;
        height: 20px !important;
        stroke: #495057 !important;
        stroke-width: 2 !important;
    }

    .custom-inputs-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .custom-inputs-wrapper .input-group {
        width: 100%;
        min-width: unset;
    }

    .pule-custom-filter-btn {
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .price-filter-buttons {
        gap: 6px;
        /* Keep horizontal wrap even on small mobile for compact chips */
    }

    .style-pills .price-filter-btn {
        padding: 6px 10px;
        font-size: 11px;
        height: 28px;
    }

    .style-buttons .price-filter-btn,
    .style-tags .price-filter-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 38px;
    }
}
