/**
 * ANMM Core - Frontend Styles
 * Advanced Nano-Materials Manufacturing
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --anmm-primary: #1a3a5c;       /* Navy from logo */
    --anmm-primary-light: #2c5282;
    --anmm-primary-dark: #142d4a;
    --anmm-accent: #2a8a8a;        /* Teal from logo */
    --anmm-accent-light: #3ba3a3;
    --anmm-gold: #b4965a;          /* Gold accent from logo */
    --anmm-text: #2d3748;
    --anmm-text-light: #718096;
    --anmm-border: #e2e8f0;
    --anmm-bg: #f7fafc;
    --anmm-white: #ffffff;
    --anmm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --anmm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --anmm-radius: 8px;
    --anmm-transition: all 0.2s ease-in-out;
}

/* ==========================================================================
   Products Grid
   ========================================================================== */
.anmm-products-grid {
    display: grid;
    gap: 24px;
    margin: 32px 0;
}

.anmm-columns-2 { grid-template-columns: repeat(2, 1fr); }
.anmm-columns-3 { grid-template-columns: repeat(3, 1fr); }
.anmm-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .anmm-columns-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .anmm-columns-3,
    .anmm-columns-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .anmm-columns-2,
    .anmm-columns-3,
    .anmm-columns-4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Product Card
   ========================================================================== */
.anmm-product-card {
    background: var(--anmm-white);
    border-radius: var(--anmm-radius);
    box-shadow: var(--anmm-shadow);
    overflow: hidden;
    transition: var(--anmm-transition);
    display: flex;
    flex-direction: column;
}

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

.anmm-product-card.anmm-featured {
    border: 2px solid var(--anmm-accent);
}

.anmm-product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--anmm-bg);
}

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

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

.anmm-featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--anmm-accent);
    color: var(--anmm-white);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.anmm-product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.anmm-product-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--anmm-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.anmm-product-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.anmm-product-title a {
    color: var(--anmm-primary);
    text-decoration: none;
    transition: var(--anmm-transition);
}

.anmm-product-title a:hover {
    color: var(--anmm-accent);
}

.anmm-product-sku {
    font-size: 13px;
    color: var(--anmm-text-light);
    margin-bottom: 12px;
}

.anmm-product-excerpt {
    font-size: 14px;
    color: var(--anmm-text);
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
}

.anmm-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--anmm-border);
    margin-top: auto;
}

/* ==========================================================================
   Availability Badges
   ========================================================================== */
.anmm-availability {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
}

.anmm-availability-in-stock {
    background: #c6f6d5;
    color: #22543d;
}

.anmm-availability-made-to-order {
    background: #fef3c7;
    color: #92400e;
}

.anmm-availability-development {
    background: #e9d8fd;
    color: #553c9a;
}

.anmm-availability-contact {
    background: #e2e8f0;
    color: #4a5568;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.anmm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--anmm-radius);
    cursor: pointer;
    transition: var(--anmm-transition);
    text-decoration: none;
    border: none;
    line-height: 1.4;
}

.anmm-btn-primary {
    background: var(--anmm-primary);
    color: var(--anmm-white);
}

.anmm-btn-primary:hover {
    background: var(--anmm-primary-light);
    color: var(--anmm-white);
}

.anmm-btn-outline {
    background: transparent;
    color: var(--anmm-primary);
    border: 2px solid var(--anmm-primary);
}

.anmm-btn-outline:hover {
    background: var(--anmm-primary);
    color: var(--anmm-white);
}

.anmm-btn-accent {
    background: var(--anmm-accent);
    color: var(--anmm-white);
}

.anmm-btn-accent:hover {
    background: var(--anmm-accent-light);
}

.anmm-btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.anmm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Categories Grid
   ========================================================================== */
.anmm-categories-grid {
    display: grid;
    gap: 24px;
    margin: 32px 0;
}

.anmm-category-card {
    background: linear-gradient(135deg, var(--anmm-primary) 0%, var(--anmm-primary-light) 100%);
    color: var(--anmm-white);
    padding: 32px;
    border-radius: var(--anmm-radius);
    text-decoration: none;
    transition: var(--anmm-transition);
    display: block;
}

.anmm-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--anmm-shadow-lg);
}

.anmm-category-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--anmm-white);
}

.anmm-category-count {
    font-size: 14px;
    opacity: 0.9;
}

