/**
 * フォルダ: /var/www/vhosts/repamc.jp/httpdocs/ec/css/
 * ファイル: custom.css
 * バージョン: v1.8.7
 * 概要: REPharmacy統一デザインシステム - 全ページ共通CSS
 * 更新: 2025-08-20 - 共用化・デザイン統一
 */

/* ========================================
   リセット・基本設定
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   REPharmacyカラーパレット
   ======================================== */
:root {
    /* プライマリカラー */
    --med-primary: #2c5cc5;
    --med-primary-dark: #1e4296;
    --med-primary-light: #e8f0ff;
    
    /* ステータスカラー */
    --med-success: #28a745;
    --med-success-dark: #218838;
    --med-success-light: #d4edda;
    
    --med-danger: #dc3545;
    --med-danger-dark: #c82333;
    --med-danger-light: #f8d7da;
    
    --med-warning: #ffc107;
    --med-warning-dark: #e0a800;
    --med-warning-light: #fff3cd;
    
    --med-info: #17a2b8;
    --med-info-dark: #138496;
    --med-info-light: #d1ecf1;
    
    /* 特殊カラー */
    --med-info-bg: #a8d5ba;        /* テーブルヘッダー緑 */
    --med-text-primary: #2d5735;   /* テーブルヘッダー文字 */
    
    /* グレースケール */
    --med-gray-50: #f8f9fa;
    --med-gray-100: #f1f3f5;
    --med-gray-200: #e9ecef;
    --med-gray-300: #dee2e6;
    --med-gray-400: #ced4da;
    --med-gray-500: #adb5bd;
    --med-gray-600: #6c757d;
    --med-gray-700: #495057;
    --med-gray-800: #343a40;
    --med-gray-900: #212529;
    
    /* その他 */
    --med-border: #e0e0e0;
    --med-border-radius: 8px;
    --med-border-radius-sm: 4px;
    --med-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --med-box-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    --med-transition: all 0.3s ease;
}

/* ========================================
   共通コンテナ
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* ========================================
   ヘッダースタイル
   ======================================== */
   
/* ヘッダー上部 */
.med-header-top {
    background: white;
    border-bottom: 1px solid #e8e8e8;
    padding: 8px 0;
}

.med-header-top small {
    color: var(--med-gray-600);
    font-size: 12px;
}

/* メインヘッダー */
.med-header-main {
    background: white;
    border-bottom: 3px solid var(--med-primary);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ロゴ */
.med-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    color: var(--med-primary);
}

.med-logo img {
    height: 60px;
    margin-right: 10px;
}

.med-logo:hover {
    color: var(--med-primary-dark);
}

/* ナビゲーション */
.med-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.med-nav a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: var(--med-border-radius-sm);
    transition: var(--med-transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.med-nav a:hover,
.med-nav a.active {
    background: var(--med-gray-50);
    color: var(--med-primary);
}

/* カートカウント */
.cart-link {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--med-danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* ========================================
   パンくずリスト
   ======================================== */
.breadcrumb {
    background: white;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--med-gray-600);
}

.breadcrumb-list a {
    color: var(--med-primary);
    text-decoration: none;
}

.breadcrumb-list a:hover {
    text-decoration: underline;
}

/* ========================================
   ボタンスタイル
   ======================================== */
   
/* 基本ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--med-border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--med-transition);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* プライマリボタン */
.btn-primary {
    background: var(--med-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--med-primary-dark);
    transform: translateY(-1px);
}

/* 成功ボタン（カート用） */
.btn-success,
.cart-btn {
    background: var(--med-success);
    color: white;
    padding: 8px 20px;
}

.btn-success:hover:not(:disabled),
.cart-btn:hover:not(:disabled) {
    background: var(--med-success-dark);
    transform: translateY(-1px);
}

/* 危険ボタン */
.btn-danger {
    background: var(--med-danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--med-danger-dark);
}

/* アウトラインボタン */
.btn-outline {
    background: white;
    border: 2px solid var(--med-primary);
    color: var(--med-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--med-primary);
    color: white;
}

/* お気に入りボタン */
.favorite-btn {
    background: var(--med-gray-50);
    border: 1px solid var(--med-gray-300);
    color: var(--med-gray-600);
    padding: 8px 12px;
    border-radius: var(--med-border-radius-sm);
    cursor: pointer;
    transition: var(--med-transition);
    font-size: 20px;
}

.favorite-btn:hover,
.favorite-btn.active {
    background: var(--med-danger);
    color: white;
    border-color: var(--med-danger);
}

/* ========================================
   カードスタイル
   ======================================== */
.card {
    background: white;
    border-radius: var(--med-border-radius);
    box-shadow: var(--med-box-shadow);
    overflow: hidden;
    transition: var(--med-transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--med-box-shadow-hover);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--med-border);
    background: var(--med-gray-50);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--med-border);
    background: var(--med-gray-50);
}

