.modal {
    padding: 0;
    max-width: 30%; /* Adjusted size */
    max-height: 60vh; /* Reduce modal height */
    border: none;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 1rem auto; /* Center modal with less margin */
}

.modal[open] {
    display: flex;
    flex-direction: column;
}

.modal:not([open]) {
    display: none;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    text-align: center;
    align-items: center;
    gap: 0.5rem; /* Reduce gap between elements */
}

.modal-header {
    width: 100%;
    text-align: right;
    padding: 8px;
    position: relative;
}

/* Remove the h3 styles since we're not showing the card name */
.modal-header h3 {
    display: none;
}

.header-content {
    display: flex;
    justify-content: flex-end; /* Move close button to right */
    align-items: center;
}

.modal-body {
    padding: 0.5rem; /* Reduce padding */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Update footer spacing */
.modal-footer {
    padding: 0.5rem; /* Reduce padding */
    text-align: center;
    display: flex;
    justify-content: center;
    margin-top: 0; /* Remove top margin */
}

.close-button {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.close-button:hover {
    background: #2563eb;
}

.close-button-top {
    font-size: 32px; /* Increased font size for larger X */
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent; /* Removed background color */
    color: #000000; /* Changed to black */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    text-align: center;
    opacity: 0.7; /* Added slight transparency for better appearance */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.close-button-top:hover {
    background: transparent; /* Keep background transparent on hover */
    opacity: 1; /* Full opacity on hover */
    transform: scale(1.1); /* Slightly enlarge on hover */
}

.variations-container {
    margin: 1rem 0;
}

.variations-label {
    font-weight: bold;
}

.flip-box {
    background-color: transparent;
    perspective: 1000px;
    width: 100%;
    height: 100%;
    max-height: 500px; /* Reduce maximum height */
}

.flip-box-inner {
    position: relative;
    width: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-box:hover .flip-box-inner {
    transform: rotateY(180deg);
}

.flip-box-front, .flip-box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-box-back {
    transform: rotateY(180deg);
}

.view-details-button {
    background-color: #3b82f6;
    color: white;
    font-size: 0.875rem; /* Smaller font size */
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.view-details-button:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.bg-white {
    min-height: auto !important; /* Override previous min-height */
    padding-bottom: 2rem; /* Reduce bottom padding */
}

.pt-6 {
    padding-top: 1.5rem; /* Reduce top padding */
}

.mt-6 {
    margin-top: 1rem; /* Reduce top margin */
}

dialog {
    padding: 1rem;
    background: white;
    max-width: 80%;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}