.anmm-category-card p {
    font-size: 14px;
    margin: 12px 0 0 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* ==========================================================================
   Specs Table
   ========================================================================== */
.anmm-specs-wrapper {
    margin: 24px 0;
    overflow-x: auto;
}

.anmm-specs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--anmm-white);
    border-radius: var(--anmm-radius);
    overflow: hidden;
    box-shadow: var(--anmm-shadow);
}

.anmm-specs-table thead {
    background: var(--anmm-primary);
    color: var(--anmm-white);
}

.anmm-specs-table th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.anmm-specs-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--anmm-border);
}

.anmm-specs-table tbody tr:last-child td {
    border-bottom: none;
}

.anmm-specs-table tbody tr:hover {
    background: var(--anmm-bg);
}

.anmm-spec-name {
    font-weight: 600;
    color: var(--anmm-text);
}

.anmm-spec-value {
    color: var(--anmm-text);
}

.anmm-spec-unit {
    color: var(--anmm-text-light);
    font-size: 13px;
    margin-left: 4px;
}

/* ==========================================================================
   RFQ Form
   ========================================================================== */
.anmm-rfq-form-wrapper {
    background: var(--anmm-white);
    padding: 40px;
    border-radius: var(--anmm-radius);
    box-shadow: var(--anmm-shadow);
    max-width: 800px;
    margin: 32px auto;
}

.anmm-rfq-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--anmm-primary);
    margin: 0 0 24px 0;
    text-align: center;
}

.anmm-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.anmm-form-row-2 > .anmm-form-group {
    flex: 1;
}

@media (max-width: 600px) {
    .anmm-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .anmm-rfq-form-wrapper {
        padding: 24px;
    }
}

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

.anmm-form-group label {
    display: block;
    font-weight: 600;
    color: var(--anmm-text);
    margin-bottom: 8px;
    font-size: 14px;
}

.anmm-form-group label .required {
    color: #e53e3e;
}

.anmm-form-group input[type="text"],
.anmm-form-group input[type="email"],
.anmm-form-group input[type="tel"],
.anmm-form-group select,
.anmm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--anmm-border);
    border-radius: var(--anmm-radius);
    transition: var(--anmm-transition);
    background: var(--anmm-white);
    color: var(--anmm-text);
}

.anmm-form-group input:focus,
.anmm-form-group select:focus,
.anmm-form-group textarea:focus {
    outline: none;
    border-color: var(--anmm-primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.anmm-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.anmm-form-group select {
    cursor: pointer;
}

.anmm-form-message {
    padding: 16px 20px;
    border-radius: var(--anmm-radius);
    margin-top: 20px;
    font-weight: 500;
}

.anmm-form-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.anmm-form-message.error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

/* ==========================================================================
   Downloads Section
   ========================================================================== */
.anmm-downloads {
    margin: 24px 0;
    padding: 24px;
    background: var(--anmm-bg);
    border-radius: var(--anmm-radius);
}

.anmm-downloads h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--anmm-primary);
    margin: 0 0 16px 0;
}

.anmm-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--anmm-white);
    border: 1px solid var(--anmm-border);
    border-radius: var(--anmm-radius);
    color: var(--anmm-text);
    text-decoration: none;
    margin-right: 12px;
    margin-bottom: 12px;
    transition: var(--anmm-transition);
}

.anmm-download-link:hover {
    background: var(--anmm-primary);
    color: var(--anmm-white);
    border-color: var(--anmm-primary);
}

.anmm-download-link svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   No Products Message
   ========================================================================== */
.anmm-no-products {
    text-align: center;
    padding: 48px 24px;
    background: var(--anmm-bg);
    border-radius: var(--anmm-radius);
    color: var(--anmm-text-light);
    font-size: 16px;
}

/* ==========================================================================
   Single Product Template
   ========================================================================== */
.anmm-single-product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.anmm-product-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .anmm-product-header {
        grid-template-columns: 1fr;
    }
}

.anmm-product-gallery img {
    width: 100%;
    border-radius: var(--anmm-radius);
    box-shadow: var(--anmm-shadow);
}

.anmm-product-info h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--anmm-primary);
    margin: 0 0 16px 0;
}

.anmm-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.anmm-product-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--anmm-text);
    margin-bottom: 24px;
}

.anmm-product-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Featured Products Section
   ========================================================================== */
.anmm-featured-products {
    padding: 48px 0;
}

.anmm-featured-products .anmm-section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--anmm-primary);
    text-align: center;
    margin-bottom: 32px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.anmm-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: anmm-spin 1s ease-in-out infinite;
}

@keyframes anmm-spin {
    to { transform: rotate(360deg); }
}
