:root {
    --primary-red: #f54336;
    --primary-red-hover: #e03429;
    --header-bg: #444444;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --container-bg: #ffffff;
    --light-grey-bg: #f7f7f7;
    --payment-green: #5cb85c;
    --payment-green-hover: #4cae4c;
    --select-blue: #007bff;
    --go-back-color: #337ab7;
}

/* =================================================================== */
/* 1. GLOBAL & CONTAINER STYLES
/* =================================================================== */
.form-container, .confirmation-container { background-color: var(--container-bg); border-radius: 12px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); overflow: hidden; width: 100%; max-width: 800px; margin: 40px auto; }
.wide-container { max-width: 1000px; }
.form-header { background-color: var(--header-bg); padding: 20px 25px; text-align: center; }
.form-header h1 { margin: 0; font-family: 'Montserrat', sans-serif; font-size: 1.6em; font-weight: bold; color: white; }
.form-body { padding: 30px; }
.info-text { font-size: 1.1em; line-height: 1.6; color: #444; margin-bottom: 20px; }
.small-text { font-size: 0.9em; font-style: italic; color: #666; }
.form-section-header { font-family: 'Montserrat'; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin: 25px 0 20px 0; font-size: 1.3em; color: var(--header-bg); }
.hidden { display: none !important; }

/* =================================================================== */
/* 2. GENERAL FORM ELEMENTS & GRIDS
/* =================================================================== */
.form-group { margin-bottom: 20px; }
.form-group label, .group-label { display: block; font-weight: bold; margin-bottom: 8px; font-size: 1em; }
.required { color: var(--primary-red); }
.form-body select, input[type="text"], input[type="date"], input[type="email"], input[type="tel"], input[type="number"], textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px; background-color: white; font-size: 1em; box-sizing: border-box; font-family: 'Lato', sans-serif; }
.form-body select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 1.2em; }
.helper-text { font-size: 0.9em; font-style: italic; color: #666; margin: 5px 0 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-col-span-2 { grid-column: span 2; }

/* --- NEW STYLE FOR HORIZONTAL RADIO BUTTONS --- */
.radio-group-flex {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 30px;       /* Spacing between the radio button options */
    margin-top: 10px;  /* Space below the group's label */
}
/* When horizontal, remove any default bottom margin on the options */
.radio-group-flex .radio-option {
    margin-bottom: 0;
}
/* --- END OF NEW STYLE --- */

@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .grid-col-span-2 { grid-column: span 1; } }

/* =================================================================== */
/* 3. PAGE-SPECIFIC STYLES
/* =================================================================== */

/* --- Player Description Page --- */
.radio-item, .radio-option { display: flex; align-items: center; margin-bottom: 15px; }
.radio-item input[type="radio"], .radio-option input[type="radio"] { width: 20px; height: 20px; margin-right: 12px; accent-color: var(--primary-red); }
.radio-item label, .radio-option label { font-size: 1.1em; font-weight: normal; }

