* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* 스크롤바 항상 표시로 레이아웃 시프트 방지 */
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* 스크롤바 공간 예약 */
    overflow-x: hidden;
}

main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header/Footer styles moved to header-isolated.css and footer-isolated.css */

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Footer styles moved to footer-isolated.css */

/* Form Styles */
.form-container {
    max-width: 500px;
    margin: 3rem auto 0 auto;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

/* Bootstrap 버튼 클래스가 없는 경우에만 적용 */
.btn:not([class*="btn-primary"]):not([class*="btn-danger"]):not([class*="btn-success"]):not([class*="btn-warning"]):not([class*="btn-info"]):not([class*="btn-secondary"]):not([class*="btn-outline"]):not([class*="btn-dark"]):not([class*="btn-orange"]):not([class*="btn-light"]) {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:not([class*="btn-primary"]):not([class*="btn-danger"]):not([class*="btn-success"]):not([class*="btn-warning"]):not([class*="btn-info"]):not([class*="btn-secondary"]):not([class*="btn-outline"]):not([class*="btn-dark"]):not([class*="btn-orange"]):not([class*="btn-light"]):hover {
    background-color: #2980b9;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15), 0 6px 15px rgba(0,0,0,0.1);
}

a.product-card {
    text-decoration: none;
    color: inherit;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-info {
    padding: 1.2rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,1));
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    color: #2c3e50;
}

.product-title::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(to right, transparent, white);
    pointer-events: none;
}

.product-price {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.3rem;
    font-weight: 700;
}

/* 주황색 버튼 및 배지 */
.btn-orange {
    background-color: #ff5500;
    border-color: #ff5500;
    color: white;
}

.btn-orange:hover {
    background-color: #e64a00;
    border-color: #e64a00;
    color: white;
}

.btn-orange:disabled,
.btn-orange.disabled {
    background-color: #ff5500;
    border-color: #ff5500;
    color: white;
    opacity: 1;
}

.bg-orange {
    background-color: #ff5500 !important;
    color: white;
}

/* Global Toast Notification */
.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -120px);
    background-color: #28a745;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.4s ease-in-out;
}

.custom-toast.show {
    transform: translate(-50%, 0);
}

.custom-toast.error {
    background-color: #dc3545;
}

/* 모바일 반응형 - PGP 가이드 */
@media (max-width: 768px) {
    /* 공개키/암호화메시지/개인키 그리드 - 세로로 배치 */
    .pgp-key-grid {
        grid-template-columns: 1fr !important;
    }

    /* 자동/수동 복호화 방법 - 세로로 배치 */
    .pgp-decrypt-methods {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* "또는" 아이콘 회전 */
    .pgp-decrypt-methods > div:nth-child(2) {
        margin: 15px 0 !important;
    }

    /* 주문/장바구니 안내 카드 세로 배치 */
    .order-status-section,
    .notice-section {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }

    /* 장바구니 컨테이너 padding 축소 */
    .cart-container {
        padding: 1rem !important;
    }

    /* 장바구니 버튼들 세로 정렬 */
    .cart-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .cart-actions .btn,
    .cart-actions form {
        width: 100%;
    }

    .cart-actions .btn {
        width: 100%;
    }
}