:root {
    --primary-color: rgb(21, 21, 27);
    --border-color: rgb(85, 85, 85);
    --accent-color: rgb(140, 140, 255);
    --text-light: rgb(240, 240, 240);
    --text-gray: rgb(180, 180, 180);
    --text-dark-gray: rgb(115, 115, 115);
    --card-bg: rgb(30, 30, 36);
    --card-border: rgb(60, 60, 70);
    
    /* Fluid sizing variables */
    --base-font-size: 16px;
    --container-width: 90%;
    --max-container-width: 1200px;
}

html {
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    font-size: var(--base-font-size);
}

body {
    background-color: var(--primary-color);
    color: white;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family:'Courier New', Courier, monospace;
    overflow-x: hidden;
}

main {
    flex: 1;
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 2rem;
    position: relative;
    z-index: 1; /* Lower z-index for main content */
    justify-content: center;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 100vw;
}

.nav-logo {
    margin: 0.5rem 0;
}

.nav-logo img {
    max-height: 50px;
    width: auto;
}

.nav-buttons {
    display: flex;
    gap: 3rem;
    font-size: 1.1rem;
    align-items: center;
    font-family:'Courier New', Courier, monospace;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-buttons a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0;
}

.nav-buttons a:hover {
    text-decoration: underline;
}

.fontawesome {
    font-size: 1.6rem;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000; /* Higher z-index for header */
    padding: 0.5rem;
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

footer {
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 1000; /* Higher z-index for footer */
}

.footer-text {
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-gray);
    margin: 0;
    padding: 0.8rem;
    font-family:'Courier New', Courier, monospace;
}

/* Prints Hero Section */
.prints-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    width: var(--container-width);
    max-width: var(--max-container-width);
    margin-left: auto;
    margin-right: auto;
}

.prints-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.prints-description {
    font-size: 1rem;
    color: var(--text-gray);
    max-width: 90%;
    margin: 0 auto;
}

/* Enhanced Prints Container */
.prints-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    width: var(--container-width);
    max-width: var(--max-container-width);
    margin: 0 auto 5rem;
    position: relative;
    min-height: 300px;
    padding: 0.5rem;
}

/* Enhanced Print Item */
.print-item {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 12px; /* Increased from 8px */
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Deeper shadow by default */
    border: 1px solid rgba(60, 60, 70, 0.5);
    position: relative;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease,
                border-color 0.3s ease;
}

.print-item:hover {
    transform: translateY(-8px) scale(1.02); /* Slight scale up with lift */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
}

.print-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-color), rgba(140, 140, 255, 0.5)); /* Gradient accent line */
    z-index: 1;
}

/* Enhanced Print Image */
.print-image {
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    display: block;
    aspect-ratio: 3/2;
    overflow: hidden;
}

.print-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent 20%);
    z-index: 1;
    pointer-events: none;
}

.print-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
    filter: saturate(1.1); /* Slightly enhance colors */
}

.print-item:hover .print-image img {
    transform: scale(1.08);
}

/* Enhanced Badge Styling */
.print-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 50px; /* Pill-shaped badges */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
    letter-spacing: 0.5px;
}