/* --- Package Selection Page (UPDATED - 25% SMALLER WITH TALLER HEIGHT) --- */
.package-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); /* Reduced from 280px to 210px (25% smaller) */
    gap: 18px; /* Reduced from 25px to 18px */
    align-items: stretch; 
}
.package-card { 
    display: block; 
    border: 1px solid var(--border-color); 
    border-radius: 10px; 
    cursor: pointer; 
    transition: all 0.2s ease-in-out; 
    background-color: #fff; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    min-height: 650px; /* Ensure minimum height to show all content */
}
.package-card.selected { border: 2px solid var(--primary-red); }
.package-card-content { 
    padding: 18px; /* Reduced from 25px to 18px */
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    height: 100%;
    min-height: 630px; /* Ensure content area has enough height */
}
.package-card-content h2 { 
    color: var(--header-bg); 
    margin-top: 0; 
    border: none; 
    font-size: 1.35em; /* Reduced from 1.8em to 1.35em (25% smaller) */
    font-weight: 600; 
}
.instrument-image { 
    width: 100%; 
    height: 112px; /* Reduced from 150px to 112px (25% smaller) */
    object-fit: contain; 
    margin-bottom: 18px; /* Reduced from 25px to 18px */
}
.package-card-content ul { 
    list-style-type: none; 
    text-align: left; 
    padding-left: 5px; 
    margin-top: 0; 
    color: #444; 
    flex-grow: 1;
    margin-bottom: 20px; /* Add space before brand selection */
}
.brand-selection {
    margin: 20px 0 15px 0; /* Add more space above and below */
    text-align: left;
}
.brand-selection label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1em;
}
.custom-brand-field {
    margin: 15px 0; /* Add margin above and below */
    text-align: left;
}
.custom-brand-field label {
    display: block;
    font-weight: normal; /* A bit less emphasis than the main dropdown label */
    margin-bottom: 5px;
    font-size: 0.9em;
}
.package-card-content li { 
    margin-bottom: 9px; /* Reduced from 12px to 9px */
    line-height: 1.3; /* Slightly tighter line height */
    padding-left: 22px; /* Reduced from 30px to 22px */
    position: relative; 
}
.package-card-content li::before { 
    content: '✓'; 
    position: absolute; 
    left: 0; 
    color: var(--primary-red); 
    font-weight: bold; 
    font-size: 1em; /* Reduced from 1.2em to 1em */
}
.price-display {
    font-size: 1.2em; /* Reduced from 1.6em to 1.2em (25% smaller) */
    font-weight: bold;
    color: var(--primary-red);
    margin-top: 20px; /* Add space above price */
    padding: 8px; /* Reduced from 10px to 8px */
    background-color: var(--container-bg);
    border-radius: 6px;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
    margin-bottom: 0; /* Ensure it sits at bottom */
}
.condition-options { 
    margin: 20px 0 15px 0; /* Add more space above and ensure space below */
    padding: 15px; /* Reduced from 20px to 15px */
    background-color: var(--light-grey-bg); 
    border-radius: 8px; 
}
.radio-option-small { display: flex; align-items: center; justify-content: flex-start; cursor: pointer; }
.radio-option-small:not(:last-child) { 
    margin-bottom: 11px; /* Reduced from 15px to 11px */
}
.radio-option-small input[type="radio"] { display: none; }
.radio-option-small label { font-weight: normal; margin-left: 10px; position: relative; font-size: 1em; }
.radio-option-small label::before { content: ''; display: inline-block; width: 20px; height: 20px; border: 2px solid #ccc; border-radius: 50%; margin-right: 15px; vertical-align: middle; background-color: #fff; }
.radio-option-small input[type="radio"]:checked + label::before { border-color: var(--primary-red); }
.radio-option-small input[type="radio"]:checked + label::after { content: ''; display: block; width: 12px; height: 12px; background: var(--primary-red); border-radius: 50%; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); }

/* --- Maintenance Page --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background-color: white; padding: 30px; border-radius: 10px; text-align: center; width: 90%; max-width: 500px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.modal-btn { flex-grow: 0 !important; padding: 10px 30px; font-weight: bold; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; border: 2px solid transparent; }
.modal-btn.go-back { background-color: var(--go-back-color); color: white; border-color: var(--go-back-color); }
.modal-btn.decline { background-color: white; color: var(--primary-red); border-color: var(--primary-red); }

/* --- Accessories Page --- */
.accessory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 25px; }
.accessory-card { background-color: #fff; border: 1px solid var(--border-color); border-radius: 8px; text-align: center; display: flex; flex-direction: column; cursor: pointer; transition: all 0.2s ease-in-out; }
.accessory-card.selected { border-color: var(--select-blue); box-shadow: 0 0 0 3px var(--select-blue); }
.accessory-image { width: 100%; height: 140px; object-fit: contain; padding: 15px; box-sizing: border-box; }
.accessory-card h3 { margin: 0 15px 10px 15px; font-family: 'Montserrat'; color: var(--header-bg); }
.accessory-desc { margin: 0 15px 15px 15px; font-size: 0.9em; color: #666; line-height: 1.5; flex-grow: 1; }
.accessory-footer { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-top: 1px solid var(--border-color); background-color: var(--light-grey-bg); }
.accessory-price { font-size: 1.2em; font-weight: bold; color: var(--header-bg); }
.accessory-select input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--select-blue); cursor: pointer; }

