/*!
 * Professional Stone Manager - Frontend Styles
 * Version: 1.0.0
 */

/* ==========================================================================
   Product Grid Layout
   ========================================================================== */
   
.psm-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.psm-product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.psm-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.psm-product-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.psm-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.psm-product-card-content {
    padding: 1.5rem;
}

.psm-product-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.psm-product-card-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.psm-product-card-title a:hover {
    color: #007cba;
}

.psm-product-code {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.psm-product-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Product Meta Information
   ========================================================================== */

.psm-product-meta {
    display: block;
   
}

.psm-meta-item {
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #666;
}

/* ==========================================================================
   Product Taxonomies
   ========================================================================== */

.psm-product-taxonomies {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.psm-taxonomy-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.psm-taxonomy-term {
    background: #007cba;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.psm-taxonomy-term:hover {
    background: #005a87;
    color: white;
}

.psm-taxonomy-term.color-term {
    background: #e74c3c;
}

.psm-taxonomy-term.finish-term {
    background: #9b59b6;
}

.psm-taxonomy-term.usage-term {
    background: #27ae60;
}

/* ==========================================================================
   Product Filter
   ========================================================================== */

.psm-filter-container {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.psm-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.psm-filter-group {
    display: flex;
    flex-direction: column;
}

.psm-filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.psm-filter-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: white;
    font-size: 0.95rem;
}

.psm-filter-actions {
    display: flex;
    gap: 0.5rem;
}

.psm-filter-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.psm-filter-button:hover {
    background: #005a87;
}

.psm-filter-reset {
    background: #6c757d;
}

.psm-filter-reset:hover {
    background: #545b62;
}

/* ==========================================================================
   Single Product Page
   ========================================================================== */

.psm-single-product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.psm-product-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.psm-product-gallery {
    position: relative;
}

.psm-main-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.psm-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.psm-thumbnail {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.psm-thumbnail.active,
.psm-thumbnail:hover {
    opacity: 1;
}

.psm-product-info h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.psm-product-price-large {
    font-size: 2rem;
    font-weight: 600;
    color: #007cba;
    margin-bottom: 1.5rem;
}

.psm-product-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Product Specifications
   ========================================================================== */

.psm-specifications {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.psm-specifications h3 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    color: #333;
}

.psm-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.psm-spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.psm-spec-item:last-child {
    border-bottom: none;
}

.psm-spec-label {
    font-weight: 500;
    color: #666;
}

.psm-spec-value {
    font-weight: 600;
    color: #333;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .psm-products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .psm-product-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .psm-filter-form {
        grid-template-columns: 1fr;
    }
    
    .psm-filter-actions {
        grid-column: 1;
    }
    
    .psm-single-product {
        padding: 1rem;
    }
    
    .psm-product-info h1 {
        font-size: 2rem;
    }
    
    .psm-spec-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.psm-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.psm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: psm-spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes psm-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.psm-hidden {
    display: none !important;
}

.psm-text-center {
    text-align: center;
}

.psm-mb-0 { margin-bottom: 0 !important; }
.psm-mb-1 { margin-bottom: 0.5rem !important; }
.psm-mb-2 { margin-bottom: 1rem !important; }
.psm-mb-3 { margin-bottom: 1.5rem !important; }

/* ==========================================================================
   Taxonomy Terms Shortcodes - Badge Style
   ========================================================================== */

/* Base Taxonomy Terms Styles */
.psm-taxonomy-terms {
    margin: 1em 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Badge Layout */
.psm-terms-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 1em 0;
    align-items: flex-start;
}

.psm-term-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.6em 0.8em;
    background: #ffffff;
    color: #444;
    border-radius: 16px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin: 0;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.psm-term-badge:not(:last-child)::after {
    content: '،';
    margin: 0 8px;
    color: #666;
    font-weight: normal;
}

.psm-term-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.psm-term-badge:hover {
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    transform: translateY(-2px);
    border-color: #d3d3d3;
    box-shadow: 0 4px 12px rgba(211, 211, 211, 0.3);
}

.psm-term-badge:hover::before {
    left: 100%;
}

.psm-term-badge:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.15);
}

.psm-term-badge .psm-term-icon-img {
    width: 18px;
    height: 18px;
    margin-left: 12px;
    border-radius: 3px;
    object-fit: cover;
}

.psm-term-badge .psm-term-icon-emoji {
    margin-left: 12px;
    font-size: 1em;
}

/* RTL Support for Badges */
.rtl .psm-term-badge .psm-term-icon-img,
.rtl .psm-term-badge .psm-term-icon-emoji {
    margin-left: 0;
    margin-right: 12px;
}

.rtl .psm-term-badge {
    margin: 0 0 0.4em 0.4em;
}

/* Responsive Badge Design */
@media (max-width: 768px) {
    .psm-terms-badges {
        gap: 0.5em;
        justify-content: flex-start;
    }
    
    .psm-term-badge {
        padding: 0.4em 0.8em;
        font-size: 0.85em;
        border-radius: 12px;
        margin: 0 0.3em 0.3em 0;
    }
}

@media (max-width: 480px) {
    .psm-terms-badges {
        justify-content: center;
    }
    
    .psm-term-badge {
        padding: 0.4em 0.8em;
        font-size: 0.8em;
    }
}