.almost-sold-out {
    background: linear-gradient(135deg, #ff9a00, #ff6a00);
    color: white;
}

.sold-out-badge {
    background: linear-gradient(135deg, #ff5757, #ff0000);
    color: white;
}

.new-release {
    background: linear-gradient(135deg, #00c2ff, #0077ff);
    color: white;
}

.white {
    color: var(--text-light);
}

/* Enhanced Print Info Section */
.print-info {
    width: 100%;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(to bottom, 
                rgba(30, 30, 36, 1),
                rgba(35, 35, 42, 1));
}

.print-title {
    margin-top: 0;
    margin-bottom: 0.7rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white;
    position: relative;
    padding-bottom: 0.5rem;
}

.print-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2.5rem;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px;
}

.print-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

/* Enhanced Progress Display */
.print-details {
    margin-bottom: 1.5rem;
    padding: 0.8rem;
    background-color: rgba(20, 20, 25, 0.4);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.print-availability {
    margin-bottom: 0.7rem;
    color: var(--text-gray);
    font-size: 0.95rem;
    display: flex;
    justify-content: flex-start; /* Changed from space-between to flex-start */
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.print-availability span {
    margin-right: 0.6rem; /* Add a small right margin to each span */
}

.available-count {
    font-weight: bold;
    color: var(--accent-color);
    margin-right: 0.6rem; /* Space after the number */
}

.total-count {
    margin-left: 0.6rem; /* Space before the number */
}

.print-progress {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, rgba(140, 140, 255, 0.8), rgba(140, 140, 255, 1));
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 0 10px rgba(140, 140, 255, 0.5);
    width: 100%;
}

.almost-gone {
    background: linear-gradient(to right, rgba(255, 154, 0, 0.8), rgba(255, 106, 0, 1));
    box-shadow: 0 0 10px rgba(255, 154, 0, 0.5);
}

.sold-out-bar {
    background: linear-gradient(to right, rgba(255, 87, 87, 0.8), rgba(255, 0, 0, 1));
    box-shadow: 0 0 10px rgba(255, 87, 87, 0.5);
}

.print-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.7rem;
    font-size: 1.1rem;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.print-size {
    font-size: 1rem;
    color: var(--text-gray);
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
}

.print-price {
    font-weight: bold;
    color: white;
    font-size: 1.3rem;
    background-color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(140, 140, 255, 0.4);
}

/* Enhanced Print Actions */
.print-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-top: auto;
}

/* Size selector styling */
.size-selector {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.size-dropdown {
    padding: 0.9rem;
    background-color: rgba(40, 40, 50, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-light);
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 0.95rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 2.8rem;
    box-sizing: border-box;
}

.size-dropdown:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 140, 255, 0.25);
}

.size-dropdown:hover {
    background-color: rgba(50, 50, 60, 0.9);
}

.size-dropdown option {
    background-color: var(--card-bg);
    color: white;
}

/* Enhanced purchase button */
.purchase-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-color), rgba(160, 160, 255, 1));
    color: white;
    border: none;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(140, 140, 255, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2.8rem;
    box-sizing: border-box;
    opacity: 1;
    margin-left: 0;
}

.purchase-btn:hover {
    background: linear-gradient(135deg, rgba(160, 160, 255, 1), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(140, 140, 255, 0.5);
}

.purchase-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(140, 140, 255, 0.3);
}

.purchase-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.purchase-btn:hover::before {
    left: 100%;
}

.purchase-btn:disabled {
    background: linear-gradient(135deg, #4a4a57, #3a3a45);
    color: var(--text-dark-gray);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.purchase-btn:disabled::before {
    display: none;
}

/* Sold out state styling */
.sold-out .print-image img {
    filter: grayscale(0.9) brightness(0.6);
}

.sold-out .print-badge {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Prints Info Section */
.prints-info-section {
    margin-top: 4rem;
    margin-bottom: 3rem; /* Added bottom margin for spacing */
    padding: 3rem 2rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    width: 90%; /* Adjusted from 70% to be more responsive */
    margin-left: auto; /* Center the section */
    margin-right: auto;
    max-width: var(--max-container-width);
}

.prints-info-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.info-columns {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-column {
    flex: 1;
}

.info-column h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-column p {
    line-height: 1.6;
    color: var(--text-gray);
}

/* Modal Styles with improved opacity */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1500;
    overflow-y: auto;
    padding: 1rem 0.5rem;
    /* Add flexbox for better centering */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    width: 95%;
    max-width: 650px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    position: relative;
    max-height: none; /* Remove max height to prevent scrolling */
    overflow-y: visible; /* Remove scrolling */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    max-height: max-content;
    height: auto;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--text-light);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
}

/* Adjust modal layout to better accommodate larger images */
.modal-print-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

#modal-image, #payment-modal-image {
    width: 180px; /* Increased from 120px */
    height: 120px; /* Increased from 80px - maintains 3:2 ratio */
    object-fit: cover;
    border-radius: 6px; /* Slightly increased radius for the larger image */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Add a subtle shadow */
}

.modal-print-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-print-details h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.modal-size-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

#modal-size {
    font-size: 1rem;
    color: var(--text-light);
}

#modal-price {
    font-size: 1.3rem;
    color: var(--accent-color);
    font-weight: bold;
}

/* Form section titles with defined width */
.form-section-title {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
    width: 100%; /* Explicitly set width */
    box-sizing: border-box; /* Include padding and border in width calculation */
}

/* First section title needs less top margin */
form .form-section-title:first-of-type {
    margin-top: 0.5rem;
}

/* Form with box-sizing to ensure width alignment */
form {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* Row layout for form fields with proper width */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0; 
    width: 100%; /* Ensure the row takes full width */
    box-sizing: border-box;
}

/* Form groups with matching width */
.form-group {
    margin-bottom: 1rem;
    position: relative;
    width: 100%; /* Match the width of section title */
    box-sizing: border-box; /* Include padding and border in width calculation */
}

/* Special sizing for address details */
.form-row.address-details .zip-group {
    flex: 1;
}

