/* 
 * Missing Modal Layout Styles
 * Defines CSS for: standard, split, cover, and compact modal layouts
 */

/* ============================================================================
   LAYOUT 1: STANDARD (Image Top) - Default Clean Layout
   Image at top, content below in traditional stack
   ============================================================================ */

.ho-modal.ho-layout-standard .ho-modal-content {
    background: var(--ho-bg-card);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ho-modal.ho-layout-standard .ho-modal-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.ho-modal.ho-layout-standard .ho-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.ho-modal.ho-layout-standard #ho-modal-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--ho-text-body);
    line-height: 1.3;
}

.ho-modal.ho-layout-standard #ho-modal-desc {
    font-size: 15px;
    color: var(--ho-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.ho-modal.ho-layout-standard .ho-modal-price-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--ho-primary);
    margin-bottom: 20px;
}

.ho-modal.ho-layout-standard .ho-modal-actions {
    padding: 20px 28px;
    border-top: 1px solid var(--ho-border-color);
    background: var(--ho-bg-light);
    display: flex;
    gap: 15px;
    align-items: center;
}

.ho-modal.ho-layout-standard .ho-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    color: var(--ho-text-body);
}

.ho-modal.ho-layout-standard .ho-modal-close:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   LAYOUT 2: SPLIT (Image Left) - Modern Side-by-Side
   50/50 split with image on left, content on right
   ============================================================================ */

.ho-modal.ho-layout-split .ho-modal-content {
    background: var(--ho-bg-card);
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 45% 55%;
    grid-template-rows: auto 1fr auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ho-modal.ho-layout-split .ho-modal-img {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 400px;
}

.ho-modal.ho-layout-split .ho-modal-close {
    grid-column: 2;
    grid-row: 1;
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--ho-bg-card);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--ho-border-color);
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--ho-text-body);
}

.ho-modal.ho-layout-split .ho-modal-close:hover {
    background: var(--ho-bg-light);
    transform: rotate(90deg);
}

.ho-modal.ho-layout-split .ho-modal-body {
    grid-column: 2;
    grid-row: 2;
    padding: 32px;
    overflow-y: auto;
}

.ho-modal.ho-layout-split #ho-modal-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--ho-text-body);
    line-height: 1.2;
}

.ho-modal.ho-layout-split #ho-modal-desc {
    font-size: 15px;
    color: var(--ho-text-muted);
    margin-bottom: 24px;
    line-height: 1.7;
}

.ho-modal.ho-layout-split .ho-modal-price-text {
    font-size: 26px;
    font-weight: 700;
    color: var(--ho-primary);
    margin-bottom: 24px;
    display: inline-block;
    padding: 8px 16px;
    background: color-mix(in srgb, var(--ho-primary) 10%, transparent);
    border-radius: 8px;
}

.ho-modal.ho-layout-split .ho-modal-actions {
    grid-column: 2;
    grid-row: 3;
    padding: 24px 32px;
    border-top: 1px solid var(--ho-border-color);
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--ho-bg-light);
}

/* Mobile Responsive - Stack on small screens */
@media (max-width: 768px) {
    .ho-modal.ho-layout-split .ho-modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: 250px auto auto;
        max-width: 95%;
    }

    .ho-modal.ho-layout-split .ho-modal-img {
        grid-column: 1;
        grid-row: 1;
        min-height: 250px;
    }

    .ho-modal.ho-layout-split .ho-modal-body {
        grid-column: 1;
        grid-row: 2;
        padding: 24px;
    }

    .ho-modal.ho-layout-split .ho-modal-actions {
        grid-column: 1;
        grid-row: 3;
        padding: 20px 24px;
    }
}

/* ============================================================================
   LAYOUT 3: COVER (Header Background) - Immersive Overlay
   Large background image with overlaid content
   ============================================================================ */

.ho-modal.ho-layout-cover .ho-modal-content {
    background: var(--ho-bg-card);
    border-radius: 16px;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ho-modal.ho-layout-cover .ho-modal-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    position: relative;
}

/* Header Overlay Container */
.ho-modal.ho-layout-cover .ho-modal-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 320px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 60%,
        rgba(0, 0, 0, 0.8) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    z-index: 1;
}

.ho-modal.ho-layout-cover #ho-modal-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ho-modal.ho-layout-cover .ho-modal-price-text {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    display: inline-block;
    padding: 6px 14px;
    background: var(--ho-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ho-modal.ho-layout-cover .ho-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
    background: var(--ho-bg-card);
}