/* 商品カード */
.product-card {
    background: white;
    border: 1px solid var(--med-border);
    border-radius: var(--med-border-radius-sm);
    padding: 10px;
    text-decoration: none;
    transition: var(--med-transition);
    position: relative;
    display: block;
}

.product-card:hover {
    box-shadow: var(--med-box-shadow-hover);
    transform: translateY(-2px);
}

.product-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    display: block;
    object-fit: contain;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
}

.product-price {
    color: var(--med-danger);
    font-size: 14px;
    font-weight: bold;
}

/* ========================================
   テーブルスタイル
   ======================================== */
   
/* 基本テーブル */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--med-border);
}

.table th {
    background: var(--med-gray-50);
    font-weight: 600;
    color: var(--med-gray-700);
}

/* REPharmacyスタイルテーブル */
.med-table {
    background: white;
    border: 1px solid var(--med-border);
    border-radius: var(--med-border-radius);
    overflow: hidden;
}

.med-table table {
    width: 100%;
    border-collapse: collapse;
}

.med-table th {
    background: var(--med-info-bg);
    color: var(--med-text-primary);
    font-weight: 600;
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--med-border);
    font-size: 14px;
}

.med-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    font-size: 14px;
}

.med-table tr:last-child td {
    border-bottom: none;
}

/* 価格テーブル */
.price-table {
    width: 100%;
    border: 1px solid var(--med-border);
    border-radius: var(--med-border-radius);
    overflow: hidden;
}

.price-table thead th {
    background: var(--med-gray-50);
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    border-bottom: 2px solid var(--med-border);
}

.price-table tbody td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

/* ========================================
   フォーム要素
   ======================================== */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--med-border);
    border-radius: var(--med-border-radius-sm);
    font-size: 14px;
    transition: var(--med-transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--med-primary);
    box-shadow: 0 0 0 3px rgba(44, 92, 197, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--med-gray-700);
}

.form-group {
    margin-bottom: 20px;
}

/* セレクトボックス */
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--med-border);
    border-radius: var(--med-border-radius-sm);
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: var(--med-transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--med-primary);
}

/* ========================================
   バッジ・ラベル
   ======================================== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--med-border-radius-sm);
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.badge-primary {
    background: var(--med-primary);
    color: white;
}

.badge-success {
    background: var(--med-success);
    color: white;
}

.badge-danger {
    background: var(--med-danger);
    color: white;
}

.badge-warning {
    background: var(--med-warning);
    color: #856404;
}

.badge-info {
    background: var(--med-info);
    color: white;
}

/* 在庫バッジ */
.stock-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
}

.stock-badge.high {
    background: var(--med-success-light);
    color: var(--med-success-dark);
}

.stock-badge.medium {
    background: var(--med-warning-light);
    color: #856404;
}

.stock-badge.low {
    background: var(--med-danger-light);
    color: var(--med-danger-dark);
}

.stock-badge.out {
    background: var(--med-danger);
    color: white;
}