.form-row.address-details .country-group {
    flex: 1;
}

/* Input styling with better contrast and precise width */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; /* Take full width of form-group */
    padding: 0.5rem;
    background-color: rgba(40, 40, 50, 0.9); /* Darker background */
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text-light); /* Lighter text for contrast */
    font-family: 'Courier New', Courier, monospace;
    box-sizing: border-box; /* Critical for precise width matching */
    font-size: 0.9rem;
}

/* Special styling for the select dropdowns */
.form-group select {
    appearance: none; /* Remove default styling */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem; /* Space for the arrow */
}

/* Fix specifically for the dropdown text color issue */
.payment-method-group select,
#shipping-country {
    color: white; /* Force white text for better visibility */
    background-color: rgba(40, 40, 50, 0.9); /* Darker background for better contrast */
}

/* Style the dropdown options */
.form-group select option {
    background-color: var(--card-bg);
    color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(140, 140, 255, 0.25); /* Subtle glow around focused inputs */
}

/* Improve the submit button */
.submit-purchase {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-family: 'Courier New', Courier, monospace;
    margin-top: 1rem;
}

.submit-purchase:hover {
    background-color: rgb(160, 160, 255); /* Lighter accent on hover */
    transform: translateY(-2px); /* Subtle lift effect */
}

.submit-purchase:active {
    transform: translateY(0); /* Press effect */
}

/* Photo lightbox styles for the image viewer */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Make the payment modal look consistent with purchase modal */
#payment-modal {
    z-index: 1001; /* One higher than purchase modal */
}

#payment-modal .modal-content {
    max-width: 650px;
}

/* Card information styling */
#card-number, #card-expiry, #card-cvv {
    font-family: monospace; /* Better spacing for card details */
}

/* "Same as shipping" styling */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    cursor: pointer;
}

#same-as-shipping {
    margin-right: 0.75rem;
    cursor: pointer;
    /* Custom checkbox styling */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    background-color: rgba(40, 40, 50, 0.9);
    position: relative;
    outline: none;
    
    /* Fix vertical alignment */
    margin-top: -1px; /* Slight adjustment to align with text */
    vertical-align: middle;
    display: flex;
    justify-content: center;
    align-items: center;
}

#same-as-shipping:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

#same-as-shipping:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--primary-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#same-as-shipping:focus {
    box-shadow: 0 0 0 2px var(--accent-color);
}

.checkbox-label {
    color: var(--text-light);
    font-size: 1rem;
    user-select: none;
    line-height: 1; /* Ensure text has minimal line height */
    display: flex; /* Use flex for better alignment */
    align-items: center;
}

/* Security indicator for card fields */
.card-security-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-gray);
}

/* Security lock icon */
.security-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 14px;
}

/* Styling for card input focus */
#card-number:focus,
#card-expiry:focus,
#card-cvv:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(140, 140, 255, 0.25);
}

/* Payment success message */
.payment-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 1002;
    max-width: 80%;
}

.payment-success h2 {
    color: var(--accent-color);
    margin-top: 0;
}

.payment-success button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

#payment-modal-image {
    width: 120px;
    height: 80px; /* Updated for 3:2 aspect ratio */
    object-fit: cover;
    border-radius: 4px;
    max-width: 100%;
    max-height: 100%;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
    display: block;
}

/* Stripe element styling */
.stripe-element {
    padding: 0.8rem;
    border-radius: 4px;
    background-color: rgba(40, 40, 50, 0.9);
    border: 1px solid var(--card-border);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 20px;
}

.stripe-element.StripeElement--focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(140, 140, 255, 0.25);
}

.stripe-element.StripeElement--invalid {
    border-color: #fa755a;
}

.stripe-error {
    color: #fa755a;
    margin-top: 8px;
    font-size: 0.9rem;
    min-height: 20px;
}

/* Processing state for button */
.submit-purchase:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none !important;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative; /* Enable z-index */
    z-index: 1100; /* Higher than header */
}

.disclaimer {
    color: var(--text-dark-gray);
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.2;
}

.form-group.disclaimer {
    margin-bottom: 0.5rem;
}