/* --- Order Summary Page --- */
.summary-cart { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.summary-cart th, .summary-cart td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.total-label { text-align: right !important; font-weight: bold; font-size: 1.2em; }
.total-amount { font-weight: bold; font-size: 1.4em; color: var(--header-bg); }
.disclaimer-text { font-size: 0.85em; color: #777; font-style: italic; text-align: center; margin-top: -10px; margin-bottom: 25px; }
.scroll-section-container { max-width: 1000px; margin: 40px auto; padding: 0 20px; }
.scroll-wrapper { display: flex; overflow-x: auto; padding-bottom: 20px; gap: 20px; }
.accessory-card-small { flex: 0 0 220px; border: 1px solid var(--border-color); border-radius: 8px; text-align: center; padding: 20px; background: white; display: flex; flex-direction: column; align-items: center; }
.add-btn { background-color: var(--payment-green); color: white; border: none; border-radius: 6px; padding: 10px 20px; font-weight: bold; cursor: pointer; width: 100%; }

/* Styles for deleted cart items */
.deleted-item td { text-decoration: line-through; color: #999; }
.action-cell { width: 50px; text-align: center !important; }
.action-icon { cursor: pointer; font-size: 1.4em; user-select: none; }

/* --- NEW MODAL STYLES --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.modal-content {
    background-color: white; padding: 0; border-radius: 10px;
    width: 90%; max-width: 500px; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
    margin: 0; font-size: 1.4em; text-align: left; border: none; padding: 0;
}
.close-modal-btn {
    background: none; border: none; font-size: 2.5em; line-height: 1;
    cursor: pointer; color: #888; padding: 0;
}
.modal-accessory-list {
    padding: 20px; max-height: 60vh; overflow-y: auto;
}
.modal-accessory-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid #f0f0f0;
}
.modal-accessory-item:last-child { border-bottom: none; }
.modal-item-name { font-weight: bold; }
.add-btn-small {
    background-color: var(--payment-green); color: white; border: none;
    border-radius: 6px; padding: 8px 15px; font-weight: bold; cursor: pointer;
}
/* --- END OF NEW MODAL STYLES --- */

/* --- Rental Summary & Confirmation Pages --- */
.summary-list { list-style-type: none; padding: 0; margin: 0 0 30px 0; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.summary-list li { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid var(--border-color); }
.confirmation-container { padding: 40px; text-align: center; }
.confirmation-icon { font-size: 4em; color: var(--payment-green); width: 100px; height: 100px; line-height: 100px; border: 4px solid var(--payment-green); border-radius: 50%; margin: 0 auto 20px auto; }
.confirmation-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; text-align: left; margin: 40px 0; }
.detail-box { background-color: var(--light-grey-bg); padding: 25px; border-radius: 8px; }
.download-link { display: inline-block; margin-top: 15px; background-color: var(--primary-red); color: white; text-decoration: none; padding: 10px 15px; border-radius: 6px; font-weight: bold; }
.back-to-home { max-width: 250px !important; margin: 0 auto; display: block; }

/* =================================================================== */
/* 4. NAVIGATION
/* =================================================================== */
.form-nav {
    display: flex;
    justify-content: center; /* This centers the content! */
    padding: 10px 25px 10px 25px;
    gap: 15px;
    margin-top: 30px;
}
.nav-btn { border: none; border-radius: 8px; padding: 12px 20px; font-family: 'Montserrat', sans-serif; font-size: 1.1em; font-weight: bold; text-decoration: none; color: white; cursor: pointer; text-align: center; transition: background-color 0.2s ease; flex-grow: 1; flex-basis: 0; max-width: 240px; }
.prev-btn { background-color: var(--primary-red); }
.continue-btn, .payment-btn, .finalize-btn, .nav-btn.next-btn { background-color: var(--payment-green); }
.nav-btn:disabled { background-color: #ccc; color: #666; cursor: not-allowed; box-shadow: none; }

/* =================================================================== */
/* 5. RESPONSIVE DESIGN FOR SMALLER PACKAGE CARDS WITH MOBILE SPACING
/* =================================================================== */
@media (max-width: 768px) {
    .package-grid { 
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 25px; /* Increased gap for mobile - adds extra space between cards */
    }
    
    .package-card {
        min-height: 600px; /* Slightly shorter for mobile but still tall enough */
    }
    
    .package-card-content { 
        padding: 15px;
        min-height: 580px; /* Adjust content height for mobile */
    }
    
    .instrument-image { 
        height: 90px;
    }
    
    .package-card-content h2 { 
        font-size: 1.2em;
    }
    
    .price-display {
        font-size: 1.1em;
        margin-top: 15px;
        padding: 6px;
    }
}

/* For very small phones, add even more spacing */
@media (max-width: 480px) {
    .package-grid {
        gap: 30px; /* Even more spacing on very small screens */
    }
    
    .package-card {
        min-height: 550px; /* Even more compact for very small screens */
    }
    
    .package-card-content {
        min-height: 530px;
    }
}