/* Battery Details Modal */
.details-btn {
    width: 100%;
    padding: 1rem 2rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #2e7d32, #388e3c, #43a047);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(46, 125, 50, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.details-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #1b5e20, #2e7d32, #388e3c);
    box-shadow:
        0 6px 20px rgba(46, 125, 50, 0.5),
        0 3px 12px rgba(0, 0, 0, 0.2);
}

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: block;
    padding: 2rem;
}

@media (max-width: 768px) {
    .modal.active {
        padding: 0;
    }
}

/* Modal Content */
.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 25px;
    max-width: 95%;
    width: 95%;
    margin: 0 auto;
    overflow: visible;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.4s ease;
    display: flex;
    flex-direction: column;
}

/* Disable body scroll when modal is active */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 3rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    color: #f44336;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

/* Modal Title */
.modal-title {
    font-size: 2rem;
    color: #333;
    text-align: center;
    margin: 1rem 2rem 0.5rem 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #66bb6a;
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

/* Modal Body */
.modal-body {
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    flex: 1;
}

/* Gallery Section */
.gallery-section {
    display: flex;
    flex-direction: column;
}

.gallery-section h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #66bb6a;
    flex-shrink: 0;
}

.gallery-main {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    border: 3px solid #66bb6a;
    flex-shrink: 0;
    position: relative;
}

.gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

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

/* Hide navigation buttons on desktop */
.gallery-nav-btn {
    display: none;
}

/* Gallery Thumbs Container with Navigation */
.gallery-thumbs-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-nav-thumb-btn {
    background: rgba(76, 175, 80, 0.9);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.gallery-nav-thumb-btn:hover {
    background: rgba(76, 175, 80, 1);
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.6);
    transform: scale(1.1);
}

.gallery-nav-thumb-btn:active {
    transform: scale(0.95);
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    flex-shrink: 0;
    flex: 1;
    overflow: hidden;
}

.gallery-thumbs img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 5px;
}

.gallery-thumbs img:hover {
    border-color: #66bb6a;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 187, 106, 0.4);
}

.gallery-thumbs img.active {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Specs Section */
.specs-section {
}

.specs-section h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #66bb6a;
}

.spec-category {
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 187, 106, 0.2);
}

.spec-category h4 {
    font-size: 1.2rem;
    color: #4caf50;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e0e0e0;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
}

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

.specs-table td {
    padding: 0.5rem 0.5rem;
    font-size: 0.95rem;
}

.specs-table td:first-child {
    font-weight: 700;
    color: #555;
    width: 60%;
}

.specs-table td:last-child {
    color: #333;
    text-align: right;
    font-weight: 500;
}

.specs-table td .inverter-dropdown-inline {
    width: 100%;
    min-width: 200px;
    text-align: left;
}