/* Loading prints availability counter */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.loader {
    border: 5px solid var(--card-border);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Initially hide print content until data is loaded */
.print-content-hidden {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.print-content-visible {
    opacity: 1;
}

/* Fix footer overlap issue */
body.modal-open {
    overflow: hidden; /* Prevent background scrolling */
}

body.modal-open footer {
    z-index: 500; /* Lower than modal */
}

.print-details {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.print-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* Prevent print item content overflow */
.print-info {
    box-sizing: border-box;
    overflow: hidden;
}

.print-description {
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.print-title {
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

/* Ensure progress bar doesn't cause overflow */
.print-progress {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}







/* More compact padding overall */
#purchase-modal .modal-content,
#payment-modal .modal-content {
  padding: 1.25rem 1.5rem;
  width: 95%;
  max-width: 650px;
}

/* Reduce main title size and margin */
#purchase-modal h2,
#payment-modal h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* Make the image and info row more compact */
.modal-print-info {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(60, 60, 70, 0.5);
}

/* Make image smaller */
#modal-image, 
#payment-modal-image {
  width: 120px;
  height: 80px;
  margin: 0 0 0.25rem 0;
  border-radius: 6px;
}

/* Make print details more compact */
.modal-print-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.modal-print-details h3 {
  font-size: 1.2rem;
  margin: 0 0 0.25rem 0;
  font-weight: 600;
}

#modal-availability,
#payment-modal-availability {
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
  white-space: nowrap;
}

#modal-availability span,
#payment-modal-availability span {
  margin-right: 0.1rem;
}

/* Optimize the size/price display */
.modal-size-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 0.25rem 0 0 0;
}

#modal-size, 
#payment-modal-size {
  font-size: 0.85rem;
}

#modal-price, 
#payment-modal-price {
  font-size: 1rem;
}

/* Shrink and compact form heading */
.form-section-title {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  padding-bottom: 0.3rem;
}

/* Reduce space between form groups */
.form-group {
  margin-bottom: 0.5rem;
}

/* Reduce size of all form inputs */
.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  height: 2.4rem;
}

/* Make submit button more compact */
.submit-purchase {
  margin-top: 0.6rem;
  padding: 0.6rem;
  font-size: 0.9rem;
  height: 2.7rem;
}

/* Make disclaimer smaller */
.disclaimer {
  font-size: 0.8rem;
  line-height: 1.2;
  margin-bottom: 0;
}

.form-group.disclaimer {
  margin-bottom: 0.3rem;
}







/* RESPONSIVE MEDIA QUERIES FOR GRID LAYOUT */

/* MAX WIDTH QUERIES */
@media screen and (max-width: 1400px) {
    .nav-logo img {
        width: 80%;
    }
}

@media screen and (max-width: 1200px) {
    .prints-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

@media screen and (max-width: 840px) {
    /* Menu toggle button becomes visible */
    .menu-toggle {
        display: block;
    }

    /* Navigation buttons become a dropdown */
    .nav-buttons {
        position: fixed;
        top: var(--header-height, 0);
        left: 0;
        right: 0;
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        gap: 1rem;
        border-bottom: 1px solid var(--border-border);
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        pointer-events: none;
        z-index: 999; /* High but below header and toggle */
    }
    
    .nav-buttons.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .nav-buttons a {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }
    
    nav {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .prints-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0.3rem;
    }
    
    .print-info {
        padding: 1.5rem;
    }
}

@media screen and (max-width: 600px) {
    .fontawesome {
        font-size: 1.2rem;
    }
    
    .prints-hero h1 {
        font-size: 1.8rem;
    }
    
    .prints-description {
        font-size: 0.95rem;
    }
    
    .print-title {
        font-size: 1.4rem;
    }
    
    .modal-content {
        padding: 1.25rem;
    }
    
    #modal-image, #payment-modal-image {
        width: 150px; /* Slightly smaller on mobile devices */
        height: 100px; /* Keep 3:2 aspect ratio */
    }
    
    .prints-info-section {
        padding: 1.5rem 1rem;
    }
    
    /* Further adjustments to prints container */
    .prints-container {
        gap: 1.2rem;
    }
    
    .print-info {
        padding: 1.2rem;
    }
    
    .print-price {
        font-size: 1.1rem;
    }

    /* Stack the modal image and details side by side to save vertical space */
    .modal-print-info {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Make modal title even smaller */
    .modal-content h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    /* Reduce space between form groups further */
    .form-group {
        margin-bottom: 0.4rem;
    }
    
    /* Ultra compact fields */
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
    
    /* Form section titles minimal */
    .form-section-title {
        margin-top: 0.5rem;
        margin-bottom: 0.3rem;
        font-size: 0.95rem;
    }
    
    /* Arrange form rows horizontally where possible */
    .form-row {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    /* Close button adjustment */
    .close-modal {
        top: 0.5rem;
        right: 0.75rem;
        font-size: 1.5rem;
    }
    
    /* Hide disclaimer on very small screens */
    .form-group.disclaimer {
        display: none;
    }

    .modal-content h2 {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .modal-print-details h3 {
        font-size: 1.15rem;
        margin-bottom: 0.2rem;
        letter-spacing: 0.2px;
    }
    
    /* Fix alignment and spacing of availability text */
    .modal-print-details {
        text-align: left;
        padding-left: 0;
    }
    
    #modal-availability {
        font-size: 0.9rem;
        white-space: nowrap;
        margin: 0 0 0.4rem 0;
    }
    
    #modal-available, 
    #modal-total,
    #payment-modal-available,
    #payment-modal-total {
        margin: 0 0.15rem;
    }
    
    /* Size and price adjustments */
    .modal-size-price {
        margin-top: 0.1rem;
    }
    
    #modal-size, #payment-modal-size {
        font-size: 0.9rem;
    }
    
    #modal-price, #payment-modal-price {
        font-size: 1.1rem;
    }
    
    /* Form section headers */
    .form-section-title {
        font-size: 1.1rem;
        margin-top: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

@media screen and (max-width: 480px) {
    .nav-logo img {
        width: 60%;
    }
    
    .modal {
        padding: 0; /* No padding on container to maximize space */
        align-items: center; /* Center vertically */
    }
    
    .modal-content {
        width: 92%; /* Width adjustment for better side margins */
        margin: 0 auto; /* Equal margins on both sides */
        padding: 1rem; /* Further reduced padding */
        max-height: 90vh; /* Max height constraint */
    }
    
    /* Make the form more compact */
    .form-group {
        margin-bottom: 0.6rem;
    }
    
    .form-group input,
    .form-group textarea, 
    .form-group select {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    .form-section-title {
        margin-top: 0.75rem;
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }
    
    /* Reduce bottom space */
    .submit-purchase {
        margin-top: 0.75rem;
        padding: 0.7rem;
    }
    
    /* Ensure equal margins on payment modal */
    #payment-modal .modal-content {
        width: 92%;
        padding: 1rem;
    }
    
    /* Compact the Stripe element */
    .stripe-element {
        padding: 0.6rem;
    }

    .print-meta {
        font-size: 0.9rem;
    }
    
    .print-price {
        font-size: 1rem;
    }
    
    /* Switch to single column for smallest screens */
    .prints-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    #modal-image, #payment-modal-image {
        width: 120px; /* Even smaller on very small screens */
        height: 80px; /* Keep 3:2 aspect ratio */
    }
}