.ho-modal.ho-layout-cover #ho-modal-desc {
    font-size: 15px;
    color: var(--ho-text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
}

.ho-modal.ho-layout-cover .ho-modal-actions {
    padding: 20px 28px;
    border-top: 1px solid var(--ho-border-color);
    background: var(--ho-bg-light);
    display: flex;
    gap: 15px;
    align-items: center;
}

.ho-modal.ho-layout-cover .ho-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.ho-modal.ho-layout-cover .ho-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

/* ============================================================================
   LAYOUT 4: COMPACT (Small Thumbnail) - Minimal Space-Efficient
   Small thumbnail with content focused layout
   ============================================================================ */

.ho-modal.ho-layout-compact .ho-modal-content {
    background: var(--ho-bg-card);
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: modalSlideDown 0.3s ease-out;
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ho-modal.ho-layout-compact .ho-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Compact Header with Thumbnail */
.ho-modal.ho-layout-compact .ho-modal-header-compact {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ho-border-color);
}

.ho-modal.ho-layout-compact .ho-modal-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ho-modal.ho-layout-compact .ho-modal-header-text {
    flex: 1;
    min-width: 0;
}

.ho-modal.ho-layout-compact #ho-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--ho-text-body);
    line-height: 1.3;
}

.ho-modal.ho-layout-compact .ho-modal-price-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--ho-primary);
    display: inline-block;
}

.ho-modal.ho-layout-compact #ho-modal-desc {
    font-size: 14px;
    color: var(--ho-text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.ho-modal.ho-layout-compact .ho-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--ho-border-color);
    background: var(--ho-bg-light);
    display: flex;
    gap: 12px;
    align-items: center;
}

.ho-modal.ho-layout-compact .ho-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--ho-bg-card);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--ho-border-color);
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--ho-text-muted);
}

.ho-modal.ho-layout-compact .ho-modal-close:hover {
    background: var(--ho-bg-light);
    color: var(--ho-text-body);
    transform: scale(1.1);
}

/* Compact Variations and Options */
.ho-modal.ho-layout-compact #ho-modal-variations {
    margin: 16px 0;
}

.ho-modal.ho-layout-compact .ho-modal-qty {
    height: 44px;
}

.ho-modal.ho-layout-compact #ho-modal-add-btn {
    height: 44px;
    padding: 0 24px;
}

/* Mobile adjustments for compact */
@media (max-width: 480px) {
    .ho-modal.ho-layout-compact .ho-modal-content {
        max-width: 95%;
    }

    .ho-modal.ho-layout-compact .ho-modal-img {
        width: 80px;
        height: 80px;
    }

    .ho-modal.ho-layout-compact #ho-modal-title {
        font-size: 18px;
    }
}

/* ============================================================================
   GLOBAL MODAL IMPROVEMENTS
   Shared enhancements across all layouts
   ============================================================================ */

/* Smooth modal backdrop */
.ho-modal {
    backdrop-filter: blur(2px);
    transition: backdrop-filter 0.3s ease;
}

.ho-modal.active {
    backdrop-filter: blur(4px);
}

/* Ensure special instructions textarea styling */
.ho-modal .ho-modal-instructions-container {
    margin: 20px 0;
}

.ho-modal .ho-modal-instructions-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ho-text-body);
}

.ho-modal .ho-modal-instructions-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--ho-border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    background: var(--ho-bg-light);
    color: var(--ho-text-body);
}

.ho-modal .ho-modal-instructions-input:focus {
    outline: none;
    border-color: var(--ho-primary);
    background: var(--ho-bg-card);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ho-primary) 10%, transparent);
}

/* Ensure add button consistency */
.ho-modal #ho-modal-add-btn {
    background: var(--ho-btn-bg) !important;
    color: var(--ho-btn-text) !important;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.ho-modal #ho-modal-add-btn:hover {
    background: color-mix(in srgb, var(--ho-btn-bg), black 10%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Variation groups styling */
.ho-modal #ho-modal-variations {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ho-modal .ho-variation-group {
    padding: 16px;
    background: var(--ho-bg-light);
    border-radius: 8px;
    border: 1px solid var(--ho-border-color);
}

.ho-modal .ho-variation-group-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--ho-text-body);
}