/* ========================================
   アラート・通知
   ======================================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--med-border-radius-sm);
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--med-success-light);
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: var(--med-danger-light);
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: var(--med-warning-light);
    border-color: #ffeeba;
    color: #856404;
}

.alert-info {
    background: var(--med-info-light);
    border-color: #bee5eb;
    color: #0c5460;
}

/* お知らせセクション */
.notices {
    background: #fff9e6;
    border-bottom: 1px solid #ffd966;
    padding: 10px 0;
}

.notices.type-warning {
    background: var(--med-warning-light);
    border-color: var(--med-warning);
}

.notices.type-important {
    background: var(--med-danger-light);
    border-color: var(--med-danger);
}

.notices.type-maintenance {
    background: var(--med-info-light);
    border-color: var(--med-info);
}

.notice-item {
    font-size: 13px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: var(--med-border-radius-sm);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast.show {
    display: block;
}

.toast.success {
    background: var(--med-success);
}

.toast.error {
    background: var(--med-danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   グリッドシステム
   ======================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

.col-auto {
    flex: 0 0 auto;
    padding: 0 10px;
}

/* 商品グリッド（5列固定） */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

/* お気に入りグリッド */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ========================================
   ユーティリティクラス
   ======================================== */
   
/* マージン */
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 30px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 30px; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* パディング */
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 30px; }

/* テキスト */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--med-primary); }
.text-success { color: var(--med-success); }
.text-danger { color: var(--med-danger); }
.text-warning { color: var(--med-warning); }
.text-muted { color: var(--med-gray-600); }

.font-bold { font-weight: bold; }
.font-normal { font-weight: normal; }

/* 表示制御 */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* フレックスボックス */
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }

.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }
.gap-4 { gap: 20px; }
.gap-5 { gap: 30px; }

/* 背景 */
.bg-white { background: white; }
.bg-light { background: var(--med-gray-50); }
.bg-primary { background: var(--med-primary); }
.bg-success { background: var(--med-success); }
.bg-danger { background: var(--med-danger); }

/* ボーダー */
.border { border: 1px solid var(--med-border); }
.border-0 { border: 0; }
.border-top { border-top: 1px solid var(--med-border); }
.border-bottom { border-bottom: 1px solid var(--med-border); }

.rounded { border-radius: var(--med-border-radius); }
.rounded-sm { border-radius: var(--med-border-radius-sm); }
.rounded-circle { border-radius: 50%; }

/* シャドウ */
.shadow { box-shadow: var(--med-box-shadow); }
.shadow-hover:hover { box-shadow: var(--med-box-shadow-hover); }

/* ========================================
   レスポンシブ対応
   ======================================== */
   
/* タブレット (768px - 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* タブレット小 (576px - 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 720px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .med-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* モバイル (575px以下) */
@media (max-width: 575px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .med-logo {
        font-size: 20px;
    }
    
    .med-nav {
        width: 100%;
        justify-content: center;
    }
    
    .med-nav a {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .product-image {
        width: 100px;
        height: 100px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ========================================
   印刷対応
   ======================================== */
@media print {
    .med-header-top,
    .med-header-main,
    .med-nav,
    .breadcrumb,
    .btn,
    .favorite-btn,
    .cart-btn {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .container {
        max-width: 100%;
    }
}

/* ========================================
   バージョン管理表示
   ======================================== */
.version-display {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 11px;
    z-index: 9999;
    font-family: 'Courier New', monospace;
}

/* 本番環境では非表示 */
body[data-env="production"] .version-display {
    display: none;
}

/* ========================================
   アニメーション
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideDown { animation: slideDown 0.3s ease; }
.animate-pulse { animation: pulse 0.3s ease; }

/* ========================================
   カスタムスクロールバー
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--med-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--med-gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--med-gray-500);
}

/* ========================================
   EOFマーカー
   ======================================== */
/* REPharmacy Custom CSS v1.8.7 - 共用化完了 */