/* MAX HEIGHT QUERIES */




@media screen and (max-height: 800px) {
    /* Adjust modal padding */
    .modal-content {
        padding: 1.25rem;
    }
    
    /* Make the modal title smaller */
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Reduce spacing in modal header sections */
    .modal-print-info {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    /* Reduce title size in modal */
    .modal-print-details h3 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }
    
    /* Adjust form section headers to be more compact */
    .form-section-title {
        margin-top: 1rem;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
    
    /* Make form groups more compact */
    .form-group {
        margin-bottom: 0.6rem;
    }
}


/* Apply when screen height is limited */
@media screen and (max-height: 700px) {
    .modal-content {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 0.5rem;
    }
    
    .form-section-title {
        margin-top: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .modal-print-info {
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }
    
    .submit-purchase {
        margin-top: 0.5rem;
        padding: 0.5rem;
    }

    /* Further reduce modal padding */
    .modal-content {
        padding: 1rem;
    }
    
    /* Make images smaller */
    #modal-image, #payment-modal-image {
        width: 150px;
        height: 100px;
    }
    
    /* Smaller modal title */
    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    /* Make input fields more compact */
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.3rem 0.4rem;
        font-size: 0.85rem;
    }
    
    /* Make labels smaller */
    .form-group label {
        font-size: 0.85rem;
    }
    
    /* Adjust section titles */
    .form-section-title {
        margin-top: 0.75rem;
        margin-bottom: 0.4rem;
        font-size: 1rem;
        padding-bottom: 0.3rem;
    }
    
    /* Make the submit button more compact */
    .submit-purchase {
        margin-top: 0.5rem;
        padding: 0.6rem;
        height: auto;
    }
}



/* MAX HEIGHT AND WIDTH */




/* Ensure modal fits when width is also constrained */
@media screen and (max-width: 400px) and (max-height: 700px) {
    /* Reduce image size further */
    #modal-image, #payment-modal-image {
        width: 100px;
        height: 67px;
    }
    
    /* Make sure form inputs remain usable */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Ensures no zoom on mobile */
        padding: 0.25rem;
    }
    
    /* Make sure rows are stacked for very narrow screens */
    .form-row {
        flex-direction: column;
        gap: 0.4rem;
    }
}