/* Ray's Dies & Tubing - Modern B2B Styling */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --hover-color: #2980b9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    overflow-x: hidden;
}

/* Prevent images with explicit width/height attributes from overflowing narrow viewports */
img {
    max-width: 100%;
    height: auto;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo a {
    color: inherit;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

nav a:hover,
nav a.active {
    color: var(--accent-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    white-space: nowrap;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 0.75rem 2rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: var(--hover-color);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--accent-color);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.service-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.service-card-content {
    padding: 1.5rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.service-card a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
}

.service-card a:hover {
    color: var(--hover-color);
}

/* Content Sections */
.content-section {
    background: var(--white);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.content-grid img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.image-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s;
}

.image-gallery img:hover {
    transform: scale(1.05);
}

/* Contact Info */
.contact-info {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-item {
    padding: 1rem;
}

.contact-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    align-items: start;
}

.footer-section {
    min-width: 0;
    overflow-wrap: break-word;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    columns: 2;
    column-gap: 1.5rem;
}

.footer-section ul li {
    margin-bottom: 0.4rem;
    break-inside: avoid;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav {
        display: none;
        width: 100%;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding-top: 1rem;
    }

    nav li {
        border-bottom: 1px solid var(--border-color);
    }

    nav a {
        display: block;
        padding: 1rem 0;
    }

    .hero h1 {
        font-size: 1.4rem;
        white-space: normal;
    }

    .hero p {
        font-size: 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.two-column > * {
    min-width: 0;
}

@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* Carousel */
.carousel {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.carousel-track-container {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: var(--white);
    padding: 2rem 1rem 1rem;
    text-align: center;
    font-weight: 500;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev {
    left: 15px;
}

.carousel-btn-next {
    right: 15px;
}

.carousel-dots {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 2px solid var(--white);
    cursor: pointer;
    transition: background-color 0.3s;
}

/* Product Data Table */
.datatable-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.datatable-controls {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.table-search {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.table-search:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.table-filter {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
    min-width: 150px;
}

.table-filter:focus {
    outline: none;
    border-color: var(--accent-color);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.download-btn:hover {
    background: var(--hover-color);
}

.table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.product-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-table th {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.product-table th:hover {
    background: var(--secondary-color);
}

.product-table th.sorted {
    background: var(--hover-color);
}

.sort-icon {
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.product-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Consolas', 'Monaco', monospace;
}

.product-table tbody tr:hover {
    background: rgba(52, 152, 219, 0.08);
}

.product-table tbody tr:nth-child(even) {
    background: var(--light-bg);
}

.product-table tbody tr:nth-child(even):hover {
    background: rgba(52, 152, 219, 0.12);
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.type-304, .type-304L {
    background: #e3f2fd;
    color: #1565c0;
}

.type-316, .type-316L {
    background: #e8f5e9;
    color: #2e7d32;
}

.type-625 {
    background: #fff3e0;
    color: #e65100;
}

.type-177 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.table-info {
    padding: 1rem;
    background: var(--light-bg);
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    background: var(--light-bg);
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}

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

.pagination-indicator {
    font-size: 0.9rem;
    color: var(--secondary-color);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .datatable-controls {
        flex-direction: column;
    }
    
    .table-search, .table-filter, .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .product-table th, .product-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .table-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .table-pagination {
        justify-content: center;
    }
}

.carousel-dot.active,
.carousel-dot:hover {
    background: var(--white);
}

@media (max-width: 768px) {
    .carousel-slide img {
        height: 300px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .carousel-btn-prev {
        left: 10px;
    }

    .carousel-btn-next {
        right: 10px;
    }
}

/* Capabilities List */
.capabilities-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.capabilities-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.capabilities-list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Below tablet width, swap the grid for a swipeable card carousel */
@media (max-width: 1024px) {
    .capabilities-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        margin-left: -2rem;
        margin-right: -2rem;
        padding: 0 2rem 0.5rem;
    }

    .capabilities-list li {
        flex: 0 0 min(85%, 320px);
        scroll-snap-align: start;
    }

    .capabilities-list li:hover {
        transform: none;
    }
}

.capability-icon {
    color: var(--accent-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.capabilities-list strong,
.capabilities-list h3 {
    display: block;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.capabilities-list p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* Smaller Hero for Interior Pages */
.hero-small {
    padding: 2.5rem 2rem;
}

.hero-small h1 {
    font-size: 2rem;
}

/* Request Form Styles */
.form-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 2.5rem;
    margin-bottom: 3rem;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
}

.form-header p {
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

.request-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

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

.form-group input,
.form-group textarea {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

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

/* File Upload Styling */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
}

.file-upload-wrapper:hover,
.file-upload-wrapper.drag-over {
    border-color: var(--accent-color);
    background-color: rgba(52, 152, 219, 0.05);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.file-icon {
    font-size: 2.5rem;
}

.file-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.file-types {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.file-limit {
    color: #999;
    font-size: 0.85rem;
}

/* File List */
.file-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--light-bg);
    border-radius: 4px;
    font-size: 0.95rem;
}

.file-name {
    flex: 1;
    color: var(--primary-color);
    font-weight: 500;
    word-break: break-all;
}

.file-size {
    color: var(--secondary-color);
    font-size: 0.85rem;
    white-space: nowrap;
}

.file-remove {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.file-remove:hover {
    background: rgba(231, 76, 60, 0.1);
}

.file-error {
    color: #e74c3c;
    font-size: 0.9rem;
    padding: 0.5rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
}

/* Inline field validation */
.form-group {
    position: relative;
}

.field-error-msg {
    display: block;
    color: #e74c3c;
    font-size: 0.82rem;
    margin-top: 0.35rem;
    min-height: 1.1em;
}

.request-form input.field-invalid,
.request-form textarea.field-invalid,
.request-form select.field-invalid {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.04);
    outline: none;
}

.request-form input.field-valid,
.request-form textarea.field-valid,
.request-form select.field-valid {
    border-color: #27ae60;
}

.request-form input.field-invalid:focus,
.request-form textarea.field-invalid:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.request-form input.field-valid:focus,
.request-form textarea.field-valid:focus {
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.submit-btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 1rem 3rem;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none;
}

.submit-btn:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.mailto-btn {
    background-color: var(--secondary-color);
    margin-right: 1rem;
}

.mailto-btn:hover {
    background-color: var(--primary-color);
}

/* Success & Error Messages */
.form-success,
.form-error {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #27ae60;
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: #e74c3c;
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    margin: 0 auto 1.5rem;
}

.form-success h3,
.form-error h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.form-success p,
.form-error p {
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.success-email {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.error-contact {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.error-contact a {
    color: var(--accent-color);
}

/* Responsive Form */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
    }

    .request-form .form-grid {
        grid-template-columns: 1fr;
    }

    .file-upload-wrapper {
        padding: 1.5rem;
    }

    .submit-btn {
        width: 100%;
        padding: 1rem;
    }

    .hero-small h1 {
        font-size: 1.5rem;
    }
}