.advantages-list,
.package-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.advantages-list li,
.package-list li {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

.advantages-list li {
    color: #4caf50;
    font-weight: 500;
}

/* Modal Footer */
.modal-footer {
    padding: 1rem 2rem;
    border-top: 2px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: linear-gradient(180deg, transparent, rgba(102, 187, 106, 0.05));
    flex-shrink: 0;
}

.modal-footer .btn {
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.modal-footer .btn-secondary {
    background: #616161;
    color: white;
    box-shadow:
        0 4px 15px rgba(97, 97, 97, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-footer .btn-secondary:hover {
    background: #424242;
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(97, 97, 97, 0.4),
        0 3px 12px rgba(0, 0, 0, 0.2);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #2e7d32, #388e3c, #43a047);
    color: white;
    box-shadow:
        0 4px 15px rgba(46, 125, 50, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #1b5e20, #2e7d32, #388e3c);
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(46, 125, 50, 0.5),
        0 3px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .gallery-section {
        position: relative;
        top: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .gallery-main {
        max-width: 100%;
    }

    .gallery-thumbs {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .modal {
        padding: 0;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background-color: white;
        backdrop-filter: none;
    }

    .modal-content {
        width: 100vw;
        max-width: 100vw;
        max-height: none;
        border-radius: 0;
        min-height: 100vh;
        position: static;
        margin: 0 0 5rem 0;
        padding: 0 0 2rem 0;
        box-shadow: none;
        background: white;
        animation: none;
        transform: none;
    }

    .modal-close {
        position: fixed !important;
        top: 0.5rem;
        right: 0.5rem;
        width: 45px;
        height: 45px;
        font-size: 2.5rem;
        z-index: 99999;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
        background: rgba(255, 255, 255, 0.98);
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        border: 2px solid rgba(102, 187, 106, 0.3);
    }

    .modal-close:active {
        transform: scale(0.9) !important;
    }

    .modal-title {
        font-size: 1.4rem;
        margin: 0 !important;
        padding: 0 3.5rem 0.5rem 1rem !important;
        border-bottom: 2px solid rgba(102, 187, 106, 0.2);
        background: white;
        line-height: 1.2;
        text-align: left;
    }

    .modal-body {
        padding: 0;
        margin: 0;
        gap: 0;
        grid-template-columns: 1fr;
        overflow: hidden;
    }

    .modal-footer {
        padding: 1rem 1rem 4.5rem 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .modal-footer .btn {
        width: 100%;
        max-width: 100%;
        text-align: center;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .gallery-section {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 0 0 1rem 0;
    }

    .gallery-section h3 {
        margin: 0;
        padding: 0.8rem 1rem;
        font-size: 1.3rem;
        background: linear-gradient(135deg, rgba(102, 187, 106, 0.1), rgba(76, 175, 80, 0.05));
    }

    .gallery-main {
        margin: 0 0 0.5rem 0;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        border-width: 0;
        border-radius: 0;
        position: relative;
    }

    .gallery-main img {
        width: 100%;
        height: auto;
        max-width: 100%;
        display: block;
    }

    /* Gallery navigation buttons on mobile */
    .gallery-main .gallery-nav-btn {
        display: flex !important;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 45px;
        height: 45px;
        background: rgba(76, 175, 80, 0.95);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 2rem;
        font-weight: bold;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 100;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        line-height: 1;
        padding: 0;
    }

    .gallery-main .gallery-prev {
        left: 10px;
    }

    .gallery-main .gallery-next {
        right: 10px;
    }

    .gallery-main .gallery-nav-btn:active {
        transform: translateY(-50%) scale(0.9) !important;
        background: rgba(76, 175, 80, 1);
    }

    .gallery-main .gallery-nav-btn:hover {
        background: rgba(76, 175, 80, 1);
        box-shadow: 0 6px 18px rgba(76, 175, 80, 0.6);
    }

    /* Ensure thumbnails have no buttons */
    .gallery-thumbs img {
        position: static !important;
    }

    .gallery-thumbs button,
    .gallery-thumbs .gallery-nav-btn {
        display: none !important;
    }

    .gallery-thumbs-container {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: linear-gradient(135deg, rgba(102, 187, 106, 0.08) 0%, rgba(76, 175, 80, 0.05) 100%);
        padding: 0.8rem 0.5rem;
        border-radius: 0;
        box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
        border: none;
        border-top: 1px solid rgba(102, 187, 106, 0.2);
        border-bottom: 1px solid rgba(102, 187, 106, 0.2);
    }

    .gallery-nav-thumb-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        flex-shrink: 0;
        background: linear-gradient(135deg, #66bb6a, #4caf50);
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.35);
    }

    .gallery-nav-thumb-btn:active {
        transform: scale(0.9);
    }

    .gallery-thumbs {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding: 5px;
        flex: 1;
        scrollbar-width: thin;
        scrollbar-color: rgba(76, 175, 80, 0.5) rgba(0, 0, 0, 0.05);
    }

    .gallery-thumbs::-webkit-scrollbar {
        height: 6px;
    }

    .gallery-thumbs::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 10px;
    }

    .gallery-thumbs::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, #66bb6a, #4caf50);
        border-radius: 10px;
        transition: background 0.3s ease;
    }

    .gallery-thumbs::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(90deg, #4caf50, #388e3c);
    }

    .gallery-thumbs img {
        width: 75px;
        height: 75px;
        flex-shrink: 0;
        aspect-ratio: 1 / 1;
        padding: 4px;
        margin: 0;
        border: 2px solid rgba(76, 175, 80, 0.2);
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
        border-radius: 12px;
        box-sizing: border-box;
        display: block;
        object-fit: contain;
        background: white;
        position: static;
        overflow: visible;
        scroll-snap-align: center;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .gallery-thumbs img:active {
        transform: scale(0.95);
    }

    .gallery-thumbs img.active {
        border: 3px solid #4caf50;
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6), 0 0 0 4px rgba(76, 175, 80, 0.15);
        transform: scale(1.05);
    }

    .specs-section {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
        padding: 0;
    }

    .specs-section h3 {
        margin: 0;
        padding: 1rem;
        background: linear-gradient(135deg, rgba(102, 187, 106, 0.1), rgba(76, 175, 80, 0.05));
    }

    .spec-category {
        margin: 0;
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 0;
        background: white;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: none;
    }

    .spec-category h4 {
        font-size: 1.1rem;
    }

    .specs-table {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    .specs-table td {
        font-size: 0.85rem;
        padding: 0.4rem 0.3rem;
    }
}

/* Success Order Modal */
.success-modal-content {
    max-width: 600px;
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9f4 100%);
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #2e7d32, #43a047);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successIconPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow:
        0 10px 40px rgba(46, 125, 50, 0.3),
        0 0 0 0 rgba(46, 125, 50, 0.4);
}

@keyframes successIconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon svg {
    width: 60px;
    height: 60px;
    color: white;
    stroke-width: 3;
    animation: checkmark 0.8s ease-in-out 0.3s both;
}

@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
        stroke-dasharray: 100;
    }
    100% {
        stroke-dashoffset: 0;
        stroke-dasharray: 100;
    }
}

.success-title {
    font-size: 2rem;
    font-weight: 800;
    color: #2e7d32;
    margin-bottom: 1rem;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.success-message {
    font-size: 1.1rem;
    color: #424242;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

.success-order-number {
    font-size: 1.2rem;
    color: #1b5e20;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(46, 125, 50, 0.1);
    border-radius: 8px;
    border: 2px dashed #2e7d32;
    animation: fadeInUp 0.5s ease-out 0.4s both;
}

.success-order-number strong {
    font-weight: 800;
    color: #2e7d32;
    font-size: 1.3rem;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    animation: fadeInUp 0.5s ease-out 0.5s both;
}

.success-actions .btn {
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    background: linear-gradient(135deg, #2e7d32, #388e3c, #43a047);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(46, 125, 50, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.success-actions .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.success-actions .btn:hover::before {
    width: 300px;
    height: 300px;
}

.success-actions .btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #1b5e20, #2e7d32, #388e3c);
    box-shadow:
        0 8px 25px rgba(46, 125, 50, 0.5),
        0 4px 15px rgba(0, 0, 0, 0.2);
}

.success-actions .btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow:
        0 4px 15px rgba(46, 125, 50, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.15);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .success-modal-content {
        padding: 2rem 1.5rem;
    }

    .success-icon {
        width: 80px;
        height: 80px;
    }

    .success-icon svg {
        width: 50px;
        height: 50px;
    }

    .success-title {
        font-size: 1.5rem;
    }

    .success-message {
        font-size: 1rem;
    }

    .success-order-number {
        font-size: 1rem;
    }

    .success-order-number strong {
        font-size: 1.1rem;
    }

    .success-actions .btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: 100%;
    }
}
