/*
 * Devicel Products Stylesheet
 * Catalog, Product Detail, Wishlist, Bulk Order, Quote
 * Version: 1.0.0
 */

/* ========================================
   Product Grid & Catalog
   ======================================== */
.catalog-header {
    margin-bottom: var(--space-8);
}

.catalog-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.catalog-subtitle {
    color: var(--text-muted);
    font-size: var(--font-size-lg);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 160px;
}

.filter-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
}

.filter-select {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: var(--bg-white);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filters-actions {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    margin-left: auto;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
}

/* Product Card */
.product-card {
    position: relative;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-light);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

/* Product Badges */
.product-badge {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    z-index: 2;
}

.product-badge-featured {
    background: var(--accent-gradient);
    color: var(--text-primary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
}

.product-badge-sale {
    background: var(--error);
    color: var(--text-white);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-bold);
}

/* Wishlist Button on Card */
.wishlist-btn {
    position: absolute;
    bottom: var(--space-3);
    right: var(--space-3);
    width: 36px;
    height: 36px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 2;
}

.wishlist-btn:hover {
    border-color: var(--error);
    background: var(--error-light);
}

.wishlist-btn.active {
    background: var(--error);
    border-color: var(--error);
    color: var(--text-white);
}

.wishlist-btn svg {
    width: 18px;
    height: 18px;
}

/* Product Card Content */
.product-card-content {
    padding: var(--space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-category {
    font-size: var(--font-size-xs);
    color: var(--primary);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-1);
}

.product-card-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-sku {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    margin-bottom: var(--space-3);
}

.product-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.product-card-price {
    font-size: var(--font-size-xl);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.product-card-price small {
    font-size: var(--font-size-xs);
    font-weight: var(--font-normal);
    color: var(--text-muted);
}

.product-card-moq {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-align: right;
}

/* ========================================
   Product Detail Page
   ======================================== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

/* Product Gallery */
.product-gallery {
    position: sticky;
    top: 100px;
    align-self: start;
}

.product-main-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-4);
    cursor: zoom-in;
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-base);
}

.product-main-image:hover img {
    transform: scale(1.1);
}

.product-thumbnails {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
}

.product-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-white);
}

.product-thumbnail:hover,
.product-thumbnail.active {
    border-color: var(--primary);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.product-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.product-breadcrumb {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.product-breadcrumb a {
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.product-breadcrumb a:hover {
    color: var(--primary);
}

.product-breadcrumb span {
    margin: 0 var(--space-2);
}

.product-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.product-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

.product-sku {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-2);
}

.product-short-desc {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* Price Box */
.product-price-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.product-price {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-bold);
    color: var(--primary);
    margin-bottom: var(--space-1);
}

.product-price-note {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* MOQ & Stock */
.product-stock-info {
    display: flex;
    gap: var(--space-6);
}

.stock-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.stock-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.stock-value.in-stock {
    color: var(--success);
}

.stock-value.low-stock {
    color: var(--warning);
}

.stock-value.out-of-stock {
    color: var(--error);
}

/* Bulk Pricing Table */
.bulk-pricing {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.bulk-pricing-header {
    background: var(--bg-light);
    padding: var(--space-4);
    font-weight: var(--font-semibold);
    border-bottom: 1px solid var(--border);
}

.bulk-pricing-table {
    width: 100%;
}

.bulk-pricing-table th,
.bulk-pricing-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.bulk-pricing-table th {
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    background: var(--bg-light);
}

.bulk-pricing-table tr:last-child td {
    border-bottom: none;
}

.bulk-pricing-table .discount {
    color: var(--success);
    font-weight: var(--font-semibold);
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.quantity-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.quantity-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 80px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart Actions */
.product-actions {
    display: flex;
    gap: var(--space-3);
}

.product-actions .btn {
    flex: 1;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
}

/* Product Tabs / Description */
.product-description,
.product-specs {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.product-description > h3,
.product-specs > h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

/* Description Content Styling */
.desc-content {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

.desc-content h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: var(--space-6) 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--border);
    position: relative;
}

.desc-content h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-gradient);
}

.desc-content h3:first-child {
    margin-top: 0;
}

.desc-content p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

.desc-content ul,
.desc-content ol {
    margin-bottom: var(--space-5);
    padding: 0;
}

.desc-content ul li {
    position: relative;
    padding-left: var(--space-6);
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
}

.desc-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
}

.desc-content ol {
    counter-reset: item;
}

.desc-content ol li {
    position: relative;
    padding-left: var(--space-8);
    margin-bottom: var(--space-3);
    counter-increment: item;
}

.desc-content ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--primary-gradient);
    color: var(--text-white);
    font-size: var(--font-size-sm);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.desc-content a {
    color: var(--primary);
    font-weight: var(--font-medium);
}

.desc-content a:hover {
    text-decoration: underline;
}

.desc-content strong {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
}

/* Specs Content */
.specs-content {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 2;
    white-space: pre-line;
}

/* ========================================
   Wishlist Page
   ======================================== */
.wishlist-page {
    max-width: 900px;
    margin: 0 auto;
}

.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.wishlist-header h1 {
    font-size: var(--font-size-3xl);
}

.wishlist-count {
    color: var(--text-muted);
    font-weight: var(--font-normal);
}

.wishlist-grid {
    display: grid;
    gap: var(--space-4);
}

.wishlist-item {
    display: flex;
    gap: var(--space-5);
    padding: var(--space-5);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-base);
}

.wishlist-item:hover {
    border-color: var(--primary);
}

.wishlist-item-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-light);
}

.wishlist-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wishlist-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wishlist-item-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.wishlist-item-price {
    font-size: var(--font-size-xl);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.wishlist-item-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: auto;
}

/* Empty Wishlist */
.wishlist-empty {
    text-align: center;
    padding: var(--space-16) var(--space-5);
}

.wishlist-empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-5);
}

.wishlist-empty h2 {
    margin-bottom: var(--space-2);
}

.wishlist-empty p {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

/* ========================================
   Bulk Order Form
   ======================================== */
.bulk-order-page {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-8);
    align-items: start;
}

.bulk-order-products {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.bulk-order-table {
    width: 100%;
}

.bulk-order-table th,
.bulk-order-table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.bulk-order-table th {
    background: var(--bg-light);
    font-weight: var(--font-semibold);
    font-size: var(--font-size-sm);
}

.bulk-order-table .product-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.bulk-order-table .product-cell img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.bulk-order-summary {
    position: sticky;
    top: 100px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.bulk-order-summary h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

/* ========================================
   Quote Request
   ======================================== */
.quote-page {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-8);
}

.quote-form {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.quote-sidebar {
    position: sticky;
    top: 100px;
}

.quote-benefits {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
}

.quote-benefits h4 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
}

.quote-benefits ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.quote-benefits li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.quote-benefits li::before {
    content: '✓';
    color: var(--success);
    font-weight: var(--font-bold);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-detail {
        gap: var(--space-6);
    }
    
    .bulk-order-page,
    .quote-page {
        grid-template-columns: 1fr;
    }
    
    .bulk-order-summary,
    .quote-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        position: static;
    }
    
    .product-title {
        font-size: var(--font-size-3xl);
    }
    
    .product-price {
        font-size: var(--font-size-4xl);
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filters-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .wishlist-item {
        flex-direction: column;
    }
    
    .wishlist-item-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-stock-info {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .quantity-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quantity-input-group {
        justify-content: center;
    }
}
